repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getClassAndAlias | public static function getClassAndAlias($class)
{
if (false !== strpos($class, ' ')) {
list($class, $alias) = explode(' ', $class);
} else {
$alias = null;
}
if (0 === strpos($class, '\\')) {
$class = substr($class, 1);
}
return [$... | php | public static function getClassAndAlias($class)
{
if (false !== strpos($class, ' ')) {
list($class, $alias) = explode(' ', $class);
} else {
$alias = null;
}
if (0 === strpos($class, '\\')) {
$class = substr($class, 1);
}
return [$... | [
"public",
"static",
"function",
"getClassAndAlias",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"class",
",",
"' '",
")",
")",
"{",
"list",
"(",
"$",
"class",
",",
"$",
"alias",
")",
"=",
"explode",
"(",
"' '",
",",
... | Returns the class and alias of a string representing a model or a relation
e.g. 'Book b' => array('Book', 'b')
e.g. 'Book' => array('Book', null)
@param string $class The classname to explode
@return array list($className, $aliasName) | [
"Returns",
"the",
"class",
"and",
"alias",
"of",
"a",
"string",
"representing",
"a",
"model",
"or",
"a",
"relation",
"e",
".",
"g",
".",
"Book",
"b",
"=",
">",
"array",
"(",
"Book",
"b",
")",
"e",
".",
"g",
".",
"Book",
"=",
">",
"array",
"(",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L903-L915 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getRelationName | public static function getRelationName($relation)
{
// get the relationName
list($fullName, $relationAlias) = self::getClassAndAlias($relation);
if ($relationAlias) {
$relationName = $relationAlias;
} elseif (false === strpos($fullName, '.')) {
$relationName =... | php | public static function getRelationName($relation)
{
// get the relationName
list($fullName, $relationAlias) = self::getClassAndAlias($relation);
if ($relationAlias) {
$relationName = $relationAlias;
} elseif (false === strpos($fullName, '.')) {
$relationName =... | [
"public",
"static",
"function",
"getRelationName",
"(",
"$",
"relation",
")",
"{",
"// get the relationName",
"list",
"(",
"$",
"fullName",
",",
"$",
"relationAlias",
")",
"=",
"self",
"::",
"getClassAndAlias",
"(",
"$",
"relation",
")",
";",
"if",
"(",
"$",... | Returns the name of a relation from a string.
The input looks like '$leftName.$relationName $relationAlias'
@param string $relation Relation to use for the join
@return string the relationName used in the join | [
"Returns",
"the",
"name",
"of",
"a",
"relation",
"from",
"a",
"string",
".",
"The",
"input",
"looks",
"like",
"$leftName",
".",
"$relationName",
"$relationAlias"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L924-L937 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.findOne | public function findOne(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->limit(1);... | php | public function findOne(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->limit(1);... | [
"public",
"function",
"findOne",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
"(",
"$",
"this",... | Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
and format the result with the current formatter
By default, returns a model object.
Does not work with ->with()s containing one-to-many relations.
@param ConnectionInterface $con an optional connection object
@return mixed the result, formatted by ... | [
"Issue",
"a",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"format",
"the",
"result",
"with",
"the",
"current",
"formatter",
"By",
"default",
"returns",
"a",
"model",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1015-L1030 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.requirePk | public function requirePk($key, ConnectionInterface $con = null)
{
$result = $this->findPk($key, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | php | public function requirePk($key, ConnectionInterface $con = null)
{
$result = $this->findPk($key, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | [
"public",
"function",
"requirePk",
"(",
"$",
"key",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"findPk",
"(",
"$",
"key",
",",
"$",
"con",
")",
";",
"if",
"(",
"$",
"result",
"===",
"null",... | Find object by primary key
Behaves differently if the model has simple or composite primary key
<code>
// simple primary key
$book = $c->requirePk(12, $con);
// composite primary key
$bookOpinion = $c->requirePk(array(34, 634), $con);
</code>
Throws an exception when nothing was found.
@param mixed $ke... | [
"Find",
"object",
"by",
"primary",
"key",
"Behaves",
"differently",
"if",
"the",
"model",
"has",
"simple",
"or",
"composite",
"primary",
"key",
"<code",
">",
"//",
"simple",
"primary",
"key",
"$book",
"=",
"$c",
"-",
">",
"requirePk",
"(",
"12",
"$con",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1050-L1059 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.requireOne | public function requireOne(ConnectionInterface $con = null)
{
$result = $this->findOne($con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | php | public function requireOne(ConnectionInterface $con = null)
{
$result = $this->findOne($con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | [
"public",
"function",
"requireOne",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"findOne",
"(",
"$",
"con",
")",
";",
"if",
"(",
"$",
"result",
"===",
"null",
")",
"{",
"throw",
"$",
"this",
... | Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
and format the result with the current formatter
By default, returns a model object.
Throws an exception when nothing was found.
Does not work with ->with()s containing one-to-many relations.
@param ConnectionInterface $con an optional connection ob... | [
"Issue",
"a",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"format",
"the",
"result",
"with",
"the",
"current",
"formatter",
"By",
"default",
"returns",
"a",
"model",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1075-L1084 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.requireOneBy | public function requireOneBy($column, $value, ConnectionInterface $con = null)
{
$result = $this->findOneBy($column, $value, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | php | public function requireOneBy($column, $value, ConnectionInterface $con = null)
{
$result = $this->findOneBy($column, $value, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | [
"public",
"function",
"requireOneBy",
"(",
"$",
"column",
",",
"$",
"value",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"findOneBy",
"(",
"$",
"column",
",",
"$",
"value",
",",
"$",
"con",
")... | Apply a condition on a column and issues the SELECT ... LIMIT 1 query
Throws an exception when nothing was found.
@see filterBy()
@see findOne()
@param mixed $column A string representing the column phpName, e.g. 'AuthorId'
@param mixed $value A value for the condition
@param ConnectionI... | [
"Apply",
"a",
"condition",
"on",
"a",
"column",
"and",
"issues",
"the",
"SELECT",
"...",
"LIMIT",
"1",
"query"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1101-L1110 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.requireOneByArray | public function requireOneByArray($conditions, ConnectionInterface $con = null)
{
$result = $this->findOneByArray($conditions, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | php | public function requireOneByArray($conditions, ConnectionInterface $con = null)
{
$result = $this->findOneByArray($conditions, $con);
if ($result === null) {
throw $this->createEntityNotFoundException();
}
return $result;
} | [
"public",
"function",
"requireOneByArray",
"(",
"$",
"conditions",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"findOneByArray",
"(",
"$",
"conditions",
",",
"$",
"con",
")",
";",
"if",
"(",
"$",
... | Apply a list of conditions on columns and issues the SELECT ... LIMIT 1 query
<code>
$c->requireOneByArray([
'Title' => 'War And Peace',
'Publisher' => $publisher
], $con);
</code>
@see requireOne()
@param mixed $conditions An array of conditions, using column phpNames as key
@param ConnectionInterf... | [
"Apply",
"a",
"list",
"of",
"conditions",
"on",
"columns",
"and",
"issues",
"the",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"<code",
">",
"$c",
"-",
">",
"requireOneByArray",
"(",
"[",
"Title",
"=",
">",
"War",
"And",
"Peace",
"Publisher",
"=",
">",
"$p... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1128-L1137 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.findOneOrCreate | public function findOneOrCreate(ConnectionInterface $con = null)
{
if ($this->joins) {
throw new PropelException(__METHOD__ .' cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.');
}... | php | public function findOneOrCreate(ConnectionInterface $con = null)
{
if ($this->joins) {
throw new PropelException(__METHOD__ .' cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.');
}... | [
"public",
"function",
"findOneOrCreate",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"joins",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"__METHOD__",
".",
"' cannot be used on a query with a join, because Prop... | Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
and format the result with the current formatter
By default, returns a model object
@param ConnectionInterface $con an optional connection object
@return mixed the result, formatted by the current formatter
@throws PropelException | [
"Issue",
"a",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"format",
"the",
"result",
"with",
"the",
"current",
"formatter",
"By",
"default",
"returns",
"a",
"model",
"object"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1159-L1176 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.findPk | public function findPk($key, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteri... | php | public function findPk($key, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteri... | [
"public",
"function",
"findPk",
"(",
"$",
"key",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
... | Find object by primary key
Behaves differently if the model has simple or composite primary key
<code>
// simple primary key
$book = $c->findPk(12, $con);
// composite primary key
$bookOpinion = $c->findPk(array(34, 634), $con);
</code>
@param mixed $key Primary key to use for the query
@param Connection... | [
"Find",
"object",
"by",
"primary",
"key",
"Behaves",
"differently",
"if",
"the",
"model",
"has",
"simple",
"or",
"composite",
"primary",
"key",
"<code",
">",
"//",
"simple",
"primary",
"key",
"$book",
"=",
"$c",
"-",
">",
"findPk",
"(",
"12",
"$con",
")"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1192-L1216 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.findPks | public function findPks($keys, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criter... | php | public function findPks($keys, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criter... | [
"public",
"function",
"findPks",
"(",
"$",
"keys",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",... | Find objects by primary key
Behaves differently if the model has simple or composite primary key
<code>
// simple primary key
$books = $c->findPks(array(12, 56, 832), $con);
// composite primary key
$bookOpinion = $c->findPks(array(array(34, 634), array(45, 518), array(34, 765)), $con);
</code>
@param array ... | [
"Find",
"objects",
"by",
"primary",
"key",
"Behaves",
"differently",
"if",
"the",
"model",
"has",
"simple",
"or",
"composite",
"primary",
"key",
"<code",
">",
"//",
"simple",
"primary",
"key",
"$books",
"=",
"$c",
"-",
">",
"findPks",
"(",
"array",
"(",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1234-L1254 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.count | public function count(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName($... | php | public function count(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName($... | [
"public",
"function",
"count",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
"(",
"$",
"this",
... | Issue a SELECT COUNT(*) query based on the current ModelCriteria
@param ConnectionInterface $con an optional connection object
@return integer the number of results | [
"Issue",
"a",
"SELECT",
"COUNT",
"(",
"*",
")",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1351-L1377 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.exists | public function exists(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName(... | php | public function exists(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName(... | [
"public",
"function",
"exists",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getReadConnection",
"(",
"$",
"this",
... | Issue an existence check on the current ModelCriteria
@param ConnectionInterface $con an optional connection object
@return bool column existence | [
"Issue",
"an",
"existence",
"check",
"on",
"the",
"current",
"ModelCriteria"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1398-L1422 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.paginate | public function paginate($page = 1, $maxPerPage = 10, ConnectionInterface $con = null)
{
$criteria = $this->isKeepQuery() ? clone $this : $this;
$pager = new PropelModelPager($criteria, $maxPerPage);
$pager->setPage($page);
$pager->init($con);
return $pager;
} | php | public function paginate($page = 1, $maxPerPage = 10, ConnectionInterface $con = null)
{
$criteria = $this->isKeepQuery() ? clone $this : $this;
$pager = new PropelModelPager($criteria, $maxPerPage);
$pager->setPage($page);
$pager->init($con);
return $pager;
} | [
"public",
"function",
"paginate",
"(",
"$",
"page",
"=",
"1",
",",
"$",
"maxPerPage",
"=",
"10",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"criteria",
"=",
"$",
"this",
"->",
"isKeepQuery",
"(",
")",
"?",
"clone",
"$",
"this... | Issue a SELECT query based on the current ModelCriteria
and uses a page and a maximum number of results per page
to compute an offset and a limit.
@param int $page number of the page to start the pager on. Page 1 means no offset
@param int $maxPerPage maximum number of results per... | [
"Issue",
"a",
"SELECT",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"uses",
"a",
"page",
"and",
"a",
"maximum",
"number",
"of",
"results",
"per",
"page",
"to",
"compute",
"an",
"offset",
"and",
"a",
"limit",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1435-L1443 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.delete | public function delete(ConnectionInterface $con = null)
{
if (0 === count($this->getMap())) {
throw new PropelException(__METHOD__ .' expects a Criteria with at least one condition. Use deleteAll() to delete all the rows of a table');
}
if (null === $con) {
$con = Pr... | php | public function delete(ConnectionInterface $con = null)
{
if (0 === count($this->getMap())) {
throw new PropelException(__METHOD__ .' expects a Criteria with at least one condition. Use deleteAll() to delete all the rows of a table');
}
if (null === $con) {
$con = Pr... | [
"public",
"function",
"delete",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"this",
"->",
"getMap",
"(",
")",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"__METHOD__",
".",
"' expe... | Issue a DELETE query based on the current ModelCriteria
An optional hook on basePreDelete() can prevent the actual deletion
@param ConnectionInterface $con an optional connection object
@return integer the number of deleted rows
@throws PropelException | [
"Issue",
"a",
"DELETE",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"An",
"optional",
"hook",
"on",
"basePreDelete",
"()",
"can",
"prevent",
"the",
"actual",
"deletion"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1495-L1521 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.deleteAll | public function deleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection($this->getDbName());
}
try {
return $con->transaction(function () use ($con) {
if (!$affectedRows = $this->basePr... | php | public function deleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection($this->getDbName());
}
try {
return $con->transaction(function () use ($con) {
if (!$affectedRows = $this->basePr... | [
"public",
"function",
"deleteAll",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getWriteConnection",
"(",
"$",
"thi... | Issue a DELETE query based on the current ModelCriteria deleting all rows in the table
An optional hook on basePreDelete() can prevent the actual deletion
@param ConnectionInterface $con an optional connection object
@return integer the number of deleted rows
@throws PropelException | [
"Issue",
"a",
"DELETE",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"deleting",
"all",
"rows",
"in",
"the",
"table",
"An",
"optional",
"hook",
"on",
"basePreDelete",
"()",
"can",
"prevent",
"the",
"actual",
"deletion"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1533-L1550 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.doDeleteAll | public function doDeleteAll(ConnectionInterface $con = null)
{
$databaseName = $this->getDbName();
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection($databaseName);
}
// join are not supported with DELETE statement
if (count($this->ge... | php | public function doDeleteAll(ConnectionInterface $con = null)
{
$databaseName = $this->getDbName();
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection($databaseName);
}
// join are not supported with DELETE statement
if (count($this->ge... | [
"public",
"function",
"doDeleteAll",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"databaseName",
"=",
"$",
"this",
"->",
"getDbName",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
":... | Issue a DELETE query based on the current ModelCriteria deleting all rows in the table
This method is called by ModelCriteria::deleteAll() inside a transaction
@param ConnectionInterface $con a connection object
@return integer the number of deleted rows
@throws RuntimeException | [
"Issue",
"a",
"DELETE",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"deleting",
"all",
"rows",
"in",
"the",
"table",
"This",
"method",
"is",
"called",
"by",
"ModelCriteria",
"::",
"deleteAll",
"()",
"inside",
"a",
"transaction"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1562-L1594 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.update | public function update($values, ConnectionInterface $con = null, $forceIndividualSaves = false)
{
if (!is_array($values) && !($values instanceof Criteria)) {
throw new PropelException(__METHOD__ .' expects an array or Criteria as first argument');
}
if (count($this->getJoins()))... | php | public function update($values, ConnectionInterface $con = null, $forceIndividualSaves = false)
{
if (!is_array($values) && !($values instanceof Criteria)) {
throw new PropelException(__METHOD__ .' expects an array or Criteria as first argument');
}
if (count($this->getJoins()))... | [
"public",
"function",
"update",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"forceIndividualSaves",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
"&&",
"!",
"(",
"$",
"values",
"inst... | Issue an UPDATE query based the current ModelCriteria and a list of changes.
An optional hook on basePreUpdate() can prevent the actual update.
Beware that behaviors based on hooks in the object's save() method
will only be triggered if you force individual saves, i.e. if you pass true as second argument.
@param mixed... | [
"Issue",
"an",
"UPDATE",
"query",
"based",
"the",
"current",
"ModelCriteria",
"and",
"a",
"list",
"of",
"changes",
".",
"An",
"optional",
"hook",
"on",
"basePreUpdate",
"()",
"can",
"prevent",
"the",
"actual",
"update",
".",
"Beware",
"that",
"behaviors",
"b... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1655-L1683 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.doUpdate | public function doUpdate($values, ConnectionInterface $con, $forceIndividualSaves = false)
{
if ($forceIndividualSaves) {
// Update rows one by one
$objects = $this->setFormatter(ModelCriteria::FORMAT_OBJECT)->find($con);
foreach ($objects as $object) {
f... | php | public function doUpdate($values, ConnectionInterface $con, $forceIndividualSaves = false)
{
if ($forceIndividualSaves) {
// Update rows one by one
$objects = $this->setFormatter(ModelCriteria::FORMAT_OBJECT)->find($con);
foreach ($objects as $object) {
f... | [
"public",
"function",
"doUpdate",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
",",
"$",
"forceIndividualSaves",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"forceIndividualSaves",
")",
"{",
"// Update rows one by one",
"$",
"objects",
"=",
"$",
"th... | Issue an UPDATE query based the current ModelCriteria and a list of changes.
This method is called by ModelCriteria::update() inside a transaction.
@param array $values Associative array of keys and values to replace
@param ConnectionInterface $con a connection object
@para... | [
"Issue",
"an",
"UPDATE",
"query",
"based",
"the",
"current",
"ModelCriteria",
"and",
"a",
"list",
"of",
"changes",
".",
"This",
"method",
"is",
"called",
"by",
"ModelCriteria",
"::",
"update",
"()",
"inside",
"a",
"transaction",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1695-L1733 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getCriterionForConditions | protected function getCriterionForConditions($conditions, $operator = null)
{
$operator = (null === $operator) ? Criteria::LOGICAL_AND : $operator;
$this->combine($conditions, $operator, 'propel_temp_name');
$criterion = $this->namedCriterions['propel_temp_name'];
unset($this->namedC... | php | protected function getCriterionForConditions($conditions, $operator = null)
{
$operator = (null === $operator) ? Criteria::LOGICAL_AND : $operator;
$this->combine($conditions, $operator, 'propel_temp_name');
$criterion = $this->namedCriterions['propel_temp_name'];
unset($this->namedC... | [
"protected",
"function",
"getCriterionForConditions",
"(",
"$",
"conditions",
",",
"$",
"operator",
"=",
"null",
")",
"{",
"$",
"operator",
"=",
"(",
"null",
"===",
"$",
"operator",
")",
"?",
"Criteria",
"::",
"LOGICAL_AND",
":",
"$",
"operator",
";",
"$",... | Creates a Criterion object based on a list of existing condition names and a comparator
@param array $conditions The list of condition names, e.g. array('cond1', 'cond2')
@param string $operator An operator, Criteria::LOGICAL_AND (default) or Criteria::LOGICAL_OR
@return AbstractCriterion A Criterion or ModelCrite... | [
"Creates",
"a",
"Criterion",
"object",
"based",
"on",
"a",
"list",
"of",
"existing",
"condition",
"names",
"and",
"a",
"comparator"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1743-L1751 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getCriterionForClause | protected function getCriterionForClause($clause, $value, $bindingType = null)
{
$origin = $clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
// this is enough to determine the type to bind the paramet... | php | protected function getCriterionForClause($clause, $value, $bindingType = null)
{
$origin = $clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
// this is enough to determine the type to bind the paramet... | [
"protected",
"function",
"getCriterionForClause",
"(",
"$",
"clause",
",",
"$",
"value",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"$",
"origin",
"=",
"$",
"clause",
"=",
"trim",
"(",
"$",
"clause",
")",
";",
"if",
"(",
"$",
"this",
"->",
"repl... | Creates a Criterion object based on a SQL clause and a value
Uses introspection to translate the column phpName into a fully qualified name
@param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
@param mixed $value A value for the condition
@return AbstractCriterion a Criterion object | [
"Creates",
"a",
"Criterion",
"object",
"based",
"on",
"a",
"SQL",
"clause",
"and",
"a",
"value",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1762-L1808 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.convertValueForColumn | protected function convertValueForColumn($value, ColumnMap $colMap)
{
if ($colMap->getType() == 'OBJECT' && is_object($value)) {
if (is_array($value)) {
$value = array_map('serialize', $value);
} else {
$value = serialize($value);
}
... | php | protected function convertValueForColumn($value, ColumnMap $colMap)
{
if ($colMap->getType() == 'OBJECT' && is_object($value)) {
if (is_array($value)) {
$value = array_map('serialize', $value);
} else {
$value = serialize($value);
}
... | [
"protected",
"function",
"convertValueForColumn",
"(",
"$",
"value",
",",
"ColumnMap",
"$",
"colMap",
")",
"{",
"if",
"(",
"$",
"colMap",
"->",
"getType",
"(",
")",
"==",
"'OBJECT'",
"&&",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"is_a... | Converts value for some column types
@param mixed $value The value to convert
@param ColumnMap $colMap The ColumnMap object
@return mixed The converted value | [
"Converts",
"value",
"for",
"some",
"column",
"types"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1817-L1842 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.doReplaceNameInExpression | protected function doReplaceNameInExpression($matches)
{
$key = $matches[0];
list($column, $realFullColumnName) = $this->getColumnFromName($key);
if ($column instanceof ColumnMap) {
$this->replacedColumns[] = $column;
$this->foundMatch = true;
if (false ... | php | protected function doReplaceNameInExpression($matches)
{
$key = $matches[0];
list($column, $realFullColumnName) = $this->getColumnFromName($key);
if ($column instanceof ColumnMap) {
$this->replacedColumns[] = $column;
$this->foundMatch = true;
if (false ... | [
"protected",
"function",
"doReplaceNameInExpression",
"(",
"$",
"matches",
")",
"{",
"$",
"key",
"=",
"$",
"matches",
"[",
"0",
"]",
";",
"list",
"(",
"$",
"column",
",",
"$",
"realFullColumnName",
")",
"=",
"$",
"this",
"->",
"getColumnFromName",
"(",
"... | Callback function to replace column names by their real name in a clause
e.g. 'Book.Title IN ?'
=> 'book.title IN ?'
@param array $matches Matches found by preg_replace_callback
@return string the column name replacement | [
"Callback",
"function",
"to",
"replace",
"column",
"names",
"by",
"their",
"real",
"name",
"in",
"a",
"clause",
"e",
".",
"g",
".",
"Book",
".",
"Title",
"IN",
"?",
"=",
">",
"book",
".",
"title",
"IN",
"?"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1853-L1875 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getColumnFromName | protected function getColumnFromName($phpName, $failSilently = true)
{
if (false === strpos($phpName, '.')) {
$prefix = $this->getModelAliasOrName();
} else {
// $prefix could be either class name or table name
list($prefix, $phpName) = explode('.', $phpName);
... | php | protected function getColumnFromName($phpName, $failSilently = true)
{
if (false === strpos($phpName, '.')) {
$prefix = $this->getModelAliasOrName();
} else {
// $prefix could be either class name or table name
list($prefix, $phpName) = explode('.', $phpName);
... | [
"protected",
"function",
"getColumnFromName",
"(",
"$",
"phpName",
",",
"$",
"failSilently",
"=",
"true",
")",
"{",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"phpName",
",",
"'.'",
")",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"getModelAli... | Finds a column and a SQL translation for a pseudo SQL column name
Respects table aliases previously registered in a join() or addAlias()
Examples:
<code>
$c->getColumnFromName('Book.Title');
=> array($bookTitleColumnMap, 'book.title')
$c->join('Book.Author a')
->getColumnFromName('a.FirstName');
=> array($authorFirstNa... | [
"Finds",
"a",
"column",
"and",
"a",
"SQL",
"translation",
"for",
"a",
"pseudo",
"SQL",
"column",
"name",
"Respects",
"table",
"aliases",
"previously",
"registered",
"in",
"a",
"join",
"()",
"or",
"addAlias",
"()",
"Examples",
":",
"<code",
">",
"$c",
"-",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1893-L1952 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getModelJoinByTableName | public function getModelJoinByTableName($tableName) {
foreach ($this->joins as $join) {
if ($join instanceof ModelJoin && $join->getTableMap()->getName() == $tableName) {
return $join;
}
}
return null;
} | php | public function getModelJoinByTableName($tableName) {
foreach ($this->joins as $join) {
if ($join instanceof ModelJoin && $join->getTableMap()->getName() == $tableName) {
return $join;
}
}
return null;
} | [
"public",
"function",
"getModelJoinByTableName",
"(",
"$",
"tableName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"joins",
"as",
"$",
"join",
")",
"{",
"if",
"(",
"$",
"join",
"instanceof",
"ModelJoin",
"&&",
"$",
"join",
"->",
"getTableMap",
"(",
")"... | @param string $tableName
@return null|ModelJoin | [
"@param",
"string",
"$tableName"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1959-L1967 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.doSelect | public function doSelect(ConnectionInterface $con = null)
{
$this->addSelfSelectColumns();
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->configureSelectColumns();
return parent::doSelect($con);
} | php | public function doSelect(ConnectionInterface $con = null)
{
$this->addSelfSelectColumns();
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->configureSelectColumns();
return parent::doSelect($con);
} | [
"public",
"function",
"doSelect",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addSelfSelectColumns",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContain... | Builds, binds and executes a SELECT query based on the current object.
@param ConnectionInterface $con A connection object
@return DataFetcherInterface A dataFetcher using the connection, ready to be fetched
@throws \Propel\Runtime\Exception\PropelException | [
"Builds",
"binds",
"and",
"executes",
"a",
"SELECT",
"query",
"based",
"on",
"the",
"current",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L1978-L1989 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getColumnFromSubQuery | protected function getColumnFromSubQuery($class, $phpName, $failSilently = true)
{
$subQueryCriteria = $this->getSelectQuery($class);
$tableMap = $subQueryCriteria->getTableMap();
if ($tableMap->hasColumnByPhpName($phpName)) {
$column = $tableMap->getColumnByPhpName($phpName);
... | php | protected function getColumnFromSubQuery($class, $phpName, $failSilently = true)
{
$subQueryCriteria = $this->getSelectQuery($class);
$tableMap = $subQueryCriteria->getTableMap();
if ($tableMap->hasColumnByPhpName($phpName)) {
$column = $tableMap->getColumnByPhpName($phpName);
... | [
"protected",
"function",
"getColumnFromSubQuery",
"(",
"$",
"class",
",",
"$",
"phpName",
",",
"$",
"failSilently",
"=",
"true",
")",
"{",
"$",
"subQueryCriteria",
"=",
"$",
"this",
"->",
"getSelectQuery",
"(",
"$",
"class",
")",
";",
"$",
"tableMap",
"=",... | Special case for subquery columns
@return array List($columnMap, $realColumnName) | [
"Special",
"case",
"for",
"subquery",
"columns"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L2032-L2049 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getRealColumnName | protected function getRealColumnName($columnName)
{
if (!$this->getTableMap()->hasColumnByPhpName($columnName)) {
throw new UnknownColumnException('Unknown column ' . $columnName . ' in model ' . $this->modelName);
}
if ($this->useAliasInSQL) {
return $this->modelAli... | php | protected function getRealColumnName($columnName)
{
if (!$this->getTableMap()->hasColumnByPhpName($columnName)) {
throw new UnknownColumnException('Unknown column ' . $columnName . ' in model ' . $this->modelName);
}
if ($this->useAliasInSQL) {
return $this->modelAli... | [
"protected",
"function",
"getRealColumnName",
"(",
"$",
"columnName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getTableMap",
"(",
")",
"->",
"hasColumnByPhpName",
"(",
"$",
"columnName",
")",
")",
"{",
"throw",
"new",
"UnknownColumnException",
"(",
"'Un... | Return a fully qualified column name corresponding to a simple column phpName
Uses model alias if it exists
Warning: restricted to the columns of the main model
e.g. => 'Title' => 'book.TITLE'
@param string $columnName the Column phpName, without the table name
@return string the fully qualified column name | [
"Return",
"a",
"fully",
"qualified",
"column",
"name",
"corresponding",
"to",
"a",
"simple",
"column",
"phpName",
"Uses",
"model",
"alias",
"if",
"it",
"exists",
"Warning",
":",
"restricted",
"to",
"the",
"columns",
"of",
"the",
"main",
"model",
"e",
".",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L2061-L2076 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getAliasedColName | public function getAliasedColName($colName)
{
if ($this->useAliasInSQL) {
return $this->modelAlias . substr($colName, strrpos($colName, '.'));
}
return $colName;
} | php | public function getAliasedColName($colName)
{
if ($this->useAliasInSQL) {
return $this->modelAlias . substr($colName, strrpos($colName, '.'));
}
return $colName;
} | [
"public",
"function",
"getAliasedColName",
"(",
"$",
"colName",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useAliasInSQL",
")",
"{",
"return",
"$",
"this",
"->",
"modelAlias",
".",
"substr",
"(",
"$",
"colName",
",",
"strrpos",
"(",
"$",
"colName",
",",
... | Changes the table part of a a fully qualified column name if a true model alias exists
e.g. => 'book.TITLE' => 'b.TITLE'
This is for use as first argument of Criteria::add()
@param string $colName the fully qualified column name, e.g 'book.TITLE' or BookTableMap::TITLE
@return string the fully qualified column name, ... | [
"Changes",
"the",
"table",
"part",
"of",
"a",
"a",
"fully",
"qualified",
"column",
"name",
"if",
"a",
"true",
"model",
"alias",
"exists",
"e",
".",
"g",
".",
"=",
">",
"book",
".",
"TITLE",
"=",
">",
"b",
".",
"TITLE",
"This",
"is",
"for",
"use",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L2087-L2094 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addUsingAlias | public function addUsingAlias($p1, $value = null, $operator = null)
{
return $this->addUsingOperator($this->getAliasedColName($p1), $value, $operator);
} | php | public function addUsingAlias($p1, $value = null, $operator = null)
{
return $this->addUsingOperator($this->getAliasedColName($p1), $value, $operator);
} | [
"public",
"function",
"addUsingAlias",
"(",
"$",
"p1",
",",
"$",
"value",
"=",
"null",
",",
"$",
"operator",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingOperator",
"(",
"$",
"this",
"->",
"getAliasedColName",
"(",
"$",
"p1",
")",
",",
... | Overrides Criteria::add() to force the use of a true table alias if it exists
@see Criteria::add()
@param string $column The colName of column to run the condition on (e.g. BookTableMap::ID)
@param mixed $value
@param string $operator A String, like Criteria::EQUAL.
@return $this|ModelCriteria A modified Criteria ... | [
"Overrides",
"Criteria",
"::",
"add",
"()",
"to",
"force",
"the",
"use",
"of",
"a",
"true",
"table",
"alias",
"if",
"it",
"exists"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L2120-L2123 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.getParams | public function getParams()
{
$params = [];
$dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName());
foreach ($this->getMap() as $criterion) {
$table = null;
foreach ($criterion->getAttachedCriterion() as $attachedCriterion) {
$tab... | php | public function getParams()
{
$params = [];
$dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName());
foreach ($this->getMap() as $criterion) {
$table = null;
foreach ($criterion->getAttachedCriterion() as $attachedCriterion) {
$tab... | [
"public",
"function",
"getParams",
"(",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"$",
"dbMap",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getDatabaseMap",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
")",
";",
"foreach",
"(",
... | Get all the parameters to bind to this criteria
Does part of the job of createSelectSql() for the cache
@return array list of parameters, each parameter being an array like
array('table' => $realtable, 'column' => $column, 'value' => $value) | [
"Get",
"all",
"the",
"parameters",
"to",
"bind",
"to",
"this",
"criteria",
"Does",
"part",
"of",
"the",
"job",
"of",
"createSelectSql",
"()",
"for",
"the",
"cache"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L2132-L2167 |
propelorm/Propel2 | src/Propel/Runtime/Formatter/ObjectFormatter.php | ObjectFormatter.getAllObjectsFromRow | public function getAllObjectsFromRow($row)
{
// main object
list($obj, $col) = $this->getTableMap()->populateobject($row, 0, $this->getDataFetcher()->getIndexType());
$pk = $obj->getPrimaryKey();
$serializedPk = serialize($pk);
if (isset($this->objects[$serializedPk])) {
... | php | public function getAllObjectsFromRow($row)
{
// main object
list($obj, $col) = $this->getTableMap()->populateobject($row, 0, $this->getDataFetcher()->getIndexType());
$pk = $obj->getPrimaryKey();
$serializedPk = serialize($pk);
if (isset($this->objects[$serializedPk])) {
... | [
"public",
"function",
"getAllObjectsFromRow",
"(",
"$",
"row",
")",
"{",
"// main object",
"list",
"(",
"$",
"obj",
",",
"$",
"col",
")",
"=",
"$",
"this",
"->",
"getTableMap",
"(",
")",
"->",
"populateobject",
"(",
"$",
"row",
",",
"0",
",",
"$",
"t... | Hydrates a series of objects from a result row
The first object to hydrate is the model of the Criteria
The following objects (the ones added by way of ModelCriteria::with()) are linked to the first one
@param array $row associative array indexed by column number,
as returned by DataFetcher::fetch()
@return ActiveRec... | [
"Hydrates",
"a",
"series",
"of",
"objects",
"from",
"a",
"result",
"row",
"The",
"first",
"object",
"to",
"hydrate",
"is",
"the",
"model",
"of",
"the",
"Criteria",
"The",
"following",
"objects",
"(",
"the",
"ones",
"added",
"by",
"way",
"of",
"ModelCriteri... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Formatter/ObjectFormatter.php#L109-L167 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/RawCriterion.php | RawCriterion.appendPsForUniqueClauseTo | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if (1 !== substr_count($this->column, '?')) {
throw new InvalidClauseException(sprintf('Could not build SQL for expression "%s" because Criteria::RAW works only with a clause containing a single question mark placeholder', $thi... | php | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if (1 !== substr_count($this->column, '?')) {
throw new InvalidClauseException(sprintf('Could not build SQL for expression "%s" because Criteria::RAW works only with a clause containing a single question mark placeholder', $thi... | [
"protected",
"function",
"appendPsForUniqueClauseTo",
"(",
"&",
"$",
"sb",
",",
"array",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"1",
"!==",
"substr_count",
"(",
"$",
"this",
"->",
"column",
",",
"'?'",
")",
")",
"{",
"throw",
"new",
"InvalidClauseExcep... | Appends a Prepared Statement representation of the Criterion onto the buffer
@param string &$sb The string that will receive the Prepared Statement
@param array $params A list to which Prepared Statement parameters will be appended | [
"Appends",
"a",
"Prepared",
"Statement",
"representation",
"of",
"the",
"Criterion",
"onto",
"the",
"buffer"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/RawCriterion.php#L52-L59 |
propelorm/Propel2 | src/Propel/Generator/Manager/ReverseManager.php | ReverseManager.buildModel | protected function buildModel()
{
$config = $this->getGeneratorConfig();
$connection = $this->getConnection();
$databaseName = $config->getConfigProperty('reverse.connection');
$database = new Database($this->getDatabaseName());
$database->setPlatform($config->getConfig... | php | protected function buildModel()
{
$config = $this->getGeneratorConfig();
$connection = $this->getConnection();
$databaseName = $config->getConfigProperty('reverse.connection');
$database = new Database($this->getDatabaseName());
$database->setPlatform($config->getConfig... | [
"protected",
"function",
"buildModel",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
";",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"databaseName",
"=",
"$",
"config",
"->",
... | Builds the model classes from the database schema.
@return Database The built-out Database (with all tables, etc.) | [
"Builds",
"the",
"model",
"classes",
"from",
"the",
"database",
"schema",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Manager/ReverseManager.php#L206-L250 |
propelorm/Propel2 | src/Propel/Generator/Manager/ReverseManager.php | ReverseManager.getConnection | protected function getConnection()
{
$generatorConfig = $this->getGeneratorConfig();
$database = $generatorConfig->getConfigProperty('reverse.connection');
if (null === $database) {
throw new BuildException('No configured connection. Please add a connection to your configuration... | php | protected function getConnection()
{
$generatorConfig = $this->getGeneratorConfig();
$database = $generatorConfig->getConfigProperty('reverse.connection');
if (null === $database) {
throw new BuildException('No configured connection. Please add a connection to your configuration... | [
"protected",
"function",
"getConnection",
"(",
")",
"{",
"$",
"generatorConfig",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
";",
"$",
"database",
"=",
"$",
"generatorConfig",
"->",
"getConfigProperty",
"(",
"'reverse.connection'",
")",
";",
"if",
... | @return ConnectionInterface
@throws BuildException if there isn't a configured connection for reverse | [
"@return",
"ConnectionInterface"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Manager/ReverseManager.php#L257-L268 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getDatabaseType | public function getDatabaseType()
{
$reflClass = new \ReflectionClass($this);
$clazz = $reflClass->getShortName();
$pos = strpos($clazz, 'Platform');
return strtolower(substr($clazz, 0, $pos));
} | php | public function getDatabaseType()
{
$reflClass = new \ReflectionClass($this);
$clazz = $reflClass->getShortName();
$pos = strpos($clazz, 'Platform');
return strtolower(substr($clazz, 0, $pos));
} | [
"public",
"function",
"getDatabaseType",
"(",
")",
"{",
"$",
"reflClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"$",
"clazz",
"=",
"$",
"reflClass",
"->",
"getShortName",
"(",
")",
";",
"$",
"pos",
"=",
"strpos",
"(",
"$",
... | Returns the short name of the database type that this platform represents.
For example MysqlPlatform->getDatabaseType() returns 'mysql'.
@return string | [
"Returns",
"the",
"short",
"name",
"of",
"the",
"database",
"type",
"that",
"this",
"platform",
"represents",
".",
"For",
"example",
"MysqlPlatform",
"-",
">",
"getDatabaseType",
"()",
"returns",
"mysql",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L158-L165 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getDomainForType | public function getDomainForType($mappingType)
{
if (!isset($this->schemaDomainMap[$mappingType])) {
throw new EngineException(sprintf('Cannot map unknown Propel type %s to native database type.', var_export($mappingType, true)));
}
return $this->schemaDomainMap[$mappingType];
... | php | public function getDomainForType($mappingType)
{
if (!isset($this->schemaDomainMap[$mappingType])) {
throw new EngineException(sprintf('Cannot map unknown Propel type %s to native database type.', var_export($mappingType, true)));
}
return $this->schemaDomainMap[$mappingType];
... | [
"public",
"function",
"getDomainForType",
"(",
"$",
"mappingType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"schemaDomainMap",
"[",
"$",
"mappingType",
"]",
")",
")",
"{",
"throw",
"new",
"EngineException",
"(",
"sprintf",
"(",
"'Cannot m... | Returns the database specific domain for a mapping type.
@param string
@return Domain | [
"Returns",
"the",
"database",
"specific",
"domain",
"for",
"a",
"mapping",
"type",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L206-L213 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getColumnDefaultValueDDL | public function getColumnDefaultValueDDL(Column $col)
{
$default = '';
$defaultValue = $col->getDefaultValue();
if (null !== $defaultValue) {
$default .= 'DEFAULT ';
if ($defaultValue->isExpression()) {
$default .= $defaultValue->getValue();
... | php | public function getColumnDefaultValueDDL(Column $col)
{
$default = '';
$defaultValue = $col->getDefaultValue();
if (null !== $defaultValue) {
$default .= 'DEFAULT ';
if ($defaultValue->isExpression()) {
$default .= $defaultValue->getValue();
... | [
"public",
"function",
"getColumnDefaultValueDDL",
"(",
"Column",
"$",
"col",
")",
"{",
"$",
"default",
"=",
"''",
";",
"$",
"defaultValue",
"=",
"$",
"col",
"->",
"getDefaultValue",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"defaultValue",
")",
"{",
... | Returns the SQL for the default value of a Column object
@return string | [
"Returns",
"the",
"SQL",
"for",
"the",
"default",
"value",
"of",
"a",
"Column",
"object"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L395-L431 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getColumnListDDL | public function getColumnListDDL($columns, $delimiter = ',')
{
$list = [];
foreach ($columns as $column) {
$columnName = $column->getName();
$list[] = $this->quoteIdentifier($columnName);
}
return implode($delimiter, $list);
} | php | public function getColumnListDDL($columns, $delimiter = ',')
{
$list = [];
foreach ($columns as $column) {
$columnName = $column->getName();
$list[] = $this->quoteIdentifier($columnName);
}
return implode($delimiter, $list);
} | [
"public",
"function",
"getColumnListDDL",
"(",
"$",
"columns",
",",
"$",
"delimiter",
"=",
"','",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"$",
"columnName",
"=",
"$",
"column",
"->",
... | Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().
@example
<code>
echo $platform->getColumnListDDL(array('foo', 'bar');
// '"foo","bar"'
</code>
@param array Column[] or string[]
@param string $delim The delimiter to use in separating the column names.
@return string | [
"Creates",
"a",
"delimiter",
"-",
"delimited",
"string",
"list",
"of",
"column",
"names",
"quoted",
"using",
"quoteIdentifier",
"()",
".",
"@example",
"<code",
">",
"echo",
"$platform",
"-",
">",
"getColumnListDDL",
"(",
"array",
"(",
"foo",
"bar",
")",
";",... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L445-L454 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getAddIndicesDDL | public function getAddIndicesDDL(Table $table)
{
$ret = '';
foreach ($table->getIndices() as $fk) {
$ret .= $this->getAddIndexDDL($fk);
}
return $ret;
} | php | public function getAddIndicesDDL(Table $table)
{
$ret = '';
foreach ($table->getIndices() as $fk) {
$ret .= $this->getAddIndexDDL($fk);
}
return $ret;
} | [
"public",
"function",
"getAddIndicesDDL",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"foreach",
"(",
"$",
"table",
"->",
"getIndices",
"(",
")",
"as",
"$",
"fk",
")",
"{",
"$",
"ret",
".=",
"$",
"this",
"->",
"getAddIndexDDL",
... | Returns the DDL SQL to add the indices of a table.
@param Table $table To Table
@return string | [
"Returns",
"the",
"DDL",
"SQL",
"to",
"add",
"the",
"indices",
"of",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L530-L538 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getAddIndexDDL | public function getAddIndexDDL(Index $index)
{
$pattern = "
CREATE %sINDEX %s ON %s (%s);
";
return sprintf($pattern,
$index->isUnique() ? 'UNIQUE ' : '',
$this->quoteIdentifier($index->getName()),
$this->quoteIdentifier($index->getTable()->getName()),
... | php | public function getAddIndexDDL(Index $index)
{
$pattern = "
CREATE %sINDEX %s ON %s (%s);
";
return sprintf($pattern,
$index->isUnique() ? 'UNIQUE ' : '',
$this->quoteIdentifier($index->getName()),
$this->quoteIdentifier($index->getTable()->getName()),
... | [
"public",
"function",
"getAddIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"$",
"pattern",
"=",
"\"\nCREATE %sINDEX %s ON %s (%s);\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"index",
"->",
"isUnique",
"(",
")",
"?",
"'UNIQUE '",
":",
"... | Returns the DDL SQL to add an Index.
@param Index $index
@return string | [
"Returns",
"the",
"DDL",
"SQL",
"to",
"add",
"an",
"Index",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L546-L558 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getDropIndexDDL | public function getDropIndexDDL(Index $index)
{
$pattern = "
DROP INDEX %s;
";
return sprintf($pattern,
$this->quoteIdentifier($index->getFQName())
);
} | php | public function getDropIndexDDL(Index $index)
{
$pattern = "
DROP INDEX %s;
";
return sprintf($pattern,
$this->quoteIdentifier($index->getFQName())
);
} | [
"public",
"function",
"getDropIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"$",
"pattern",
"=",
"\"\nDROP INDEX %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"index",
"->",
"getFQName",
"(",... | Builds the DDL SQL to drop an Index.
@param Index $index
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"drop",
"an",
"Index",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L566-L575 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getIndexDDL | public function getIndexDDL(Index $index)
{
return sprintf('%sINDEX %s (%s)',
$index->isUnique() ? 'UNIQUE ' : '',
$this->quoteIdentifier($index->getName()),
$this->getColumnListDDL($index->getColumnObjects())
);
} | php | public function getIndexDDL(Index $index)
{
return sprintf('%sINDEX %s (%s)',
$index->isUnique() ? 'UNIQUE ' : '',
$this->quoteIdentifier($index->getName()),
$this->getColumnListDDL($index->getColumnObjects())
);
} | [
"public",
"function",
"getIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"return",
"sprintf",
"(",
"'%sINDEX %s (%s)'",
",",
"$",
"index",
"->",
"isUnique",
"(",
")",
"?",
"'UNIQUE '",
":",
"''",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"in... | Builds the DDL SQL for an Index object.
@param Index $index
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"for",
"an",
"Index",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L583-L590 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getAddForeignKeyDDL | public function getAddForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql() || $fk->isPolymorphic()) {
return;
}
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fk->getTable()->getName()),
$this->getForeignKe... | php | public function getAddForeignKeyDDL(ForeignKey $fk)
{
if ($fk->isSkipSql() || $fk->isPolymorphic()) {
return;
}
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fk->getTable()->getName()),
$this->getForeignKe... | [
"public",
"function",
"getAddForeignKeyDDL",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"if",
"(",
"$",
"fk",
"->",
"isSkipSql",
"(",
")",
"||",
"$",
"fk",
"->",
"isPolymorphic",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"pattern",
"=",
"\"\nALTER TABL... | Builds the DDL SQL to add a foreign key.
@param ForeignKey $fk
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"add",
"a",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L625-L638 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyTableDDL | public function getModifyTableDDL(TableDiff $tableDiff)
{
$ret = '';
$toTable = $tableDiff->getToTable();
// drop indices, foreign keys
foreach ($tableDiff->getRemovedFks() as $fk) {
$ret .= $this->getDropForeignKeyDDL($fk);
}
foreach ($tableDiff->getMod... | php | public function getModifyTableDDL(TableDiff $tableDiff)
{
$ret = '';
$toTable = $tableDiff->getToTable();
// drop indices, foreign keys
foreach ($tableDiff->getRemovedFks() as $fk) {
$ret .= $this->getDropForeignKeyDDL($fk);
}
foreach ($tableDiff->getMod... | [
"public",
"function",
"getModifyTableDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"toTable",
"=",
"$",
"tableDiff",
"->",
"getToTable",
"(",
")",
";",
"// drop indices, foreign keys",
"foreach",
"(",
"$",
"tableDiff",
... | Builds the DDL SQL to alter a table
based on a TableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"based",
"on",
"a",
"TableDiff",
"instance"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L769-L863 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyTableColumnsDDL | public function getModifyTableColumnsDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedColumns() as $column) {
$ret .= $this->getRemoveColumnDDL($column);
}
foreach ($tableDiff->getRenamedColumns() as $columnRenaming) {
$ret .= $this->get... | php | public function getModifyTableColumnsDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedColumns() as $column) {
$ret .= $this->getRemoveColumnDDL($column);
}
foreach ($tableDiff->getRenamedColumns() as $columnRenaming) {
$ret .= $this->get... | [
"public",
"function",
"getModifyTableColumnsDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"foreach",
"(",
"$",
"tableDiff",
"->",
"getRemovedColumns",
"(",
")",
"as",
"$",
"column",
")",
"{",
"$",
"ret",
".=",
"$",
"this... | Builds the DDL SQL to alter a table
based on a TableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"based",
"on",
"a",
"TableDiff",
"instance"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L871-L892 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyTablePrimaryKeyDDL | public function getModifyTablePrimaryKeyDDL(TableDiff $tableDiff)
{
$ret = '';
if ($tableDiff->hasModifiedPk()) {
$ret .= $this->getDropPrimaryKeyDDL($tableDiff->getFromTable());
$ret .= $this->getAddPrimaryKeyDDL($tableDiff->getToTable());
}
return $ret;
... | php | public function getModifyTablePrimaryKeyDDL(TableDiff $tableDiff)
{
$ret = '';
if ($tableDiff->hasModifiedPk()) {
$ret .= $this->getDropPrimaryKeyDDL($tableDiff->getFromTable());
$ret .= $this->getAddPrimaryKeyDDL($tableDiff->getToTable());
}
return $ret;
... | [
"public",
"function",
"getModifyTablePrimaryKeyDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"if",
"(",
"$",
"tableDiff",
"->",
"hasModifiedPk",
"(",
")",
")",
"{",
"$",
"ret",
".=",
"$",
"this",
"->",
"getDropPrimaryKeyDD... | Builds the DDL SQL to alter a table's primary key
based on a TableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"s",
"primary",
"key",
"based",
"on",
"a",
"TableDiff",
"instance"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L900-L910 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyTableIndicesDDL | public function getModifyTableIndicesDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedIndices() as $index) {
$ret .= $this->getDropIndexDDL($index);
}
foreach ($tableDiff->getAddedIndices() as $index) {
$ret .= $this->getAddIndexDDL($ind... | php | public function getModifyTableIndicesDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedIndices() as $index) {
$ret .= $this->getDropIndexDDL($index);
}
foreach ($tableDiff->getAddedIndices() as $index) {
$ret .= $this->getAddIndexDDL($ind... | [
"public",
"function",
"getModifyTableIndicesDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"foreach",
"(",
"$",
"tableDiff",
"->",
"getRemovedIndices",
"(",
")",
"as",
"$",
"index",
")",
"{",
"$",
"ret",
".=",
"$",
"this"... | Builds the DDL SQL to alter a table's indices
based on a TableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"s",
"indices",
"based",
"on",
"a",
"TableDiff",
"instance"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L918-L937 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyTableForeignKeysDDL | public function getModifyTableForeignKeysDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedFks() as $fk) {
$ret .= $this->getDropForeignKeyDDL($fk);
}
foreach ($tableDiff->getAddedFks() as $fk) {
$ret .= $this->getAddForeignKeyDDL($fk);
... | php | public function getModifyTableForeignKeysDDL(TableDiff $tableDiff)
{
$ret = '';
foreach ($tableDiff->getRemovedFks() as $fk) {
$ret .= $this->getDropForeignKeyDDL($fk);
}
foreach ($tableDiff->getAddedFks() as $fk) {
$ret .= $this->getAddForeignKeyDDL($fk);
... | [
"public",
"function",
"getModifyTableForeignKeysDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"foreach",
"(",
"$",
"tableDiff",
"->",
"getRemovedFks",
"(",
")",
"as",
"$",
"fk",
")",
"{",
"$",
"ret",
".=",
"$",
"this",
... | Builds the DDL SQL to alter a table's foreign keys
based on a TableDiff instance
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"alter",
"a",
"table",
"s",
"foreign",
"keys",
"based",
"on",
"a",
"TableDiff",
"instance"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L945-L964 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getModifyColumnsDDL | public function getModifyColumnsDDL($columnDiffs)
{
$lines = [];
$table = null;
foreach ($columnDiffs as $columnDiff) {
$toColumn = $columnDiff->getToColumn();
if (null === $table) {
$table = $toColumn->getTable();
}
$lines[] = ... | php | public function getModifyColumnsDDL($columnDiffs)
{
$lines = [];
$table = null;
foreach ($columnDiffs as $columnDiff) {
$toColumn = $columnDiff->getToColumn();
if (null === $table) {
$table = $toColumn->getTable();
}
$lines[] = ... | [
"public",
"function",
"getModifyColumnsDDL",
"(",
"$",
"columnDiffs",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"table",
"=",
"null",
";",
"foreach",
"(",
"$",
"columnDiffs",
"as",
"$",
"columnDiff",
")",
"{",
"$",
"toColumn",
"=",
"$",
"columnD... | Builds the DDL SQL to modify a list of columns
@param ColumnDiff[] $columnDiffs
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"modify",
"a",
"list",
"of",
"columns"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1025-L1051 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getAddColumnDDL | public function getAddColumnDDL(Column $column)
{
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($column->getTable()->getName()),
$this->getColumnDDL($column)
);
} | php | public function getAddColumnDDL(Column $column)
{
$pattern = "
ALTER TABLE %s ADD %s;
";
return sprintf($pattern,
$this->quoteIdentifier($column->getTable()->getName()),
$this->getColumnDDL($column)
);
} | [
"public",
"function",
"getAddColumnDDL",
"(",
"Column",
"$",
"column",
")",
"{",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s ADD %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"column",
"->",
"getTabl... | Builds the DDL SQL to remove a column
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"remove",
"a",
"column"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1058-L1068 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.quote | public function quote($text)
{
if ($con = $this->getConnection()) {
return $con->quote($text);
} else {
return "'" . $this->disconnectedEscapeText($text) . "'";
}
} | php | public function quote($text)
{
if ($con = $this->getConnection()) {
return $con->quote($text);
} else {
return "'" . $this->disconnectedEscapeText($text) . "'";
}
} | [
"public",
"function",
"quote",
"(",
"$",
"text",
")",
"{",
"if",
"(",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
")",
"{",
"return",
"$",
"con",
"->",
"quote",
"(",
"$",
"text",
")",
";",
"}",
"else",
"{",
"return",
"\"'\"",
... | Quote and escape needed characters in the string for underlying RDBMS.
@param string $text
@return string | [
"Quote",
"and",
"escape",
"needed",
"characters",
"in",
"the",
"string",
"for",
"underlying",
"RDBMS",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1130-L1137 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getBooleanString | public function getBooleanString($b)
{
if (is_bool($b) && true === $b) {
return '1';
}
if (is_int($b) && 1 === $b) {
return '1';
}
if (is_string($b)
&& in_array(strtolower($b), ['1', 'true', 'y', 'yes'])) {
return '1';
... | php | public function getBooleanString($b)
{
if (is_bool($b) && true === $b) {
return '1';
}
if (is_int($b) && 1 === $b) {
return '1';
}
if (is_string($b)
&& in_array(strtolower($b), ['1', 'true', 'y', 'yes'])) {
return '1';
... | [
"public",
"function",
"getBooleanString",
"(",
"$",
"b",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"b",
")",
"&&",
"true",
"===",
"$",
"b",
")",
"{",
"return",
"'1'",
";",
"}",
"if",
"(",
"is_int",
"(",
"$",
"b",
")",
"&&",
"1",
"===",
"$",
"... | Returns the Boolean value for the RDBMS.
This value should match the Boolean value that is set
when using Propel's PreparedStatement::setBoolean().
This function is used to set default column values when building
SQL.
@param mixed $tf A Boolean or string representation of Boolean ('y', 'true').
@return mixed | [
"Returns",
"the",
"Boolean",
"value",
"for",
"the",
"RDBMS",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1242-L1258 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getColumnBindingPHP | public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = " ")
{
$script = '';
if ($column->isTemporalType()) {
$columnValueAccessor = $columnValueAccessor . " ? " . $columnValueAccessor . "->format(\"" . $this->getTimeStampFormatter() . "\... | php | public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = " ")
{
$script = '';
if ($column->isTemporalType()) {
$columnValueAccessor = $columnValueAccessor . " ? " . $columnValueAccessor . "->format(\"" . $this->getTimeStampFormatter() . "\... | [
"public",
"function",
"getColumnBindingPHP",
"(",
"Column",
"$",
"column",
",",
"$",
"identifier",
",",
"$",
"columnValueAccessor",
",",
"$",
"tab",
"=",
"\" \"",
")",
"{",
"$",
"script",
"=",
"''",
";",
"if",
"(",
"$",
"column",
"->",
"isTempor... | Get the PHP snippet for binding a value to a column.
Warning: duplicates logic from AdapterInterface::bindValue().
Any code modification here must be ported there. | [
"Get",
"the",
"PHP",
"snippet",
"for",
"binding",
"a",
"value",
"to",
"a",
"column",
".",
"Warning",
":",
"duplicates",
"logic",
"from",
"AdapterInterface",
"::",
"bindValue",
"()",
".",
"Any",
"code",
"modification",
"here",
"must",
"be",
"ported",
"there",... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1312-L1335 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getIdentifierPhp | public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ", $phpType = null)
{
return sprintf(
"
%s%s = %s%s->lastInsertId(%s);",
$tab,
$columnValueMutator,
$connectionVariableName,
... | php | public function getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = " ", $phpType = null)
{
return sprintf(
"
%s%s = %s%s->lastInsertId(%s);",
$tab,
$columnValueMutator,
$connectionVariableName,
... | [
"public",
"function",
"getIdentifierPhp",
"(",
"$",
"columnValueMutator",
",",
"$",
"connectionVariableName",
"=",
"'$con'",
",",
"$",
"sequenceName",
"=",
"''",
",",
"$",
"tab",
"=",
"\" \"",
",",
"$",
"phpType",
"=",
"null",
")",
"{",
"return",
... | Get the PHP snippet for getting a Pk from the database.
Warning: duplicates logic from AdapterInterface::getId().
Any code modification here must be ported there.
Typical output:
<code>
$this->id = $con->lastInsertId();
</code> | [
"Get",
"the",
"PHP",
"snippet",
"for",
"getting",
"a",
"Pk",
"from",
"the",
"database",
".",
"Warning",
":",
"duplicates",
"logic",
"from",
"AdapterInterface",
"::",
"getId",
"()",
".",
"Any",
"code",
"modification",
"here",
"must",
"be",
"ported",
"there",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1347-L1358 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.getDefaultTypeSize | public function getDefaultTypeSize($type)
{
$sizes = $this->getDefaultTypeSizes();
return isset($sizes[strtolower($type)]) ? $sizes[strtolower($type)] : null;
} | php | public function getDefaultTypeSize($type)
{
$sizes = $this->getDefaultTypeSizes();
return isset($sizes[strtolower($type)]) ? $sizes[strtolower($type)] : null;
} | [
"public",
"function",
"getDefaultTypeSize",
"(",
"$",
"type",
")",
"{",
"$",
"sizes",
"=",
"$",
"this",
"->",
"getDefaultTypeSizes",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"sizes",
"[",
"strtolower",
"(",
"$",
"type",
")",
"]",
")",
"?",
"$",
"s... | Returns the default size of a specific type.
@param string $type
@return integer | [
"Returns",
"the",
"default",
"size",
"of",
"a",
"specific",
"type",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1376-L1381 |
propelorm/Propel2 | src/Propel/Generator/Platform/DefaultPlatform.php | DefaultPlatform.normalizeTable | public function normalizeTable(Table $table)
{
if ($table->hasForeignKeys()) {
foreach ($table->getForeignKeys() as $fk) {
if ($fk->getForeignTable() && !$fk->getForeignTable()->isUnique($fk->getForeignColumnObjects())) {
$unique = new Unique();
... | php | public function normalizeTable(Table $table)
{
if ($table->hasForeignKeys()) {
foreach ($table->getForeignKeys() as $fk) {
if ($fk->getForeignTable() && !$fk->getForeignTable()->isUnique($fk->getForeignColumnObjects())) {
$unique = new Unique();
... | [
"public",
"function",
"normalizeTable",
"(",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"->",
"hasForeignKeys",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"table",
"->",
"getForeignKeys",
"(",
")",
"as",
"$",
"fk",
")",
"{",
"if",
"(",
... | Normalizes a table for the current platform. Very important for the TableComparator to not
generate useless diffs.
Useful for checking needed definitions/structures. E.g. Unique Indexes for ForeignKey columns,
which the most Platforms requires but which is not always explicitly defined in the table model.
@param Table... | [
"Normalizes",
"a",
"table",
"for",
"the",
"current",
"platform",
".",
"Very",
"important",
"for",
"the",
"TableComparator",
"to",
"not",
"generate",
"useless",
"diffs",
".",
"Useful",
"for",
"checking",
"needed",
"definitions",
"/",
"structures",
".",
"E",
"."... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/DefaultPlatform.php#L1391-L1417 |
propelorm/Propel2 | src/Propel/Runtime/Collection/ObjectCombinationCollection.php | ObjectCombinationCollection.getPrimaryKeys | public function getPrimaryKeys($usePrefix = true)
{
$ret = [];
/** @var $obj ActiveRecordInterface */
foreach ($this as $combination) {
$pkCombo = [];
foreach ($combination as $key => $obj) {
$pkCombo[$key] = $obj->getPrimaryKey();
}
... | php | public function getPrimaryKeys($usePrefix = true)
{
$ret = [];
/** @var $obj ActiveRecordInterface */
foreach ($this as $combination) {
$pkCombo = [];
foreach ($combination as $key => $obj) {
$pkCombo[$key] = $obj->getPrimaryKey();
}
... | [
"public",
"function",
"getPrimaryKeys",
"(",
"$",
"usePrefix",
"=",
"true",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"/** @var $obj ActiveRecordInterface */",
"foreach",
"(",
"$",
"this",
"as",
"$",
"combination",
")",
"{",
"$",
"pkCombo",
"=",
"[",
"]",
... | Get an array of the primary keys of all the objects in the collection
@param boolean $usePrefix
@return array The list of the primary keys of the collection | [
"Get",
"an",
"array",
"of",
"the",
"primary",
"keys",
"of",
"all",
"the",
"objects",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCombinationCollection.php#L30-L44 |
propelorm/Propel2 | src/Propel/Runtime/Collection/ObjectCombinationCollection.php | ObjectCombinationCollection.search | public function search($element)
{
$hashes = [];
$isActiveRecord = [];
foreach (func_get_args() as $pos => $obj) {
if ($obj instanceof ActiveRecordInterface) {
$hashes[$pos] = $obj->hashCode();
$isActiveRecord[$pos] = true;
} else {
... | php | public function search($element)
{
$hashes = [];
$isActiveRecord = [];
foreach (func_get_args() as $pos => $obj) {
if ($obj instanceof ActiveRecordInterface) {
$hashes[$pos] = $obj->hashCode();
$isActiveRecord[$pos] = true;
} else {
... | [
"public",
"function",
"search",
"(",
"$",
"element",
")",
"{",
"$",
"hashes",
"=",
"[",
"]",
";",
"$",
"isActiveRecord",
"=",
"[",
"]",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"pos",
"=>",
"$",
"obj",
")",
"{",
"if",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCombinationCollection.php#L72-L104 |
propelorm/Propel2 | src/Propel/Runtime/Collection/ObjectCombinationCollection.php | ObjectCombinationCollection.removeObject | public function removeObject($element)
{
if (false !== ($pos = call_user_func_array([$this, 'search'], func_get_args()))) {
$this->remove($pos);
}
} | php | public function removeObject($element)
{
if (false !== ($pos = call_user_func_array([$this, 'search'], func_get_args()))) {
$this->remove($pos);
}
} | [
"public",
"function",
"removeObject",
"(",
"$",
"element",
")",
"{",
"if",
"(",
"false",
"!==",
"(",
"$",
"pos",
"=",
"call_user_func_array",
"(",
"[",
"$",
"this",
",",
"'search'",
"]",
",",
"func_get_args",
"(",
")",
")",
")",
")",
"{",
"$",
"this"... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/ObjectCombinationCollection.php#L109-L114 |
propelorm/Propel2 | src/Propel/Generator/Manager/SqlManager.php | SqlManager.buildSql | public function buildSql()
{
$sqlDbMapContent = "# Sqlfile -> Database map\n";
foreach ($this->getDatabases() as $datasource => $database) {
$platform = $database->getPlatform();
$filename = $database->getName() . '.sql';
$ddl = $platform->getAddTablesDDL($databa... | php | public function buildSql()
{
$sqlDbMapContent = "# Sqlfile -> Database map\n";
foreach ($this->getDatabases() as $datasource => $database) {
$platform = $database->getPlatform();
$filename = $database->getName() . '.sql';
$ddl = $platform->getAddTablesDDL($databa... | [
"public",
"function",
"buildSql",
"(",
")",
"{",
"$",
"sqlDbMapContent",
"=",
"\"# Sqlfile -> Database map\\n\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDatabases",
"(",
")",
"as",
"$",
"datasource",
"=>",
"$",
"database",
")",
"{",
"$",
"platform",
"="... | Build SQL files. | [
"Build",
"SQL",
"files",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Manager/SqlManager.php#L99-L120 |
propelorm/Propel2 | src/Propel/Generator/Manager/SqlManager.php | SqlManager.getConnectionInstance | protected function getConnectionInstance($datasource)
{
$buildConnection = $this->getConnection($datasource);
$dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);
// Set user + password to null if they are empty strings or missing
$username = isset($buildConnection['us... | php | protected function getConnectionInstance($datasource)
{
$buildConnection = $this->getConnection($datasource);
$dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);
// Set user + password to null if they are empty strings or missing
$username = isset($buildConnection['us... | [
"protected",
"function",
"getConnectionInstance",
"(",
"$",
"datasource",
")",
"{",
"$",
"buildConnection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
"$",
"datasource",
")",
";",
"$",
"dsn",
"=",
"str_replace",
"(",
"\"@DB@\"",
",",
"$",
"datasource",
",... | Returns a ConnectionInterface instance for a given datasource.
@param string $datasource
@return ConnectionInterface | [
"Returns",
"a",
"ConnectionInterface",
"instance",
"for",
"a",
"given",
"datasource",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Manager/SqlManager.php#L193-L206 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.getFirst | public function getFirst()
{
if (0 === count($this->data)) {
return null;
}
reset($this->data);
return current($this->data);
} | php | public function getFirst()
{
if (0 === count($this->data)) {
return null;
}
reset($this->data);
return current($this->data);
} | [
"public",
"function",
"getFirst",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"return",
"null",
";",
"}",
"reset",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"current",
"(",
"$",
"this",
... | Get the first element in the collection
@return mixed | [
"Get",
"the",
"first",
"element",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L183-L191 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.getLast | public function getLast()
{
if (0 === $this->count()) {
return null;
}
end($this->data);
return current($this->data);
} | php | public function getLast()
{
if (0 === $this->count()) {
return null;
}
end($this->data);
return current($this->data);
} | [
"public",
"function",
"getLast",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"$",
"this",
"->",
"count",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"end",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"current",
"(",
"$",
"this",
"->",
"da... | Get the last element in the collection
@return mixed | [
"Get",
"the",
"last",
"element",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L198-L207 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.get | public function get($key)
{
if (!$this->offsetExists($key)) {
throw new UnexpectedValueException(sprintf('Unknown key %s.', $key));
}
return $this->offsetGet($key);
} | php | public function get($key)
{
if (!$this->offsetExists($key)) {
throw new UnexpectedValueException(sprintf('Unknown key %s.', $key));
}
return $this->offsetGet($key);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"sprintf",
"(",
"'Unknown key %s.'",
",",
"$",
"key",
")",
")",
... | Get an element from its key
Alias for ArrayObject::offsetGet()
@param mixed $key
@return mixed The element | [
"Get",
"an",
"element",
"from",
"its",
"key",
"Alias",
"for",
"ArrayObject",
"::",
"offsetGet",
"()"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L226-L233 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.pop | public function pop()
{
if (0 === $this->count()) {
return null;
}
$array = $this->getArrayCopy();
$ret = array_pop($array);
$this->exchangeArray($array);
return $ret;
} | php | public function pop()
{
if (0 === $this->count()) {
return null;
}
$array = $this->getArrayCopy();
$ret = array_pop($array);
$this->exchangeArray($array);
return $ret;
} | [
"public",
"function",
"pop",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"$",
"this",
"->",
"count",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"array",
"=",
"$",
"this",
"->",
"getArrayCopy",
"(",
")",
";",
"$",
"ret",
"=",
"array_pop",
"(... | Pops an element off the end of the collection
@return mixed The popped element | [
"Pops",
"an",
"element",
"off",
"the",
"end",
"of",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L240-L251 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.shift | public function shift()
{
// the reindexing is complicated to deal with through the iterator
// so let's use the simple solution
$arr = $this->getArrayCopy();
$ret = array_shift($arr);
$this->exchangeArray($arr);
return $ret;
} | php | public function shift()
{
// the reindexing is complicated to deal with through the iterator
// so let's use the simple solution
$arr = $this->getArrayCopy();
$ret = array_shift($arr);
$this->exchangeArray($arr);
return $ret;
} | [
"public",
"function",
"shift",
"(",
")",
"{",
"// the reindexing is complicated to deal with through the iterator",
"// so let's use the simple solution",
"$",
"arr",
"=",
"$",
"this",
"->",
"getArrayCopy",
"(",
")",
";",
"$",
"ret",
"=",
"array_shift",
"(",
"$",
"arr... | Pops an element off the beginning of the collection
@return mixed The popped element | [
"Pops",
"an",
"element",
"off",
"the",
"beginning",
"of",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L258-L267 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.prepend | public function prepend($value)
{
// the reindexing is complicated to deal with through the iterator
// so let's use the simple solution
$arr = $this->getArrayCopy();
$ret = array_unshift($arr, $value);
$this->exchangeArray($arr);
return $ret;
} | php | public function prepend($value)
{
// the reindexing is complicated to deal with through the iterator
// so let's use the simple solution
$arr = $this->getArrayCopy();
$ret = array_unshift($arr, $value);
$this->exchangeArray($arr);
return $ret;
} | [
"public",
"function",
"prepend",
"(",
"$",
"value",
")",
"{",
"// the reindexing is complicated to deal with through the iterator",
"// so let's use the simple solution",
"$",
"arr",
"=",
"$",
"this",
"->",
"getArrayCopy",
"(",
")",
";",
"$",
"ret",
"=",
"array_unshift"... | Prepend one or more elements to the beginning of the collection
@param mixed $value the element to prepend
@return integer The number of new elements in the array | [
"Prepend",
"one",
"or",
"more",
"elements",
"to",
"the",
"beginning",
"of",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L285-L294 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.remove | public function remove($key)
{
if (!$this->offsetExists($key)) {
throw new UnexpectedValueException(sprintf('Unknown key %s.', $key));
}
return $this->offsetUnset($key);
} | php | public function remove($key)
{
if (!$this->offsetExists($key)) {
throw new UnexpectedValueException(sprintf('Unknown key %s.', $key));
}
return $this->offsetUnset($key);
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"sprintf",
"(",
"'Unknown key %s.'",
",",
"$",
"key",
")",
")... | Removes a specified collection element
Alias for ArrayObject::offsetUnset()
@param mixed $key
@return mixed The removed element | [
"Removes",
"a",
"specified",
"collection",
"element",
"Alias",
"for",
"ArrayObject",
"::",
"offsetUnset",
"()"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L315-L322 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.diff | public function diff(Collection $collection)
{
$diff = clone $this;
$diff->clear();
foreach ($this as $object) {
if (!$collection->contains($object)) {
$diff[] = $object;
}
}
return $diff;
} | php | public function diff(Collection $collection)
{
$diff = clone $this;
$diff->clear();
foreach ($this as $object) {
if (!$collection->contains($object)) {
$diff[] = $object;
}
}
return $diff;
} | [
"public",
"function",
"diff",
"(",
"Collection",
"$",
"collection",
")",
"{",
"$",
"diff",
"=",
"clone",
"$",
"this",
";",
"$",
"diff",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"$",... | Returns an array of objects present in the collection that
are not presents in the given collection.
@param Collection $collection A Propel collection.
@return Collection An array of Propel objects from the collection that are not presents in the given collection. | [
"Returns",
"an",
"array",
"of",
"objects",
"present",
"in",
"the",
"collection",
"that",
"are",
"not",
"presents",
"in",
"the",
"given",
"collection",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L363-L375 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.setModel | public function setModel($model)
{
if (false !== $pos = strrpos($model, '\\')) {
$this->model = substr($model, $pos + 1);
} else {
$this->model = $model;
}
$this->fullyQualifiedModel = ((0 === strpos($model, '\\')) ? '' : '\\') . $model;
} | php | public function setModel($model)
{
if (false !== $pos = strrpos($model, '\\')) {
$this->model = substr($model, $pos + 1);
} else {
$this->model = $model;
}
$this->fullyQualifiedModel = ((0 === strpos($model, '\\')) ? '' : '\\') . $model;
} | [
"public",
"function",
"setModel",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
"model",
",",
"'\\\\'",
")",
")",
"{",
"$",
"this",
"->",
"model",
"=",
"substr",
"(",
"$",
"model",
",",
"$",
"pos",
... | Set the model of the elements in the collection
@param string $model Name of the Propel object classes stored in the collection | [
"Set",
"the",
"model",
"of",
"the",
"elements",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L411-L419 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.importFrom | public function importFrom($parser, $data)
{
if (!$parser instanceof AbstractParser) {
$parser = AbstractParser::getParser($parser);
}
return $this->fromArray($parser->listToArray($data, $this->getPluralModelName()), TableMap::TYPE_PHPNAME);
} | php | public function importFrom($parser, $data)
{
if (!$parser instanceof AbstractParser) {
$parser = AbstractParser::getParser($parser);
}
return $this->fromArray($parser->listToArray($data, $this->getPluralModelName()), TableMap::TYPE_PHPNAME);
} | [
"public",
"function",
"importFrom",
"(",
"$",
"parser",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"$",
"parser",
"instanceof",
"AbstractParser",
")",
"{",
"$",
"parser",
"=",
"AbstractParser",
"::",
"getParser",
"(",
"$",
"parser",
")",
";",
"}",
"re... | Populate the current collection from a string, using a given parser format
<code>
$coll = new ObjectCollection();
$coll->setModel('Book');
$coll->importFrom('JSON', '{{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}');
</code>
@param mixed $parser A AbstractParser i... | [
"Populate",
"the",
"current",
"collection",
"from",
"a",
"string",
"using",
"a",
"given",
"parser",
"format",
"<code",
">",
"$coll",
"=",
"new",
"ObjectCollection",
"()",
";",
"$coll",
"-",
">",
"setModel",
"(",
"Book",
")",
";",
"$coll",
"-",
">",
"impo... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L493-L500 |
propelorm/Propel2 | src/Propel/Runtime/Collection/Collection.php | Collection.exportTo | public function exportTo($parser, $usePrefix = true, $includeLazyLoadColumns = true)
{
if (!$parser instanceof AbstractParser) {
$parser = AbstractParser::getParser($parser);
}
$array = $this->toArray(null, $usePrefix, TableMap::TYPE_PHPNAME, $includeLazyLoadColumns);
r... | php | public function exportTo($parser, $usePrefix = true, $includeLazyLoadColumns = true)
{
if (!$parser instanceof AbstractParser) {
$parser = AbstractParser::getParser($parser);
}
$array = $this->toArray(null, $usePrefix, TableMap::TYPE_PHPNAME, $includeLazyLoadColumns);
r... | [
"public",
"function",
"exportTo",
"(",
"$",
"parser",
",",
"$",
"usePrefix",
"=",
"true",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"parser",
"instanceof",
"AbstractParser",
")",
"{",
"$",
"parser",
"=",
"AbstractParse... | Export the current collection to a string, using a given parser format
<code>
$books = BookQuery::create()->find();
echo $book->exportTo('JSON');
=> {{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}}');
</code>
A OnDemandCollection cannot be exported. Any attempt will... | [
"Export",
"the",
"current",
"collection",
"to",
"a",
"string",
"using",
"a",
"given",
"parser",
"format",
"<code",
">",
"$books",
"=",
"BookQuery",
"::",
"create",
"()",
"-",
">",
"find",
"()",
";",
"echo",
"$book",
"-",
">",
"exportTo",
"(",
"JSON",
"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/Collection.php#L522-L531 |
propelorm/Propel2 | src/Propel/Generator/Model/NameFactory.php | NameFactory.getAlgorithm | protected static function getAlgorithm($name)
{
if (!isset(self::$algorithms[$name])) {
self::$algorithms[$name] = new $name();
}
return self::$algorithms[$name];
} | php | protected static function getAlgorithm($name)
{
if (!isset(self::$algorithms[$name])) {
self::$algorithms[$name] = new $name();
}
return self::$algorithms[$name];
} | [
"protected",
"static",
"function",
"getAlgorithm",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"algorithms",
"[",
"$",
"name",
"]",
")",
")",
"{",
"self",
"::",
"$",
"algorithms",
"[",
"$",
"name",
"]",
"=",
"new",
... | Factory method which retrieves an instance of the named generator.
@param string $name The fully qualified class name of the name
generation algorithm to retrieve. | [
"Factory",
"method",
"which",
"retrieves",
"an",
"instance",
"of",
"the",
"named",
"generator",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/NameFactory.php#L46-L53 |
propelorm/Propel2 | src/Propel/Generator/Model/NameFactory.php | NameFactory.generateName | public static function generateName($algorithmName, $inputs)
{
$algorithm = self::getAlgorithm($algorithmName);
return $algorithm->generateName($inputs);
} | php | public static function generateName($algorithmName, $inputs)
{
$algorithm = self::getAlgorithm($algorithmName);
return $algorithm->generateName($inputs);
} | [
"public",
"static",
"function",
"generateName",
"(",
"$",
"algorithmName",
",",
"$",
"inputs",
")",
"{",
"$",
"algorithm",
"=",
"self",
"::",
"getAlgorithm",
"(",
"$",
"algorithmName",
")",
";",
"return",
"$",
"algorithm",
"->",
"generateName",
"(",
"$",
"... | Given a list of <code>String</code> objects, implements an
algorithm which produces a name.
@param string $algorithmName The fully qualified class name of the {@link NameGeneratorInterface}
implementation to use to generate names.
@param array $inputs Inputs used to generate a name.
@return... | [
"Given",
"a",
"list",
"of",
"<code",
">",
"String<",
"/",
"code",
">",
"objects",
"implements",
"an",
"algorithm",
"which",
"produces",
"a",
"name",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/NameFactory.php#L65-L70 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.fetch | public function fetch($style = null)
{
if (is_null($style)) {
$style = $this->style;
}
return $this->getDataObject()->fetch($style);
} | php | public function fetch($style = null)
{
if (is_null($style)) {
$style = $this->style;
}
return $this->getDataObject()->fetch($style);
} | [
"public",
"function",
"fetch",
"(",
"$",
"style",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"style",
")",
")",
"{",
"$",
"style",
"=",
"$",
"this",
"->",
"style",
";",
"}",
"return",
"$",
"this",
"->",
"getDataObject",
"(",
")",
"->"... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L59-L65 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.next | public function next()
{
if (null !== $this->dataObject) {
$this->current = $this->dataObject->fetch($this->style);
if ($this->current) {
$this->index++;
}
}
} | php | public function next()
{
if (null !== $this->dataObject) {
$this->current = $this->dataObject->fetch($this->style);
if ($this->current) {
$this->index++;
}
}
} | [
"public",
"function",
"next",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"dataObject",
")",
"{",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"dataObject",
"->",
"fetch",
"(",
"$",
"this",
"->",
"style",
")",
";",
"if",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L70-L78 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.rewind | public function rewind()
{
if ($this->dataObject)
$this->current = $this->dataObject->fetch($this->style);
} | php | public function rewind()
{
if ($this->dataObject)
$this->current = $this->dataObject->fetch($this->style);
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataObject",
")",
"$",
"this",
"->",
"current",
"=",
"$",
"this",
"->",
"dataObject",
"->",
"fetch",
"(",
"$",
"this",
"->",
"style",
")",
";",
"}"
] | Not supported in PDODataFetcher.
It actually fetches the first row, since a foreach in php triggers that
function as init. | [
"Not",
"supported",
"in",
"PDODataFetcher",
".",
"It",
"actually",
"fetches",
"the",
"first",
"row",
"since",
"a",
"foreach",
"in",
"php",
"triggers",
"that",
"function",
"as",
"init",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L109-L113 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.close | public function close()
{
$this->getDataObject()->closeCursor();
$this->setDataObject(null); //so the connection can be garbage collected
$this->current = null;
$this->index = -1;
} | php | public function close()
{
$this->getDataObject()->closeCursor();
$this->setDataObject(null); //so the connection can be garbage collected
$this->current = null;
$this->index = -1;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"$",
"this",
"->",
"getDataObject",
"(",
")",
"->",
"closeCursor",
"(",
")",
";",
"$",
"this",
"->",
"setDataObject",
"(",
"null",
")",
";",
"//so the connection can be garbage collected",
"$",
"this",
"->",
"cur... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L118-L124 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.count | public function count()
{
if ($this->dataObject && 'sqlite' === $this->dataObject->getConnection()->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
$lastQuery = $this->dataObject->getStatement()->queryString;
if ('SELECT ' === substr(trim(strtoupper($lastQuery)), 0, 7)) {
// ... | php | public function count()
{
if ($this->dataObject && 'sqlite' === $this->dataObject->getConnection()->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
$lastQuery = $this->dataObject->getStatement()->queryString;
if ('SELECT ' === substr(trim(strtoupper($lastQuery)), 0, 7)) {
// ... | [
"public",
"function",
"count",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataObject",
"&&",
"'sqlite'",
"===",
"$",
"this",
"->",
"dataObject",
"->",
"getConnection",
"(",
")",
"->",
"getAttribute",
"(",
"\\",
"PDO",
"::",
"ATTR_DRIVER_NAME",
")",
")... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L129-L149 |
propelorm/Propel2 | src/Propel/Runtime/DataFetcher/PDODataFetcher.php | PDODataFetcher.bindColumn | public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
{
if ($this->dataObject)
$this->dataObject->bindColumn($column, $param, $type, $maxlen, $driverdata);
} | php | public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
{
if ($this->dataObject)
$this->dataObject->bindColumn($column, $param, $type, $maxlen, $driverdata);
} | [
"public",
"function",
"bindColumn",
"(",
"$",
"column",
",",
"&",
"$",
"param",
",",
"$",
"type",
"=",
"null",
",",
"$",
"maxlen",
"=",
"null",
",",
"$",
"driverdata",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataObject",
")",
"$",
"... | Bind a column to a PHP variable.
@see http://www.php.net/manual/en/pdostatement.bindcolumn.php
@param mixed $column
@param mixed $param
@param int $type
@param int $maxlen
@param mixed $driverdata | [
"Bind",
"a",
"column",
"to",
"a",
"PHP",
"variable",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/PDODataFetcher.php#L170-L174 |
propelorm/Propel2 | src/Propel/Generator/Command/InitCommand.php | InitCommand.createConsoleHelper | protected function createConsoleHelper(InputInterface $input, OutputInterface $output)
{
/* Check if it runs in Symfony3 env — than use QuestionHelper, because DialogHelper is absent */
if (class_exists('\Symfony\Component\Console\Helper\QuestionHelper')) {
$helper = new ConsoleHelper3($... | php | protected function createConsoleHelper(InputInterface $input, OutputInterface $output)
{
/* Check if it runs in Symfony3 env — than use QuestionHelper, because DialogHelper is absent */
if (class_exists('\Symfony\Component\Console\Helper\QuestionHelper')) {
$helper = new ConsoleHelper3($... | [
"protected",
"function",
"createConsoleHelper",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"/* Check if it runs in Symfony3 env — than use QuestionHelper, because DialogHelper is absent */",
"if",
"(",
"class_exists",
"(",
"'\\Symfony\\C... | @param InputInterface $input
@param OutputInterface $output
@return ConsoleHelperInterface | [
"@param",
"InputInterface",
"$input",
"@param",
"OutputInterface",
"$output"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/InitCommand.php#L323-L334 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.init | public function init(Criteria $criteria)
{
try {
$db = Propel::getServiceContainer()->getAdapter($criteria->getDbName());
$this->setAdapter($db);
} catch (\Exception $e) {
// we are only doing this to allow easier debugging, so
// no need to throw up t... | php | public function init(Criteria $criteria)
{
try {
$db = Propel::getServiceContainer()->getAdapter($criteria->getDbName());
$this->setAdapter($db);
} catch (\Exception $e) {
// we are only doing this to allow easier debugging, so
// no need to throw up t... | [
"public",
"function",
"init",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"try",
"{",
"$",
"db",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getAdapter",
"(",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
")",
";",
"$",
"this",
"->",
... | Init some properties with the help of outer class
@param Criteria $criteria The outer class | [
"Init",
"some",
"properties",
"with",
"the",
"help",
"of",
"outer",
"class"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L97-L111 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.setColumn | protected function setColumn($column)
{
if ($column instanceof ColumnMap) {
$this->column = $column->getName();
$this->table = $column->getTable()->getName();
} else {
$dotPos = strrpos($column, '.');
if ($dotPos === false) {
// no dot ... | php | protected function setColumn($column)
{
if ($column instanceof ColumnMap) {
$this->column = $column->getName();
$this->table = $column->getTable()->getName();
} else {
$dotPos = strrpos($column, '.');
if ($dotPos === false) {
// no dot ... | [
"protected",
"function",
"setColumn",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"column",
"instanceof",
"ColumnMap",
")",
"{",
"$",
"this",
"->",
"column",
"=",
"$",
"column",
"->",
"getName",
"(",
")",
";",
"$",
"this",
"->",
"table",
"=",
"$",
... | Set the $column and $table properties based on a column name or object | [
"Set",
"the",
"$column",
"and",
"$table",
"properties",
"based",
"on",
"a",
"column",
"name",
"or",
"object"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L116-L132 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.setAdapter | public function setAdapter(AdapterInterface $v)
{
$this->db = $v;
foreach ($this->clauses as $clause) {
$clause->setAdapter($v);
}
} | php | public function setAdapter(AdapterInterface $v)
{
$this->db = $v;
foreach ($this->clauses as $clause) {
$clause->setAdapter($v);
}
} | [
"public",
"function",
"setAdapter",
"(",
"AdapterInterface",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"db",
"=",
"$",
"v",
";",
"foreach",
"(",
"$",
"this",
"->",
"clauses",
"as",
"$",
"clause",
")",
"{",
"$",
"clause",
"->",
"setAdapter",
"(",
"$",
... | Set the adapter.
The AdapterInterface might be used to get db specific variations of sql.
@param AdapterInterface $v Value to assign to db.
@return void | [
"Set",
"the",
"adapter",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L204-L210 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.addAnd | public function addAnd(AbstractCriterion $criterion)
{
$this->clauses[] = $criterion;
$this->conjunctions[] = self::UND;
return $this;
} | php | public function addAnd(AbstractCriterion $criterion)
{
$this->clauses[] = $criterion;
$this->conjunctions[] = self::UND;
return $this;
} | [
"public",
"function",
"addAnd",
"(",
"AbstractCriterion",
"$",
"criterion",
")",
"{",
"$",
"this",
"->",
"clauses",
"[",
"]",
"=",
"$",
"criterion",
";",
"$",
"this",
"->",
"conjunctions",
"[",
"]",
"=",
"self",
"::",
"UND",
";",
"return",
"$",
"this",... | Append an AND Criterion onto this Criterion's list.
@param AbstractCriterion $criterion
@return $this|AbstractCriterion | [
"Append",
"an",
"AND",
"Criterion",
"onto",
"this",
"Criterion",
"s",
"list",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L236-L242 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.addOr | public function addOr(AbstractCriterion $criterion)
{
$this->clauses[] = $criterion;
$this->conjunctions[] = self::ODER;
return $this;
} | php | public function addOr(AbstractCriterion $criterion)
{
$this->clauses[] = $criterion;
$this->conjunctions[] = self::ODER;
return $this;
} | [
"public",
"function",
"addOr",
"(",
"AbstractCriterion",
"$",
"criterion",
")",
"{",
"$",
"this",
"->",
"clauses",
"[",
"]",
"=",
"$",
"criterion",
";",
"$",
"this",
"->",
"conjunctions",
"[",
"]",
"=",
"self",
"::",
"ODER",
";",
"return",
"$",
"this",... | Append an OR Criterion onto this Criterion's list.
@param AbstractCriterion $criterion
@return $this|AbstractCriterion | [
"Append",
"an",
"OR",
"Criterion",
"onto",
"this",
"Criterion",
"s",
"list",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L250-L256 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.equals | public function equals($obj)
{
// TODO: optimize me with early outs
if ($this === $obj) {
return true;
}
if ((null === $obj) || !($obj instanceof AbstractCriterion)) {
return false;
}
/** @var AbstractCriterion $crit */
$crit = $obj;
... | php | public function equals($obj)
{
// TODO: optimize me with early outs
if ($this === $obj) {
return true;
}
if ((null === $obj) || !($obj instanceof AbstractCriterion)) {
return false;
}
/** @var AbstractCriterion $crit */
$crit = $obj;
... | [
"public",
"function",
"equals",
"(",
"$",
"obj",
")",
"{",
"// TODO: optimize me with early outs",
"if",
"(",
"$",
"this",
"===",
"$",
"obj",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"(",
"null",
"===",
"$",
"obj",
")",
"||",
"!",
"(",
"$",
... | This method checks another Criteria to see if they contain
the same attributes and hashtable entries.
@return boolean | [
"This",
"method",
"checks",
"another",
"Criteria",
"to",
"see",
"if",
"they",
"contain",
"the",
"same",
"attributes",
"and",
"hashtable",
"entries",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L305-L341 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.addCriterionTable | private function addCriterionTable(AbstractCriterion $c, array &$s)
{
$s[] = $c->getTable();
foreach ($c->getClauses() as $clause) {
$this->addCriterionTable($clause, $s);
}
} | php | private function addCriterionTable(AbstractCriterion $c, array &$s)
{
$s[] = $c->getTable();
foreach ($c->getClauses() as $clause) {
$this->addCriterionTable($clause, $s);
}
} | [
"private",
"function",
"addCriterionTable",
"(",
"AbstractCriterion",
"$",
"c",
",",
"array",
"&",
"$",
"s",
")",
"{",
"$",
"s",
"[",
"]",
"=",
"$",
"c",
"->",
"getTable",
"(",
")",
";",
"foreach",
"(",
"$",
"c",
"->",
"getClauses",
"(",
")",
"as",... | method supporting recursion through all criterions to give
us a string array of tables from each criterion
@return void | [
"method",
"supporting",
"recursion",
"through",
"all",
"criterions",
"to",
"give",
"us",
"a",
"string",
"array",
"of",
"tables",
"from",
"each",
"criterion"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L360-L366 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php | AbstractCriterion.getAttachedCriterion | public function getAttachedCriterion()
{
$criterions = [$this];
foreach ($this->getClauses() as $criterion) {
$criterions = array_merge($criterions, $criterion->getAttachedCriterion());
}
return $criterions;
} | php | public function getAttachedCriterion()
{
$criterions = [$this];
foreach ($this->getClauses() as $criterion) {
$criterions = array_merge($criterions, $criterion->getAttachedCriterion());
}
return $criterions;
} | [
"public",
"function",
"getAttachedCriterion",
"(",
")",
"{",
"$",
"criterions",
"=",
"[",
"$",
"this",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getClauses",
"(",
")",
"as",
"$",
"criterion",
")",
"{",
"$",
"criterions",
"=",
"array_merge",
"(",
"$... | get an array of all criterion attached to this
recursing through all sub criterion
@return AbstractCriterion[] | [
"get",
"an",
"array",
"of",
"all",
"criterion",
"attached",
"to",
"this",
"recursing",
"through",
"all",
"sub",
"criterion"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php#L373-L381 |
propelorm/Propel2 | src/Propel/Common/Pluralizer/StandardEnglishPluralizer.php | StandardEnglishPluralizer.getPluralForm | public function getPluralForm($root)
{
// save some time in the case that singular and plural are the same
if (in_array(strtolower($root), $this->uncountable)) {
return $root;
}
// check for irregular singular words
foreach ($this->irregular as $pattern => $resul... | php | public function getPluralForm($root)
{
// save some time in the case that singular and plural are the same
if (in_array(strtolower($root), $this->uncountable)) {
return $root;
}
// check for irregular singular words
foreach ($this->irregular as $pattern => $resul... | [
"public",
"function",
"getPluralForm",
"(",
"$",
"root",
")",
"{",
"// save some time in the case that singular and plural are the same",
"if",
"(",
"in_array",
"(",
"strtolower",
"(",
"$",
"root",
")",
",",
"$",
"this",
"->",
"uncountable",
")",
")",
"{",
"return... | Generate a plural name based on the passed in root.
@param string $root The root that needs to be pluralized (e.g. Author)
@return string The plural form of $root (e.g. Authors). | [
"Generate",
"a",
"plural",
"name",
"based",
"on",
"the",
"passed",
"in",
"root",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Pluralizer/StandardEnglishPluralizer.php#L118-L150 |
propelorm/Propel2 | src/Propel/Runtime/Parser/JsonParser.php | JsonParser.toArray | public function toArray($data, $rootKey = null)
{
$data = json_decode($data, true);
if ($rootKey === null) {
return $data;
}
if (!isset($data[$rootKey])) {
return [];
}
return $data[$rootKey];
} | php | public function toArray($data, $rootKey = null)
{
$data = json_decode($data, true);
if ($rootKey === null) {
return $data;
}
if (!isset($data[$rootKey])) {
return [];
}
return $data[$rootKey];
} | [
"public",
"function",
"toArray",
"(",
"$",
"data",
",",
"$",
"rootKey",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"data",
",",
"true",
")",
";",
"if",
"(",
"$",
"rootKey",
"===",
"null",
")",
"{",
"return",
"$",
"data",
";... | Converts data from JSON to an associative array.
@param string $data Source data to convert, as a JSON string
@param string $rootKey
@return array Converted data | [
"Converts",
"data",
"from",
"JSON",
"to",
"an",
"associative",
"array",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/JsonParser.php#L51-L64 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelWith.php | ModelWith.init | public function init(ModelJoin $join)
{
$tableMap = $join->getTableMap();
$this->setModelName($tableMap->getClassName());
$this->getTableMap = $tableMap;
$this->isSingleTableInheritance = $tableMap->isSingleTableInheritance();
$relation = $join->getRelationMap();
$rel... | php | public function init(ModelJoin $join)
{
$tableMap = $join->getTableMap();
$this->setModelName($tableMap->getClassName());
$this->getTableMap = $tableMap;
$this->isSingleTableInheritance = $tableMap->isSingleTableInheritance();
$relation = $join->getRelationMap();
$rel... | [
"public",
"function",
"init",
"(",
"ModelJoin",
"$",
"join",
")",
"{",
"$",
"tableMap",
"=",
"$",
"join",
"->",
"getTableMap",
"(",
")",
";",
"$",
"this",
"->",
"setModelName",
"(",
"$",
"tableMap",
"->",
"getClassName",
"(",
")",
")",
";",
"$",
"thi... | Define the joined hydration schema based on a join object.
Fills the ModelWith properties using a ModelJoin as source
@param ModelJoin $join | [
"Define",
"the",
"joined",
"hydration",
"schema",
"based",
"on",
"a",
"join",
"object",
".",
"Fills",
"the",
"ModelWith",
"properties",
"using",
"a",
"ModelJoin",
"as",
"source"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelWith.php#L58-L80 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelWith.php | ModelWith.setModelName | public function setModelName($modelName)
{
if (0 === strpos($modelName, '\\')) {
$this->modelName = substr($modelName, 1);
} else {
$this->modelName = $modelName;
}
} | php | public function setModelName($modelName)
{
if (0 === strpos($modelName, '\\')) {
$this->modelName = substr($modelName, 1);
} else {
$this->modelName = $modelName;
}
} | [
"public",
"function",
"setModelName",
"(",
"$",
"modelName",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"modelName",
",",
"'\\\\'",
")",
")",
"{",
"$",
"this",
"->",
"modelName",
"=",
"substr",
"(",
"$",
"modelName",
",",
"1",
")",
";",
"... | DataObject getters & setters | [
"DataObject",
"getters",
"&",
"setters"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelWith.php#L84-L91 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Join.php | Join.addCondition | public function addCondition($left, $right, $operator = self::EQUAL)
{
if (strrpos($left, '.')) {
list($this->leftTableName, $this->left[]) = explode('.', $left);
} else {
$this->left[] = $left;
}
if (strrpos($right, '.')) {
list($this->rightTabl... | php | public function addCondition($left, $right, $operator = self::EQUAL)
{
if (strrpos($left, '.')) {
list($this->leftTableName, $this->left[]) = explode('.', $left);
} else {
$this->left[] = $left;
}
if (strrpos($right, '.')) {
list($this->rightTabl... | [
"public",
"function",
"addCondition",
"(",
"$",
"left",
",",
"$",
"right",
",",
"$",
"operator",
"=",
"self",
"::",
"EQUAL",
")",
"{",
"if",
"(",
"strrpos",
"(",
"$",
"left",
",",
"'.'",
")",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"leftTableName... | Join condition definition.
Warning: doesn't support table aliases. Use the explicit methods to use aliases.
@param string $left The left column of the join condition
(may contain an alias name)
@param string $right The right column of the join condition
(may contain an alias name)
@param string $operator The co... | [
"Join",
"condition",
"definition",
".",
"Warning",
":",
"doesn",
"t",
"support",
"table",
"aliases",
".",
"Use",
"the",
"explicit",
"methods",
"to",
"use",
"aliases",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Join.php#L114-L132 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Join.php | Join.addExplicitCondition | public function addExplicitCondition(
$leftTableName,
$leftColumnName,
$leftTableAlias = null,
$rightTableName = null,
$rightColumnName = null,
$rightTableAlias = null,
$operator = self::EQUAL
) {
$this->leftTableName = $leftTableName;
$this->l... | php | public function addExplicitCondition(
$leftTableName,
$leftColumnName,
$leftTableAlias = null,
$rightTableName = null,
$rightColumnName = null,
$rightTableAlias = null,
$operator = self::EQUAL
) {
$this->leftTableName = $leftTableName;
$this->l... | [
"public",
"function",
"addExplicitCondition",
"(",
"$",
"leftTableName",
",",
"$",
"leftColumnName",
",",
"$",
"leftTableAlias",
"=",
"null",
",",
"$",
"rightTableName",
"=",
"null",
",",
"$",
"rightColumnName",
"=",
"null",
",",
"$",
"rightTableAlias",
"=",
"... | Join condition definition.
@example
<code>
$join = new Join();
$join->setJoinType(Criteria::LEFT_JOIN);
$join->addExplicitCondition('book', 'AUTHOR_ID', null, 'author', 'ID', 'a', Join::EQUAL);
echo $join->getClause();
// LEFT JOIN author a ON (book.AUTHOR_ID=a.ID)
</code>
@param string $leftTableName
@param string $l... | [
"Join",
"condition",
"definition",
".",
"@example",
"<code",
">",
"$join",
"=",
"new",
"Join",
"()",
";",
"$join",
"-",
">",
"setJoinType",
"(",
"Criteria",
"::",
"LEFT_JOIN",
")",
";",
"$join",
"-",
">",
"addExplicitCondition",
"(",
"book",
"AUTHOR_ID",
"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Join.php#L172-L191 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Join.php | Join.getLeftColumn | public function getLeftColumn($index = 0)
{
$tableName = $this->getLeftTableAliasOrName();
return $tableName ? $tableName . '.' . $this->left[$index] : $this->left[$index];
} | php | public function getLeftColumn($index = 0)
{
$tableName = $this->getLeftTableAliasOrName();
return $tableName ? $tableName . '.' . $this->left[$index] : $this->left[$index];
} | [
"public",
"function",
"getLeftColumn",
"(",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getLeftTableAliasOrName",
"(",
")",
";",
"return",
"$",
"tableName",
"?",
"$",
"tableName",
".",
"'.'",
".",
"$",
"this",
"->",
"le... | Get the fully qualified name of the left column of the join condition
@example
<code>
$join->addCondition('book.AUTHOR_ID', 'author.ID');
echo $join->getLeftColumn(); // 'book.AUTHOR_ID'
</code>
@param integer $index The number of the condition to use
@return string | [
"Get",
"the",
"fully",
"qualified",
"name",
"of",
"the",
"left",
"column",
"of",
"the",
"join",
"condition"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Join.php#L334-L339 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Join.php | Join.buildJoinCondition | public function buildJoinCondition(Criteria $c)
{
/** @var AbstractCriterion $joinCondition */
$joinCondition = null;
for ($i = 0; $i < $this->count; $i++) {
if ($this->leftValues[$i]) {
$criterion = $c->getNewCriterion(
$this->getLeftColumn($i... | php | public function buildJoinCondition(Criteria $c)
{
/** @var AbstractCriterion $joinCondition */
$joinCondition = null;
for ($i = 0; $i < $this->count; $i++) {
if ($this->leftValues[$i]) {
$criterion = $c->getNewCriterion(
$this->getLeftColumn($i... | [
"public",
"function",
"buildJoinCondition",
"(",
"Criteria",
"$",
"c",
")",
"{",
"/** @var AbstractCriterion $joinCondition */",
"$",
"joinCondition",
"=",
"null",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"count",
";",
"$... | Set the custom join condition Criterion based on the conditions of this join
@param Criteria $c A Criteria object to get Criterions from | [
"Set",
"the",
"custom",
"join",
"condition",
"Criterion",
"based",
"on",
"the",
"conditions",
"of",
"this",
"join"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Join.php#L606-L638 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Join.php | Join.getClause | public function getClause(&$params)
{
if (null === $this->joinCondition) {
$conditions = [];
for ($i = 0; $i < $this->count; $i++) {
if ($this->leftValues[$i]) {
$conditions[] = $this->getLeftColumn($i) . $this->getOperator($i) . var_export($this->... | php | public function getClause(&$params)
{
if (null === $this->joinCondition) {
$conditions = [];
for ($i = 0; $i < $this->count; $i++) {
if ($this->leftValues[$i]) {
$conditions[] = $this->getLeftColumn($i) . $this->getOperator($i) . var_export($this->... | [
"public",
"function",
"getClause",
"(",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"joinCondition",
")",
"{",
"$",
"conditions",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this"... | Get the join clause for this Join.
If the join condition needs binding, uses the passed params array.
@example
<code>
$join = new Join();
$join->addExplicitCondition('book', 'AUTHOR_ID', null, 'author', 'ID');
$params = array();
echo $j->getClause($params);
// 'LEFT JOIN author ON (book.AUTHOR_ID=author.ID)'
</code>
@... | [
"Get",
"the",
"join",
"clause",
"for",
"this",
"Join",
".",
"If",
"the",
"join",
"condition",
"needs",
"binding",
"uses",
"the",
"passed",
"params",
"array",
".",
"@example",
"<code",
">",
"$join",
"=",
"new",
"Join",
"()",
";",
"$join",
"-",
">",
"add... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Join.php#L656-L686 |
propelorm/Propel2 | src/Propel/Generator/Util/BehaviorLocator.php | BehaviorLocator.findComposerFile | private function findComposerFile($fileName)
{
if (null !== $this->composerDir) {
$filePath = $this->composerDir . '/' . $fileName;
if (file_exists($filePath)) {
return new SplFileInfo($filePath, dirname($filePath), dirname($filePath));
}
}
... | php | private function findComposerFile($fileName)
{
if (null !== $this->composerDir) {
$filePath = $this->composerDir . '/' . $fileName;
if (file_exists($filePath)) {
return new SplFileInfo($filePath, dirname($filePath), dirname($filePath));
}
}
... | [
"private",
"function",
"findComposerFile",
"(",
"$",
"fileName",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"composerDir",
")",
"{",
"$",
"filePath",
"=",
"$",
"this",
"->",
"composerDir",
".",
"'/'",
".",
"$",
"fileName",
";",
"if",
"(",
... | Searches a composer file
@return SplFileInfo the found composer file or null if composer file isn't found | [
"Searches",
"a",
"composer",
"file"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Util/BehaviorLocator.php#L50-L70 |
propelorm/Propel2 | src/Propel/Generator/Util/BehaviorLocator.php | BehaviorLocator.getBehaviors | public function getBehaviors()
{
if (null === $this->behaviors) {
// find behaviors in composer.lock file
$lock = $this->findComposerLock();
if (null === $lock) {
$this->behaviors = [];
} else {
$this->behaviors = $this->loadBe... | php | public function getBehaviors()
{
if (null === $this->behaviors) {
// find behaviors in composer.lock file
$lock = $this->findComposerLock();
if (null === $lock) {
$this->behaviors = [];
} else {
$this->behaviors = $this->loadBe... | [
"public",
"function",
"getBehaviors",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"behaviors",
")",
"{",
"// find behaviors in composer.lock file",
"$",
"lock",
"=",
"$",
"this",
"->",
"findComposerLock",
"(",
")",
";",
"if",
"(",
"null",
"... | Returns the loaded behaviors and loads them if not done before
@return array behaviors | [
"Returns",
"the",
"loaded",
"behaviors",
"and",
"loads",
"them",
"if",
"not",
"done",
"before"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Util/BehaviorLocator.php#L112-L137 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.