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/Criteria.php
Criteria.addCond
public function addCond($name, $p1, $value = null, $comparison = null) { $this->namedCriterions[$name] = $this->getCriterionForCondition($p1, $value, $comparison); return $this; }
php
public function addCond($name, $p1, $value = null, $comparison = null) { $this->namedCriterions[$name] = $this->getCriterionForCondition($p1, $value, $comparison); return $this; }
[ "public", "function", "addCond", "(", "$", "name", ",", "$", "p1", ",", "$", "value", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "$", "this", "->", "namedCriterions", "[", "$", "name", "]", "=", "$", "this", "->", "getCriterionForCon...
This method creates a new criterion but keeps it for later use with combine() Until combine() is called, the condition is not added to the query <code> $crit = new Criteria(); $crit->addCond('cond1', $column1, $value1, Criteria::GREATER_THAN); $crit->addCond('cond2', $column2, $value2, Criteria::EQUAL); $crit->combine...
[ "This", "method", "creates", "a", "new", "criterion", "but", "keeps", "it", "for", "later", "use", "with", "combine", "()", "Until", "combine", "()", "is", "called", "the", "condition", "is", "not", "added", "to", "the", "query" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L847-L852
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addJoin
public function addJoin($left, $right, $joinType = null) { if (is_array($left)) { $conditions = []; foreach ($left as $key => $value) { $condition = [$value, $right[$key]]; $conditions[] = $condition; } return $this->addMultipl...
php
public function addJoin($left, $right, $joinType = null) { if (is_array($left)) { $conditions = []; foreach ($left as $key => $value) { $condition = [$value, $right[$key]]; $conditions[] = $condition; } return $this->addMultipl...
[ "public", "function", "addJoin", "(", "$", "left", ",", "$", "right", ",", "$", "joinType", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "left", ")", ")", "{", "$", "conditions", "=", "[", "]", ";", "foreach", "(", "$", "left", "as", ...
This is the way that you should add a join of two tables. Example usage: <code> $c->addJoin(ProjectTableMap::ID, FooTableMap::PROJECT_ID, Criteria::LEFT_JOIN); // LEFT JOIN FOO ON (PROJECT.ID = FOO.PROJECT_ID) </code> @param mixed $left A String with the left side of the join. @param mixed $right A String with ...
[ "This", "is", "the", "way", "that", "you", "should", "add", "a", "join", "of", "two", "tables", ".", "Example", "usage", ":", "<code", ">", "$c", "-", ">", "addJoin", "(", "ProjectTableMap", "::", "ID", "FooTableMap", "::", "PROJECT_ID", "Criteria", "::"...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L903-L939
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addMultipleJoin
public function addMultipleJoin($conditions, $joinType = null) { $join = new Join(); $join->setIdentifierQuoting($this->isIdentifierQuotingEnabled()); $joinCondition = null; foreach ($conditions as $condition) { $left = $condition[0]; $right = $condition[1]; ...
php
public function addMultipleJoin($conditions, $joinType = null) { $join = new Join(); $join->setIdentifierQuoting($this->isIdentifierQuotingEnabled()); $joinCondition = null; foreach ($conditions as $condition) { $left = $condition[0]; $right = $condition[1]; ...
[ "public", "function", "addMultipleJoin", "(", "$", "conditions", ",", "$", "joinType", "=", "null", ")", "{", "$", "join", "=", "new", "Join", "(", ")", ";", "$", "join", "->", "setIdentifierQuoting", "(", "$", "this", "->", "isIdentifierQuotingEnabled", "...
Add a join with multiple conditions @deprecated use Join::setJoinCondition($criterion) instead @see http://propel.phpdb.org/trac/ticket/167, http://propel.phpdb.org/trac/ticket/606 Example usage: $c->addMultipleJoin(array( array(LeftTableMap::LEFT_COLUMN, RightTableMap::RIGHT_COLUMN), // if no third argument, defaul...
[ "Add", "a", "join", "with", "multiple", "conditions", "@deprecated", "use", "Join", "::", "setJoinCondition", "(", "$criterion", ")", "instead" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L961-L1014
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addJoinObject
public function addJoinObject(Join $join) { if (!in_array($join, $this->joins)) { // compare equality, NOT identity $this->joins[] = $join; } return $this; }
php
public function addJoinObject(Join $join) { if (!in_array($join, $this->joins)) { // compare equality, NOT identity $this->joins[] = $join; } return $this; }
[ "public", "function", "addJoinObject", "(", "Join", "$", "join", ")", "{", "if", "(", "!", "in_array", "(", "$", "join", ",", "$", "this", "->", "joins", ")", ")", "{", "// compare equality, NOT identity", "$", "this", "->", "joins", "[", "]", "=", "$"...
Add a join object to the Criteria @param Join $join A join object @return $this|Criteria A modified Criteria object
[ "Add", "a", "join", "object", "to", "the", "Criteria" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1023-L1030
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addSelectQuery
public function addSelectQuery(Criteria $subQueryCriteria, $alias = null) { if (null === $alias) { $alias = 'alias_' . ($subQueryCriteria->forgeSelectQueryAlias() + count($this->selectQueries)); } $this->selectQueries[$alias] = $subQueryCriteria; return $this; }
php
public function addSelectQuery(Criteria $subQueryCriteria, $alias = null) { if (null === $alias) { $alias = 'alias_' . ($subQueryCriteria->forgeSelectQueryAlias() + count($this->selectQueries)); } $this->selectQueries[$alias] = $subQueryCriteria; return $this; }
[ "public", "function", "addSelectQuery", "(", "Criteria", "$", "subQueryCriteria", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "null", "===", "$", "alias", ")", "{", "$", "alias", "=", "'alias_'", ".", "(", "$", "subQueryCriteria", "->", "forgeSe...
Adds a Criteria as subQuery in the From Clause. @param Criteria $subQueryCriteria Criteria to build the subquery from @param string $alias alias for the subQuery @return $this|Criteria this modified Criteria object (Fluid API)
[ "Adds", "a", "Criteria", "as", "subQuery", "in", "the", "From", "Clause", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1071-L1079
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.setAll
public function setAll() { $this->removeSelectModifier(self::DISTINCT); $this->addSelectModifier(self::ALL); return $this; }
php
public function setAll() { $this->removeSelectModifier(self::DISTINCT); $this->addSelectModifier(self::ALL); return $this; }
[ "public", "function", "setAll", "(", ")", "{", "$", "this", "->", "removeSelectModifier", "(", "self", "::", "DISTINCT", ")", ";", "$", "this", "->", "addSelectModifier", "(", "self", "::", "ALL", ")", ";", "return", "$", "this", ";", "}" ]
Adds 'ALL' modifier to the SQL statement. @return $this|Criteria Modified Criteria object (for fluent API)
[ "Adds", "ALL", "modifier", "to", "the", "SQL", "statement", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1137-L1143
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.setDistinct
public function setDistinct() { $this->removeSelectModifier(self::ALL); $this->addSelectModifier(self::DISTINCT); return $this; }
php
public function setDistinct() { $this->removeSelectModifier(self::ALL); $this->addSelectModifier(self::DISTINCT); return $this; }
[ "public", "function", "setDistinct", "(", ")", "{", "$", "this", "->", "removeSelectModifier", "(", "self", "::", "ALL", ")", ";", "$", "this", "->", "addSelectModifier", "(", "self", "::", "DISTINCT", ")", ";", "return", "$", "this", ";", "}" ]
Adds 'DISTINCT' modifier to the SQL statement. @return $this|Criteria Modified Criteria object (for fluent API)
[ "Adds", "DISTINCT", "modifier", "to", "the", "SQL", "statement", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1149-L1155
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.remove
public function remove($key) { if (!isset($this->map[$key])) { return null; } $removed = $this->map[$key]; unset($this->map[$key]); if ($removed instanceof AbstractCriterion) { return $removed->getValue(); } return $removed; }
php
public function remove($key) { if (!isset($this->map[$key])) { return null; } $removed = $this->map[$key]; unset($this->map[$key]); if ($removed instanceof AbstractCriterion) { return $removed->getValue(); } return $removed; }
[ "public", "function", "remove", "(", "$", "key", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "map", "[", "$", "key", "]", ")", ")", "{", "return", "null", ";", "}", "$", "removed", "=", "$", "this", "->", "map", "[", "$", "key"...
Remove an object from the criteria. @param string $key A string with the key to be removed. @return mixed The removed value.
[ "Remove", "an", "object", "from", "the", "criteria", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1481-L1494
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.toString
public function toString() { $sb = 'Criteria:'; try { $params = []; $sb .= "\nSQL (may not be complete): ".$this->createSelectSql($params); $sb .= "\nParams: "; $paramstr = []; foreach ($params as $param) { $paramstr[] = $...
php
public function toString() { $sb = 'Criteria:'; try { $params = []; $sb .= "\nSQL (may not be complete): ".$this->createSelectSql($params); $sb .= "\nParams: "; $paramstr = []; foreach ($params as $param) { $paramstr[] = $...
[ "public", "function", "toString", "(", ")", "{", "$", "sb", "=", "'Criteria:'", ";", "try", "{", "$", "params", "=", "[", "]", ";", "$", "sb", ".=", "\"\\nSQL (may not be complete): \"", ".", "$", "this", "->", "createSelectSql", "(", "$", "params", ")",...
Build a string representation of the Criteria. @return string A String with the representation of the Criteria.
[ "Build", "a", "string", "representation", "of", "the", "Criteria", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1501-L1521
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.equals
public function equals($crit) { if (null === $crit || !($crit instanceof Criteria)) { return false; } /** @var Criteria $crit */ if ($this === $crit) { return true; } if ($this->size() === $crit->size()) { // Important: nested cr...
php
public function equals($crit) { if (null === $crit || !($crit instanceof Criteria)) { return false; } /** @var Criteria $crit */ if ($this === $crit) { return true; } if ($this->size() === $crit->size()) { // Important: nested cr...
[ "public", "function", "equals", "(", "$", "crit", ")", "{", "if", "(", "null", "===", "$", "crit", "||", "!", "(", "$", "crit", "instanceof", "Criteria", ")", ")", "{", "return", "false", ";", "}", "/** @var Criteria $crit */", "if", "(", "$", "this", ...
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/Criteria.php#L1537-L1596
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.mergeWith
public function mergeWith(Criteria $criteria, $operator = null) { // merge limit $limit = $criteria->getLimit(); if (0 != $limit && -1 === $this->getLimit()) { $this->limit = $limit; } // merge offset $offset = $criteria->getOffset(); if (0 != $of...
php
public function mergeWith(Criteria $criteria, $operator = null) { // merge limit $limit = $criteria->getLimit(); if (0 != $limit && -1 === $this->getLimit()) { $this->limit = $limit; } // merge offset $offset = $criteria->getOffset(); if (0 != $of...
[ "public", "function", "mergeWith", "(", "Criteria", "$", "criteria", ",", "$", "operator", "=", "null", ")", "{", "// merge limit", "$", "limit", "=", "$", "criteria", "->", "getLimit", "(", ")", ";", "if", "(", "0", "!=", "$", "limit", "&&", "-", "1...
Add the content of a Criteria to the current Criteria In case of conflict, the current Criteria keeps its properties @param Criteria $criteria The criteria to read properties from @param string $operator The logical operator used to combine conditions Defaults to Criteria::LOGICAL_AND, also accepts Criteria::LOGICAL...
[ "Add", "the", "content", "of", "a", "Criteria", "to", "the", "current", "Criteria", "In", "case", "of", "conflict", "the", "current", "Criteria", "keeps", "its", "properties" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1609-L1685
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addHaving
public function addHaving($p1, $value = null, $comparison = null) { $this->having = $this->getCriterionForCondition($p1, $value, $comparison); return $this; }
php
public function addHaving($p1, $value = null, $comparison = null) { $this->having = $this->getCriterionForCondition($p1, $value, $comparison); return $this; }
[ "public", "function", "addHaving", "(", "$", "p1", ",", "$", "value", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "$", "this", "->", "having", "=", "$", "this", "->", "getCriterionForCondition", "(", "$", "p1", ",", "$", "value", ",",...
This method adds a prepared Criterion object to the Criteria as a having clause. You can get a new, empty Criterion object with the getNewCriterion() method. <p> <code> $crit = new Criteria(); $c = $crit->getNewCriterion(BaseTableMap::ID, 5, Criteria::LESS_THAN); $crit->addHaving($c); </code> @param mixed $p1 ...
[ "This", "method", "adds", "a", "prepared", "Criterion", "object", "to", "the", "Criteria", "as", "a", "having", "clause", ".", "You", "can", "get", "a", "new", "empty", "Criterion", "object", "with", "the", "getNewCriterion", "()", "method", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1705-L1710
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.getCriterionForCondition
protected function getCriterionForCondition($p1, $value = null, $comparison = null) { if ($p1 instanceof AbstractCriterion) { // it's already a Criterion, so ignore $value and $comparison return $p1; } // $comparison is one of Criteria's constants, or a PDO binding t...
php
protected function getCriterionForCondition($p1, $value = null, $comparison = null) { if ($p1 instanceof AbstractCriterion) { // it's already a Criterion, so ignore $value and $comparison return $p1; } // $comparison is one of Criteria's constants, or a PDO binding t...
[ "protected", "function", "getCriterionForCondition", "(", "$", "p1", ",", "$", "value", "=", "null", ",", "$", "comparison", "=", "null", ")", "{", "if", "(", "$", "p1", "instanceof", "AbstractCriterion", ")", "{", "// it's already a Criterion, so ignore $value an...
Build a Criterion. This method has multiple signatures, and behaves differently according to it: - If the first argument is a Criterion, it just returns this Criterion. <code>$c->getCriterionForCondition($criterion); // returns $criterion</code> - If the last argument is a PDO::PARAM_* constant value, create a Crite...
[ "Build", "a", "Criterion", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1733-L1743
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addAnd
public function addAnd($p1, $p2 = null, $p3 = null, $preferColumnCondition = true) { $criterion = $this->getCriterionForCondition($p1, $p2, $p3); $key = $criterion->getTable() . '.' . $criterion->getColumn(); if ($preferColumnCondition && $this->containsKey($key)) { // FIXME: ad...
php
public function addAnd($p1, $p2 = null, $p3 = null, $preferColumnCondition = true) { $criterion = $this->getCriterionForCondition($p1, $p2, $p3); $key = $criterion->getTable() . '.' . $criterion->getColumn(); if ($preferColumnCondition && $this->containsKey($key)) { // FIXME: ad...
[ "public", "function", "addAnd", "(", "$", "p1", ",", "$", "p2", "=", "null", ",", "$", "p3", "=", "null", ",", "$", "preferColumnCondition", "=", "true", ")", "{", "$", "criterion", "=", "$", "this", "->", "getCriterionForCondition", "(", "$", "p1", ...
If a criterion for the requested column already exists, the condition is "AND"ed to the existing criterion (necessary for Propel 1.4 compatibility). If no criterion for the requested column already exists, the condition is "AND"ed to the latest criterion. If no criterion exist, the condition is added a new criterion A...
[ "If", "a", "criterion", "for", "the", "requested", "column", "already", "exists", "the", "condition", "is", "AND", "ed", "to", "the", "existing", "criterion", "(", "necessary", "for", "Propel", "1", ".", "4", "compatibility", ")", ".", "If", "no", "criteri...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1759-L1774
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.addOr
public function addOr($p1, $p2 = null, $p3 = null, $preferColumnCondition = true) { $rightCriterion = $this->getCriterionForCondition($p1, $p2, $p3); $leftCriterion = $this->getLastCriterion(); if (null !== $leftCriterion) { // combine the given criterion with the existing one ...
php
public function addOr($p1, $p2 = null, $p3 = null, $preferColumnCondition = true) { $rightCriterion = $this->getCriterionForCondition($p1, $p2, $p3); $leftCriterion = $this->getLastCriterion(); if (null !== $leftCriterion) { // combine the given criterion with the existing one ...
[ "public", "function", "addOr", "(", "$", "p1", ",", "$", "p2", "=", "null", ",", "$", "p3", "=", "null", ",", "$", "preferColumnCondition", "=", "true", ")", "{", "$", "rightCriterion", "=", "$", "this", "->", "getCriterionForCondition", "(", "$", "p1"...
If a prior criterion exists, the condition is "OR"ed to it. If no criterion exist, the condition is added a new criterion Any comparison can be used. Supports a number of different signatures: - addOr(column, value, comparison) - addOr(column, value) - addOr(Criterion) @param mixed $p1 @param mixed $p2 @param mixed ...
[ "If", "a", "prior", "criterion", "exists", "the", "condition", "is", "OR", "ed", "to", "it", ".", "If", "no", "criterion", "exist", "the", "condition", "is", "added", "a", "new", "criterion" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1793-L1808
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.createSelectSql
public function createSelectSql(&$params) { $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); $fromClause = []; $joinClause = []; $joinTables = []; $whereClause = []; ...
php
public function createSelectSql(&$params) { $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); $fromClause = []; $joinClause = []; $joinTables = []; $whereClause = []; ...
[ "public", "function", "createSelectSql", "(", "&", "$", "params", ")", "{", "$", "adapter", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getAdapter", "(", "$", "this", "->", "getDbName", "(", ")", ")", ";", "$", "dbMap", "=", "Propel", ...
Method to create an SQL query based on values in a Criteria. This method creates only prepared statement SQL (using ? where values will go). The second parameter ($params) stores the values that need to be set before the statement is executed. The reason we do it this way is to let the PDO layer handle all escaping ...
[ "Method", "to", "create", "an", "SQL", "query", "based", "on", "values", "in", "a", "Criteria", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L1847-L2045
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.quoteIdentifier
public function quoteIdentifier($string, $tableName = '') { if ($this->isIdentifierQuotingEnabled()) { $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); return $adapter->quote($string); } //find table name and ask tableMap if quoting is enabl...
php
public function quoteIdentifier($string, $tableName = '') { if ($this->isIdentifierQuotingEnabled()) { $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); return $adapter->quote($string); } //find table name and ask tableMap if quoting is enabl...
[ "public", "function", "quoteIdentifier", "(", "$", "string", ",", "$", "tableName", "=", "''", ")", "{", "if", "(", "$", "this", "->", "isIdentifierQuotingEnabled", "(", ")", ")", "{", "$", "adapter", "=", "Propel", "::", "getServiceContainer", "(", ")", ...
Quotes identifier based on $this->isIdentifierQuotingEnabled() and $tableMap->isIdentifierQuotingEnabled. @param string $string @return string
[ "Quotes", "identifier", "based", "on", "$this", "-", ">", "isIdentifierQuotingEnabled", "()", "and", "$tableMap", "-", ">", "isIdentifierQuotingEnabled", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2065-L2093
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.doInsert
public function doInsert(ConnectionInterface $con = null) { // The primary key $id = null; if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection($this->getDbName()); } $db = Propel::getServiceContainer()->getAdapter($this->getDbName()); ...
php
public function doInsert(ConnectionInterface $con = null) { // The primary key $id = null; if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection($this->getDbName()); } $db = Propel::getServiceContainer()->getAdapter($this->getDbName()); ...
[ "public", "function", "doInsert", "(", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "// The primary key", "$", "id", "=", "null", ";", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(...
Method to perform inserts based on values and keys in a Criteria. <p> If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned. <p> If the primary key is included in Criteria then that value will be used to insert the row. <p> If no primary key is includ...
[ "Method", "to", "perform", "inserts", "based", "on", "values", "and", "keys", "in", "a", "Criteria", ".", "<p", ">", "If", "the", "primary", "key", "is", "auto", "incremented", "the", "data", "in", "Criteria", "will", "be", "inserted", "and", "the", "aut...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2211-L2301
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.doUpdate
public function doUpdate($updateValues, ConnectionInterface $con) { /** @var PdoAdapter $db */ $db = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); // Get list of required tables, containing ...
php
public function doUpdate($updateValues, ConnectionInterface $con) { /** @var PdoAdapter $db */ $db = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); // Get list of required tables, containing ...
[ "public", "function", "doUpdate", "(", "$", "updateValues", ",", "ConnectionInterface", "$", "con", ")", "{", "/** @var PdoAdapter $db */", "$", "db", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getAdapter", "(", "$", "this", "->", "getDbName", ...
Method used to update rows in the DB. Rows are selected based on selectCriteria and updated using values in updateValues. <p> Use this method for performing an update of the kind: <p> WHERE some_column = some value AND could_have_another_column = another value AND so on. @param Criteria $updateValues A Cri...
[ "Method", "used", "to", "update", "rows", "in", "the", "DB", ".", "Rows", "are", "selected", "based", "on", "selectCriteria", "and", "updated", "using", "values", "in", "updateValues", ".", "<p", ">", "Use", "this", "method", "for", "performing", "an", "up...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2347-L2468
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.doDelete
public function doDelete(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection($this->getDbName()); } $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer...
php
public function doDelete(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getWriteConnection($this->getDbName()); } $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName()); $dbMap = Propel::getServiceContainer...
[ "public", "function", "doDelete", "(", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getWriteConnection", "(", "$", "this...
Issue a DELETE query based on the current ModelCriteria This method is called by ModelCriteria::delete() inside a transaction @param ConnectionInterface $con a connection object @return int the number of deleted rows @throws PropelException
[ "Issue", "a", "DELETE", "query", "based", "on", "the", "current", "ModelCriteria", "This", "method", "is", "called", "by", "ModelCriteria", "::", "delete", "()", "inside", "a", "transaction" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2566-L2618
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria.doSelect
public function doSelect(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); } $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); $db = Propel::getServiceContainer()-...
php
public function doSelect(ConnectionInterface $con = null) { if (null === $con) { $con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); } $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName()); $db = Propel::getServiceContainer()-...
[ "public", "function", "doSelect", "(", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "if", "(", "null", "===", "$", "con", ")", "{", "$", "con", "=", "Propel", "::", "getServiceContainer", "(", ")", "->", "getReadConnection", "(", "$", "this"...
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/Criteria.php#L2629-L2652
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria._if
public function _if($cond) { $this->conditionalProxy = new PropelConditionalProxy($this, $cond, $this->conditionalProxy); return $this->conditionalProxy->getCriteriaOrProxy(); }
php
public function _if($cond) { $this->conditionalProxy = new PropelConditionalProxy($this, $cond, $this->conditionalProxy); return $this->conditionalProxy->getCriteriaOrProxy(); }
[ "public", "function", "_if", "(", "$", "cond", ")", "{", "$", "this", "->", "conditionalProxy", "=", "new", "PropelConditionalProxy", "(", "$", "this", ",", "$", "cond", ",", "$", "this", "->", "conditionalProxy", ")", ";", "return", "$", "this", "->", ...
Returns the current object if the condition is true, or a PropelConditionalProxy instance otherwise. Allows for conditional statements in a fluid interface. @param boolean $cond @return PropelConditionalProxy|$this|Criteria
[ "Returns", "the", "current", "object", "if", "the", "condition", "is", "true", "or", "a", "PropelConditionalProxy", "instance", "otherwise", ".", "Allows", "for", "conditional", "statements", "in", "a", "fluid", "interface", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2681-L2686
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria._elseif
public function _elseif($cond) { if (!$this->conditionalProxy) { throw new LogicException(__METHOD__ .' must be called after _if()'); } return $this->conditionalProxy->_elseif($cond); }
php
public function _elseif($cond) { if (!$this->conditionalProxy) { throw new LogicException(__METHOD__ .' must be called after _if()'); } return $this->conditionalProxy->_elseif($cond); }
[ "public", "function", "_elseif", "(", "$", "cond", ")", "{", "if", "(", "!", "$", "this", "->", "conditionalProxy", ")", "{", "throw", "new", "LogicException", "(", "__METHOD__", ".", "' must be called after _if()'", ")", ";", "}", "return", "$", "this", "...
Returns a PropelConditionalProxy instance. Allows for conditional statements in a fluid interface. @param boolean $cond ignored @return PropelConditionalProxy|$this|Criteria
[ "Returns", "a", "PropelConditionalProxy", "instance", ".", "Allows", "for", "conditional", "statements", "in", "a", "fluid", "interface", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2696-L2703
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criteria.php
Criteria._endif
public function _endif() { if (!$this->conditionalProxy) { throw new LogicException(__METHOD__ .' must be called after _if()'); } $this->conditionalProxy = $this->conditionalProxy->getParentProxy(); if ($this->conditionalProxy) { return $this->conditionalPro...
php
public function _endif() { if (!$this->conditionalProxy) { throw new LogicException(__METHOD__ .' must be called after _if()'); } $this->conditionalProxy = $this->conditionalProxy->getParentProxy(); if ($this->conditionalProxy) { return $this->conditionalPro...
[ "public", "function", "_endif", "(", ")", "{", "if", "(", "!", "$", "this", "->", "conditionalProxy", ")", "{", "throw", "new", "LogicException", "(", "__METHOD__", ".", "' must be called after _if()'", ")", ";", "}", "$", "this", "->", "conditionalProxy", "...
Returns the current object Allows for conditional statements in a fluid interface. @return $this|Criteria
[ "Returns", "the", "current", "object", "Allows", "for", "conditional", "statements", "in", "a", "fluid", "interface", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criteria.php#L2726-L2740
propelorm/Propel2
src/Propel/Runtime/Collection/OnDemandIterator.php
OnDemandIterator.next
public function next() { $this->currentRow = $this->dataFetcher->fetch(); $this->currentKey++; $this->isValid = (Boolean) $this->currentRow; if (!$this->isValid) { $this->closeCursor(); } }
php
public function next() { $this->currentRow = $this->dataFetcher->fetch(); $this->currentKey++; $this->isValid = (Boolean) $this->currentRow; if (!$this->isValid) { $this->closeCursor(); } }
[ "public", "function", "next", "(", ")", "{", "$", "this", "->", "currentRow", "=", "$", "this", "->", "dataFetcher", "->", "fetch", "(", ")", ";", "$", "this", "->", "currentKey", "++", ";", "$", "this", "->", "isValid", "=", "(", "Boolean", ")", "...
Advances the cursor in the statement Closes the cursor if the end of the statement is reached
[ "Advances", "the", "cursor", "in", "the", "statement", "Closes", "the", "cursor", "if", "the", "end", "of", "the", "statement", "is", "reached" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/OnDemandIterator.php#L105-L113
propelorm/Propel2
src/Propel/Runtime/Collection/OnDemandIterator.php
OnDemandIterator.rewind
public function rewind() { // check that the hydration can begin if (null === $this->formatter) { throw new PropelException('The On Demand collection requires a formatter. Add it by calling setFormatter()'); } if (null === $this->dataFetcher) { throw new Prope...
php
public function rewind() { // check that the hydration can begin if (null === $this->formatter) { throw new PropelException('The On Demand collection requires a formatter. Add it by calling setFormatter()'); } if (null === $this->dataFetcher) { throw new Prope...
[ "public", "function", "rewind", "(", ")", "{", "// check that the hydration can begin", "if", "(", "null", "===", "$", "this", "->", "formatter", ")", "{", "throw", "new", "PropelException", "(", "'The On Demand collection requires a formatter. Add it by calling setFormatte...
Initializes the iterator by advancing to the first position This method can only be called once (this is a NoRewindIterator)
[ "Initializes", "the", "iterator", "by", "advancing", "to", "the", "first", "position", "This", "method", "can", "only", "be", "called", "once", "(", "this", "is", "a", "NoRewindIterator", ")" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/OnDemandIterator.php#L119-L134
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.setDefaultStringFormat
public function setDefaultStringFormat($format) { $formats = static::getSupportedStringFormats(); $format = strtoupper($format); if (!in_array($format, $formats)) { throw new InvalidArgumentException(sprintf('Given "%s" default string format is not supported. Only "%s" are valid...
php
public function setDefaultStringFormat($format) { $formats = static::getSupportedStringFormats(); $format = strtoupper($format); if (!in_array($format, $formats)) { throw new InvalidArgumentException(sprintf('Given "%s" default string format is not supported. Only "%s" are valid...
[ "public", "function", "setDefaultStringFormat", "(", "$", "format", ")", "{", "$", "formats", "=", "static", "::", "getSupportedStringFormats", "(", ")", ";", "$", "format", "=", "strtoupper", "(", "$", "format", ")", ";", "if", "(", "!", "in_array", "(", ...
Sets the default string format for ActiveRecord objects in this table. This parameter can be overridden at the table level. Any of 'XML', 'YAML', 'JSON', or 'CSV'. @param string $format @throws InvalidArgumentException
[ "Sets", "the", "default", "string", "format", "for", "ActiveRecord", "objects", "in", "this", "table", ".", "This", "parameter", "can", "be", "overridden", "at", "the", "table", "level", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L312-L322
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.countTables
public function countTables() { $count = 0; foreach ($this->tables as $table) { if (!$table->isReadOnly()) { $count++; } } return $count; }
php
public function countTables() { $count = 0; foreach ($this->tables as $table) { if (!$table->isReadOnly()) { $count++; } } return $count; }
[ "public", "function", "countTables", "(", ")", "{", "$", "count", "=", "0", ";", "foreach", "(", "$", "this", "->", "tables", "as", "$", "table", ")", "{", "if", "(", "!", "$", "table", "->", "isReadOnly", "(", ")", ")", "{", "$", "count", "++", ...
Return the number of tables in the database. Read-only tables are excluded from the count. @return integer
[ "Return", "the", "number", "of", "tables", "in", "the", "database", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L386-L396
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.getTablesForSql
public function getTablesForSql() { $tables = []; foreach ($this->tables as $table) { if (!$table->isSkipSql()) { $tables[] = $table; } } return $tables; }
php
public function getTablesForSql() { $tables = []; foreach ($this->tables as $table) { if (!$table->isSkipSql()) { $tables[] = $table; } } return $tables; }
[ "public", "function", "getTablesForSql", "(", ")", "{", "$", "tables", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "tables", "as", "$", "table", ")", "{", "if", "(", "!", "$", "table", "->", "isSkipSql", "(", ")", ")", "{", "$", "table...
Returns the list of all tables that have a SQL representation. @return Table[]
[ "Returns", "the", "list", "of", "all", "tables", "that", "have", "a", "SQL", "representation", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L403-L413
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.hasTable
public function hasTable($name, $caseInsensitive = false) { if ($caseInsensitive) { return isset($this->tablesByLowercaseName[ strtolower($name) ]); } return isset($this->tablesByName[$name]); }
php
public function hasTable($name, $caseInsensitive = false) { if ($caseInsensitive) { return isset($this->tablesByLowercaseName[ strtolower($name) ]); } return isset($this->tablesByName[$name]); }
[ "public", "function", "hasTable", "(", "$", "name", ",", "$", "caseInsensitive", "=", "false", ")", "{", "if", "(", "$", "caseInsensitive", ")", "{", "return", "isset", "(", "$", "this", "->", "tablesByLowercaseName", "[", "strtolower", "(", "$", "name", ...
Returns whether or not the database has a table. @param string $name @param boolean $caseInsensitive @return boolean
[ "Returns", "whether", "or", "not", "the", "database", "has", "a", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L422-L429
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.getTable
public function getTable($name, $caseInsensitive = false) { if ($this->getSchema() && $this->getPlatform()->supportsSchemas() && false === strpos($name, $this->getPlatform()->getSchemaDelimiter())) { $name = $this->getSchema() . $this->getPlatform()->getSchemaDelimiter() . $name; ...
php
public function getTable($name, $caseInsensitive = false) { if ($this->getSchema() && $this->getPlatform()->supportsSchemas() && false === strpos($name, $this->getPlatform()->getSchemaDelimiter())) { $name = $this->getSchema() . $this->getPlatform()->getSchemaDelimiter() . $name; ...
[ "public", "function", "getTable", "(", "$", "name", ",", "$", "caseInsensitive", "=", "false", ")", "{", "if", "(", "$", "this", "->", "getSchema", "(", ")", "&&", "$", "this", "->", "getPlatform", "(", ")", "->", "supportsSchemas", "(", ")", "&&", "...
Returns the table with the specified name. @param string $name @param boolean $caseInsensitive @return Table
[ "Returns", "the", "table", "with", "the", "specified", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L438-L454
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.getTableByPhpName
public function getTableByPhpName($phpName) { if (isset($this->tablesByPhpName[$phpName])) { return $this->tablesByPhpName[$phpName]; } return null; // just to be explicit }
php
public function getTableByPhpName($phpName) { if (isset($this->tablesByPhpName[$phpName])) { return $this->tablesByPhpName[$phpName]; } return null; // just to be explicit }
[ "public", "function", "getTableByPhpName", "(", "$", "phpName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "tablesByPhpName", "[", "$", "phpName", "]", ")", ")", "{", "return", "$", "this", "->", "tablesByPhpName", "[", "$", "phpName", "]", ...
Returns the table object with the specified PHP name. @param string $phpName @return Table
[ "Returns", "the", "table", "object", "with", "the", "specified", "PHP", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L474-L481
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.addTable
public function addTable($table) { if (!$table instanceof Table) { $tbl = new Table(); $tbl->setDatabase($this); $tbl->loadMapping($table); return $this->addTable($tbl); } $table->setDatabase($this); if (isset($this->tablesByName[$ta...
php
public function addTable($table) { if (!$table instanceof Table) { $tbl = new Table(); $tbl->setDatabase($this); $tbl->loadMapping($table); return $this->addTable($tbl); } $table->setDatabase($this); if (isset($this->tablesByName[$ta...
[ "public", "function", "addTable", "(", "$", "table", ")", "{", "if", "(", "!", "$", "table", "instanceof", "Table", ")", "{", "$", "tbl", "=", "new", "Table", "(", ")", ";", "$", "tbl", "->", "setDatabase", "(", "$", "this", ")", ";", "$", "tbl",...
Adds a new table to this database. @param Table|array $table @return Table
[ "Adds", "a", "new", "table", "to", "this", "database", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L489-L517
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.setSchema
public function setSchema($schema) { $oldSchema = $this->schema; if ($this->schema !== $schema && $this->getPlatform()) { $schemaDelimiter = $this->getPlatform()->getSchemaDelimiter(); $fixHash = function (&$array) use ($schema, $oldSchema, $schemaDelimiter) { ...
php
public function setSchema($schema) { $oldSchema = $this->schema; if ($this->schema !== $schema && $this->getPlatform()) { $schemaDelimiter = $this->getPlatform()->getSchemaDelimiter(); $fixHash = function (&$array) use ($schema, $oldSchema, $schemaDelimiter) { ...
[ "public", "function", "setSchema", "(", "$", "schema", ")", "{", "$", "oldSchema", "=", "$", "this", "->", "schema", ";", "if", "(", "$", "this", "->", "schema", "!==", "$", "schema", "&&", "$", "this", "->", "getPlatform", "(", ")", ")", "{", "$",...
Sets the database's schema. @param string $schema
[ "Sets", "the", "database", "s", "schema", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L609-L634
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.computeTableNamespace
private function computeTableNamespace(Table $table) { $namespace = $table->getNamespace(); if ($this->isAbsoluteNamespace($namespace)) { $namespace = ltrim($namespace, '\\'); $table->setNamespace($namespace); return $namespace; } if ($namespace ...
php
private function computeTableNamespace(Table $table) { $namespace = $table->getNamespace(); if ($this->isAbsoluteNamespace($namespace)) { $namespace = ltrim($namespace, '\\'); $table->setNamespace($namespace); return $namespace; } if ($namespace ...
[ "private", "function", "computeTableNamespace", "(", "Table", "$", "table", ")", "{", "$", "namespace", "=", "$", "table", "->", "getNamespace", "(", ")", ";", "if", "(", "$", "this", "->", "isAbsoluteNamespace", "(", "$", "namespace", ")", ")", "{", "$"...
Computes the table namespace based on the current relative or absolute table namespace and the database namespace. @param Table $table @return string
[ "Computes", "the", "table", "namespace", "based", "on", "the", "current", "relative", "or", "absolute", "table", "namespace", "and", "the", "database", "namespace", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L643-L662
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.getDomain
public function getDomain($name) { if (isset($this->domainMap[$name])) { return $this->domainMap[$name]; } return null; }
php
public function getDomain($name) { if (isset($this->domainMap[$name])) { return $this->domainMap[$name]; } return null; }
[ "public", "function", "getDomain", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "domainMap", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "domainMap", "[", "$", "name", "]", ";", "}", "return", "nu...
Returns the already configured domain object by its name. @param string $name @return Domain
[ "Returns", "the", "already", "configured", "domain", "object", "by", "its", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L713-L720
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.getNextTableBehavior
public function getNextTableBehavior() { // order the behaviors according to Behavior::$tableModificationOrder $behaviors = []; $nextBehavior = null; foreach ($this->tables as $table) { foreach ($table->getBehaviors() as $behavior) { if (!$behavior->isTabl...
php
public function getNextTableBehavior() { // order the behaviors according to Behavior::$tableModificationOrder $behaviors = []; $nextBehavior = null; foreach ($this->tables as $table) { foreach ($table->getBehaviors() as $behavior) { if (!$behavior->isTabl...
[ "public", "function", "getNextTableBehavior", "(", ")", "{", "// order the behaviors according to Behavior::$tableModificationOrder", "$", "behaviors", "=", "[", "]", ";", "$", "nextBehavior", "=", "null", ";", "foreach", "(", "$", "this", "->", "tables", "as", "$",...
Returns the next behavior on all tables, ordered by behavior priority, and skipping the ones that were already executed. @return Behavior
[ "Returns", "the", "next", "behavior", "on", "all", "tables", "ordered", "by", "behavior", "priority", "and", "skipping", "the", "ones", "that", "were", "already", "executed", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L775-L793
propelorm/Propel2
src/Propel/Generator/Model/Database.php
Database.doFinalInitialization
public function doFinalInitialization() { // add the referrers for the foreign keys $this->setupTableReferrers(); // execute database behaviors foreach ($this->getBehaviors() as $behavior) { $behavior->modifyDatabase(); } // execute table behaviors (may ...
php
public function doFinalInitialization() { // add the referrers for the foreign keys $this->setupTableReferrers(); // execute database behaviors foreach ($this->getBehaviors() as $behavior) { $behavior->modifyDatabase(); } // execute table behaviors (may ...
[ "public", "function", "doFinalInitialization", "(", ")", "{", "// add the referrers for the foreign keys", "$", "this", "->", "setupTableReferrers", "(", ")", ";", "// execute database behaviors", "foreach", "(", "$", "this", "->", "getBehaviors", "(", ")", "as", "$",...
Finalizes the setup process.
[ "Finalizes", "the", "setup", "process", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Database.php#L799-L821
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.objectMethods
public function objectMethods($builder) { $array = $this->getParameters(); if (empty($array)) { throw new InvalidArgumentException('Please, define your rules for validation.'); } $this->cleanupParameters(); $this->builder = $builder; $this->builder->decla...
php
public function objectMethods($builder) { $array = $this->getParameters(); if (empty($array)) { throw new InvalidArgumentException('Please, define your rules for validation.'); } $this->cleanupParameters(); $this->builder = $builder; $this->builder->decla...
[ "public", "function", "objectMethods", "(", "$", "builder", ")", "{", "$", "array", "=", "$", "this", "->", "getParameters", "(", ")", ";", "if", "(", "empty", "(", "$", "array", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Please, d...
Add behavior methods to model class @return string
[ "Add", "behavior", "methods", "to", "model", "class" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L35-L77
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.getParametersFromColumnName
public function getParametersFromColumnName($columnName = null) { $array = []; if (null !== $columnName) { $this->cleanupParameters(); foreach ($this->getParameters() as $key => $parameter) { if ($parameter['column'] === $columnName) { $arr...
php
public function getParametersFromColumnName($columnName = null) { $array = []; if (null !== $columnName) { $this->cleanupParameters(); foreach ($this->getParameters() as $key => $parameter) { if ($parameter['column'] === $columnName) { $arr...
[ "public", "function", "getParametersFromColumnName", "(", "$", "columnName", "=", "null", ")", "{", "$", "array", "=", "[", "]", ";", "if", "(", "null", "!==", "$", "columnName", ")", "{", "$", "this", "->", "cleanupParameters", "(", ")", ";", "foreach",...
Returns the parameters associated with a given column. Useful for i18n behavior @param string $columnName The column name @return array The array of parameters associated to given column
[ "Returns", "the", "parameters", "associated", "with", "a", "given", "column", ".", "Useful", "for", "i18n", "behavior" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L96-L109
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.removeParametersFromColumnName
public function removeParametersFromColumnName($columnName = null) { if (null !== $columnName) { $newParams = []; $parameters = $this->getParameters(); foreach ($parameters as $key => $parameter) { if ($parameter['column'] != $columnName) { ...
php
public function removeParametersFromColumnName($columnName = null) { if (null !== $columnName) { $newParams = []; $parameters = $this->getParameters(); foreach ($parameters as $key => $parameter) { if ($parameter['column'] != $columnName) { ...
[ "public", "function", "removeParametersFromColumnName", "(", "$", "columnName", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "columnName", ")", "{", "$", "newParams", "=", "[", "]", ";", "$", "parameters", "=", "$", "this", "->", "getParameters", ...
Remove parameters associated with given column. Useful for i18n behavior @param string $columnName The column name
[ "Remove", "parameters", "associated", "with", "given", "column", ".", "Useful", "for", "i18n", "behavior" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L117-L130
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.addRuleOnPk
public function addRuleOnPk() { if (!count($this->getParameters())) { $pk = $this->getTable()->getPrimaryKey(); $parameters = ['auto_rule' => [ 'column' => $pk[0]->getName(), 'validators' => 'Type', 'options' => [ ...
php
public function addRuleOnPk() { if (!count($this->getParameters())) { $pk = $this->getTable()->getPrimaryKey(); $parameters = ['auto_rule' => [ 'column' => $pk[0]->getName(), 'validators' => 'Type', 'options' => [ ...
[ "public", "function", "addRuleOnPk", "(", ")", "{", "if", "(", "!", "count", "(", "$", "this", "->", "getParameters", "(", ")", ")", ")", "{", "$", "pk", "=", "$", "this", "->", "getTable", "(", ")", "->", "getPrimaryKey", "(", ")", ";", "$", "pa...
Add a rule based on primary key type, if there aren't other parameters. Useful when modify table (i18n behavior). If all the rules have been removed, the behavior can't perform validation on related tables. This method introduce a rule to avoid this.
[ "Add", "a", "rule", "based", "on", "primary", "key", "type", "if", "there", "aren", "t", "other", "parameters", ".", "Useful", "when", "modify", "table", "(", "i18n", "behavior", ")", ".", "If", "all", "the", "rules", "have", "been", "removed", "the", ...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L138-L151
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.mergeParameters
public function mergeParameters(array $params = null) { if (null !== $params) { $parameters = $this->getParameters(); $out = []; $i = 1; foreach ($parameters as $key => $parameter) { $out["rule$i"] = $parameter; $i++; ...
php
public function mergeParameters(array $params = null) { if (null !== $params) { $parameters = $this->getParameters(); $out = []; $i = 1; foreach ($parameters as $key => $parameter) { $out["rule$i"] = $parameter; $i++; ...
[ "public", "function", "mergeParameters", "(", "array", "$", "params", "=", "null", ")", "{", "if", "(", "null", "!==", "$", "params", ")", "{", "$", "parameters", "=", "$", "this", "->", "getParameters", "(", ")", ";", "$", "out", "=", "[", "]", ";...
Merge $paramArray array into parameters array. This method avoid that there are rules with the same name, when adding parameters programmatically. Useful for Concrete Inheritance behavior.
[ "Merge", "$paramArray", "array", "into", "parameters", "array", ".", "This", "method", "avoid", "that", "there", "are", "rules", "with", "the", "same", "name", "when", "adding", "parameters", "programmatically", ".", "Useful", "for", "Concrete", "Inheritance", "...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L158-L175
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.cleanupParameters
protected function cleanupParameters() { $parser = new Parser(); $params = $this->getParameters(); foreach ($params as $key => $value) { if (is_string($value)) { $params[$key] = $parser->parse($value); } } $this->setParameters($params);...
php
protected function cleanupParameters() { $parser = new Parser(); $params = $this->getParameters(); foreach ($params as $key => $value) { if (is_string($value)) { $params[$key] = $parser->parse($value); } } $this->setParameters($params);...
[ "protected", "function", "cleanupParameters", "(", ")", "{", "$", "parser", "=", "new", "Parser", "(", ")", ";", "$", "params", "=", "$", "this", "->", "getParameters", "(", ")", ";", "foreach", "(", "$", "params", "as", "$", "key", "=>", "$", "value...
Convert those parameters, containing an array in YAML format into a php array
[ "Convert", "those", "parameters", "containing", "an", "array", "in", "YAML", "format", "into", "a", "php", "array" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L181-L191
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.addLoadValidatorMetadataMethod
protected function addLoadValidatorMetadataMethod() { $params = $this->getParameters(); $constraints = []; foreach ($params as $key => $properties) { if (!isset($properties['column'])) { throw new InvalidArgumentException('Please, define the column to validate.')...
php
protected function addLoadValidatorMetadataMethod() { $params = $this->getParameters(); $constraints = []; foreach ($params as $key => $properties) { if (!isset($properties['column'])) { throw new InvalidArgumentException('Please, define the column to validate.')...
[ "protected", "function", "addLoadValidatorMetadataMethod", "(", ")", "{", "$", "params", "=", "$", "this", "->", "getParameters", "(", ")", ";", "$", "constraints", "=", "[", "]", ";", "foreach", "(", "$", "params", "as", "$", "key", "=>", "$", "properti...
Add loadValidatorMetadata() method @return string
[ "Add", "loadValidatorMetadata", "()", "method" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L198-L238
propelorm/Propel2
src/Propel/Generator/Behavior/Validate/ValidateBehavior.php
ValidateBehavior.addValidateMethod
protected function addValidateMethod() { $table = $this->getTable(); $foreignKeys = $table->getForeignKeys(); $hasForeignKeys = (count($foreignKeys) != 0); $aVarNames = []; $refFkVarNames = []; $collVarNames = []; if ($hasForeignKeys) { foreach ($...
php
protected function addValidateMethod() { $table = $this->getTable(); $foreignKeys = $table->getForeignKeys(); $hasForeignKeys = (count($foreignKeys) != 0); $aVarNames = []; $refFkVarNames = []; $collVarNames = []; if ($hasForeignKeys) { foreach ($...
[ "protected", "function", "addValidateMethod", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "$", "foreignKeys", "=", "$", "table", "->", "getForeignKeys", "(", ")", ";", "$", "hasForeignKeys", "=", "(", "count", "(", "...
Adds the validate() method. @return string The code to be added to model class
[ "Adds", "the", "validate", "()", "method", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Validate/ValidateBehavior.php#L244-L273
propelorm/Propel2
src/Propel/Generator/Command/MigrationUpCommand.php
MigrationUpCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; if ($this->hasInputOption('output-dir', $input)) { $configOptions['propel']['paths']['migrationDir'] = $input->getOption('output-dir'); } if ($this->hasInputOption(...
php
protected function execute(InputInterface $input, OutputInterface $output) { $configOptions = []; if ($this->hasInputOption('output-dir', $input)) { $configOptions['propel']['paths']['migrationDir'] = $input->getOption('output-dir'); } if ($this->hasInputOption(...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "configOptions", "=", "[", "]", ";", "if", "(", "$", "this", "->", "hasInputOption", "(", "'output-dir'", ",", "$", "input", ")",...
{@inheritdoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/MigrationUpCommand.php#L47-L193
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.getConnection
public function getConnection($conparams) { $conparams = $this->prepareParams($conparams); if (!isset($conparams['dsn'])) { throw new InvalidArgumentException('No dsn specified in your connection parameters'); } $dsn = $conparams['dsn']; $user = isset($...
php
public function getConnection($conparams) { $conparams = $this->prepareParams($conparams); if (!isset($conparams['dsn'])) { throw new InvalidArgumentException('No dsn specified in your connection parameters'); } $dsn = $conparams['dsn']; $user = isset($...
[ "public", "function", "getConnection", "(", "$", "conparams", ")", "{", "$", "conparams", "=", "$", "this", "->", "prepareParams", "(", "$", "conparams", ")", ";", "if", "(", "!", "isset", "(", "$", "conparams", "[", "'dsn'", "]", ")", ")", "{", "thr...
Build database connection @param array $conparams connection parameters @return PdoConnection @throws InvalidArgumentException @throws AdapterException
[ "Build", "database", "connection" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L40-L76
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.initConnection
public function initConnection(ConnectionInterface $con, array $settings) { if (isset($settings['charset'])) { $this->setCharset($con, $settings['charset']); } if (isset($settings['queries']) && is_array($settings['queries'])) { foreach ($settings['queries'] as $quer...
php
public function initConnection(ConnectionInterface $con, array $settings) { if (isset($settings['charset'])) { $this->setCharset($con, $settings['charset']); } if (isset($settings['queries']) && is_array($settings['queries'])) { foreach ($settings['queries'] as $quer...
[ "public", "function", "initConnection", "(", "ConnectionInterface", "$", "con", ",", "array", "$", "settings", ")", "{", "if", "(", "isset", "(", "$", "settings", "[", "'charset'", "]", ")", ")", "{", "$", "this", "->", "setCharset", "(", "$", "con", "...
This method is called after a connection was created to run necessary post-initialization queries or code. If a charset was specified, this will be set before any other queries are executed. This base method runs queries specified using the "query" setting. @see setCharset() @param ConnectionInterface $con @param a...
[ "This", "method", "is", "called", "after", "a", "connection", "was", "created", "to", "run", "necessary", "post", "-", "initialization", "queries", "or", "code", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L123-L134
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.quote
public function quote($text) { if (false !== ($pos = strrpos($text, '.'))) { $table = substr($text, 0, $pos); $column = substr($text, $pos + 1); } else { $table = ''; $column = $text; } if ($table) { return $this->quoteIden...
php
public function quote($text) { if (false !== ($pos = strrpos($text, '.'))) { $table = substr($text, 0, $pos); $column = substr($text, $pos + 1); } else { $table = ''; $column = $text; } if ($table) { return $this->quoteIden...
[ "public", "function", "quote", "(", "$", "text", ")", "{", "if", "(", "false", "!==", "(", "$", "pos", "=", "strrpos", "(", "$", "text", ",", "'.'", ")", ")", ")", "{", "$", "table", "=", "substr", "(", "$", "text", ",", "0", ",", "$", "pos",...
Quotes full qualified column names and table names. book.author_id => `book`.`author_id` author_id => `author_id` @param string $text @return string
[ "Quotes", "full", "qualified", "column", "names", "and", "table", "names", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L219-L234
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.formatTemporalValue
public function formatTemporalValue($value, ColumnMap $cMap) { /** @var $dt PropelDateTime */ if ($dt = PropelDateTime::newInstance($value)) { switch ($cMap->getType()) { case PropelTypes::TIMESTAMP: case PropelTypes::BU_TIMESTAMP: $val...
php
public function formatTemporalValue($value, ColumnMap $cMap) { /** @var $dt PropelDateTime */ if ($dt = PropelDateTime::newInstance($value)) { switch ($cMap->getType()) { case PropelTypes::TIMESTAMP: case PropelTypes::BU_TIMESTAMP: $val...
[ "public", "function", "formatTemporalValue", "(", "$", "value", ",", "ColumnMap", "$", "cMap", ")", "{", "/** @var $dt PropelDateTime */", "if", "(", "$", "dt", "=", "PropelDateTime", "::", "newInstance", "(", "$", "value", ")", ")", "{", "switch", "(", "$",...
Formats a temporal value before binding, given a ColumnMap object @param mixed $value The temporal value @param ColumnMap $cMap @return string The formatted temporal value
[ "Formats", "a", "temporal", "value", "before", "binding", "given", "a", "ColumnMap", "object" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L301-L321
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.getDeleteFromClause
public function getDeleteFromClause(Criteria $criteria, $tableName) { $sql = 'DELETE '; if ($queryComment = $criteria->getComment()) { $sql .= '/* ' . $queryComment . ' */ '; } if ($realTableName = $criteria->getTableForAlias($tableName)) { $realTableName = $...
php
public function getDeleteFromClause(Criteria $criteria, $tableName) { $sql = 'DELETE '; if ($queryComment = $criteria->getComment()) { $sql .= '/* ' . $queryComment . ' */ '; } if ($realTableName = $criteria->getTableForAlias($tableName)) { $realTableName = $...
[ "public", "function", "getDeleteFromClause", "(", "Criteria", "$", "criteria", ",", "$", "tableName", ")", "{", "$", "sql", "=", "'DELETE '", ";", "if", "(", "$", "queryComment", "=", "$", "criteria", "->", "getComment", "(", ")", ")", "{", "$", "sql", ...
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query. @param Criteria $criteria @param string $tableName @return string
[ "Returns", "the", "DELETE", "FROM", "<table", ">", "[", "AS", "<alias", ">", "]", "part", "of", "DELETE", "query", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L386-L402
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.getPlainSelectedColumns
public function getPlainSelectedColumns(Criteria $criteria) { $selected = []; foreach ($criteria->getSelectColumns() as $columnName) { if (false === strpos($columnName, '(')) { $selected[] = $columnName; } } foreach ($criteria->getAsColumns() ...
php
public function getPlainSelectedColumns(Criteria $criteria) { $selected = []; foreach ($criteria->getSelectColumns() as $columnName) { if (false === strpos($columnName, '(')) { $selected[] = $columnName; } } foreach ($criteria->getAsColumns() ...
[ "public", "function", "getPlainSelectedColumns", "(", "Criteria", "$", "criteria", ")", "{", "$", "selected", "=", "[", "]", ";", "foreach", "(", "$", "criteria", "->", "getSelectColumns", "(", ")", "as", "$", "columnName", ")", "{", "if", "(", "false", ...
Returns all selected columns that are selected without a aggregate function. @param Criteria $criteria @return string[]
[ "Returns", "all", "selected", "columns", "that", "are", "selected", "without", "a", "aggregate", "function", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L481-L497
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.turnSelectColumnsToAliases
public function turnSelectColumnsToAliases(Criteria $criteria) { $selectColumns = $criteria->getSelectColumns(); // clearSelectColumns also clears the aliases, so get them too $asColumns = $criteria->getAsColumns(); $criteria->clearSelectColumns(); $columnAliases = $asColumns...
php
public function turnSelectColumnsToAliases(Criteria $criteria) { $selectColumns = $criteria->getSelectColumns(); // clearSelectColumns also clears the aliases, so get them too $asColumns = $criteria->getAsColumns(); $criteria->clearSelectColumns(); $columnAliases = $asColumns...
[ "public", "function", "turnSelectColumnsToAliases", "(", "Criteria", "$", "criteria", ")", "{", "$", "selectColumns", "=", "$", "criteria", "->", "getSelectColumns", "(", ")", ";", "// clearSelectColumns also clears the aliases, so get them too", "$", "asColumns", "=", ...
Ensures uniqueness of select column names by turning them all into aliases This is necessary for queries on more than one table when the tables share a column name @see http://propel.phpdb.org/trac/ticket/795 @param Criteria $criteria @return Criteria The input, with Select columns replaced by aliases
[ "Ensures", "uniqueness", "of", "select", "column", "names", "by", "turning", "them", "all", "into", "aliases", "This", "is", "necessary", "for", "queries", "on", "more", "than", "one", "table", "when", "the", "tables", "share", "a", "column", "name" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L508-L536
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.bindValues
public function bindValues(\PDOStatement $stmt, array $params, DatabaseMap $dbMap) { $position = 0; foreach ($params as $param) { $position++; $parameter = ':p' . $position; $value = $param['value']; if (null === $value) { $stmt->bindVa...
php
public function bindValues(\PDOStatement $stmt, array $params, DatabaseMap $dbMap) { $position = 0; foreach ($params as $param) { $position++; $parameter = ':p' . $position; $value = $param['value']; if (null === $value) { $stmt->bindVa...
[ "public", "function", "bindValues", "(", "\\", "PDOStatement", "$", "stmt", ",", "array", "$", "params", ",", "DatabaseMap", "$", "dbMap", ")", "{", "$", "position", "=", "0", ";", "foreach", "(", "$", "params", "as", "$", "param", ")", "{", "$", "po...
Binds values in a prepared statement. This method is designed to work with the Criteria::createSelectSql() method, which creates both the SELECT SQL statement and populates a passed-in array of parameter values that should be substituted. <code> $adapter = Propel::getServiceContainer()->getAdapter($criteria->getDbNam...
[ "Binds", "values", "in", "a", "prepared", "statement", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L558-L578
propelorm/Propel2
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php
PdoAdapter.bindValue
public function bindValue(\PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null) { if ($cMap->isTemporal()) { $value = $this->formatTemporalValue($value, $cMap); } elseif (is_resource($value) && $cMap->isLob()) { // we always need to make sure that the st...
php
public function bindValue(\PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null) { if ($cMap->isTemporal()) { $value = $this->formatTemporalValue($value, $cMap); } elseif (is_resource($value) && $cMap->isLob()) { // we always need to make sure that the st...
[ "public", "function", "bindValue", "(", "\\", "PDOStatement", "$", "stmt", ",", "$", "parameter", ",", "$", "value", ",", "ColumnMap", "$", "cMap", ",", "$", "position", "=", "null", ")", "{", "if", "(", "$", "cMap", "->", "isTemporal", "(", ")", ")"...
Binds a value to a positioned parameter in a statement, given a ColumnMap object to infer the binding type. @param \PDOStatement $stmt The statement to bind @param string $parameter Parameter identifier @param mixed $value The value to bind @param ColumnMap $cMap The ColumnMap of the c...
[ "Binds", "a", "value", "to", "a", "positioned", "parameter", "in", "a", "statement", "given", "a", "ColumnMap", "object", "to", "infer", "the", "binding", "type", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php#L592-L603
propelorm/Propel2
src/Propel/Runtime/ActiveQuery/Criterion/BasicCriterion.php
BasicCriterion.appendPsForUniqueClauseTo
protected function appendPsForUniqueClauseTo(&$sb, array &$params) { $field = (null === $this->table) ? $this->column : $this->table . '.' . $this->column; // NULL VALUES need special treatment because the SQL syntax is different // i.e. table.column IS NULL rather than table.column = null ...
php
protected function appendPsForUniqueClauseTo(&$sb, array &$params) { $field = (null === $this->table) ? $this->column : $this->table . '.' . $this->column; // NULL VALUES need special treatment because the SQL syntax is different // i.e. table.column IS NULL rather than table.column = null ...
[ "protected", "function", "appendPsForUniqueClauseTo", "(", "&", "$", "sb", ",", "array", "&", "$", "params", ")", "{", "$", "field", "=", "(", "null", "===", "$", "this", "->", "table", ")", "?", "$", "this", "->", "column", ":", "$", "this", "->", ...
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/BasicCriterion.php#L67-L103
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getStdSeparatedName
private function getStdSeparatedName() { if ($this->schema && $this->getBuildProperty('generator.schema.autoPrefix')) { return $this->schema . NameGeneratorInterface::STD_SEPARATOR_CHAR . $this->getCommonName(); } return $this->getCommonName(); }
php
private function getStdSeparatedName() { if ($this->schema && $this->getBuildProperty('generator.schema.autoPrefix')) { return $this->schema . NameGeneratorInterface::STD_SEPARATOR_CHAR . $this->getCommonName(); } return $this->getCommonName(); }
[ "private", "function", "getStdSeparatedName", "(", ")", "{", "if", "(", "$", "this", "->", "schema", "&&", "$", "this", "->", "getBuildProperty", "(", "'generator.schema.autoPrefix'", ")", ")", "{", "return", "$", "this", "->", "schema", ".", "NameGeneratorInt...
Returns a qualified name of this table with scheme and common name separated by '_'. If autoPrefix is set. Otherwise get the common name. @return string
[ "Returns", "a", "qualified", "name", "of", "this", "table", "with", "scheme", "and", "common", "name", "separated", "by", "_", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L172-L179
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.applyBehaviors
public function applyBehaviors() { foreach ($this->behaviors as $behavior) { if (!$behavior->isTableModified()) { $behavior->getTableModifier()->modifyTable(); $behavior->setTableModified(true); } } }
php
public function applyBehaviors() { foreach ($this->behaviors as $behavior) { if (!$behavior->isTableModified()) { $behavior->getTableModifier()->modifyTable(); $behavior->setTableModified(true); } } }
[ "public", "function", "applyBehaviors", "(", ")", "{", "foreach", "(", "$", "this", "->", "behaviors", "as", "$", "behavior", ")", "{", "if", "(", "!", "$", "behavior", "->", "isTableModified", "(", ")", ")", "{", "$", "behavior", "->", "getTableModifier...
Executes behavior table modifiers.
[ "Executes", "behavior", "table", "modifiers", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L245-L253
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.doFinalInitialization
public function doFinalInitialization() { // Heavy indexing must wait until after all columns composing // a table's primary key have been parsed. if ($this->heavyIndexing) { $this->doHeavyIndexing(); } // if idMethod is "native" and in fact there are no autoIncr...
php
public function doFinalInitialization() { // Heavy indexing must wait until after all columns composing // a table's primary key have been parsed. if ($this->heavyIndexing) { $this->doHeavyIndexing(); } // if idMethod is "native" and in fact there are no autoIncr...
[ "public", "function", "doFinalInitialization", "(", ")", "{", "// Heavy indexing must wait until after all columns composing", "// a table's primary key have been parsed.", "if", "(", "$", "this", "->", "heavyIndexing", ")", "{", "$", "this", "->", "doHeavyIndexing", "(", "...
<p>A hook for the SAX XML parser to call when this table has been fully loaded from the XML, and all nested elements have been processed.</p> <p>Performs heavy indexing and naming of elements which weren't provided with a name.</p>
[ "<p", ">", "A", "hook", "for", "the", "SAX", "XML", "parser", "to", "call", "when", "this", "table", "has", "been", "fully", "loaded", "from", "the", "XML", "and", "all", "nested", "elements", "have", "been", "processed", ".", "<", "/", "p", ">" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L268-L287
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.doHeavyIndexing
private function doHeavyIndexing() { $pk = $this->getPrimaryKey(); $size = count($pk); // We start at an offset of 1 because the entire column // list is generally implicitly indexed by the fact that // it's a primary key. for ($i = 1; $i < $size; $i++) { ...
php
private function doHeavyIndexing() { $pk = $this->getPrimaryKey(); $size = count($pk); // We start at an offset of 1 because the entire column // list is generally implicitly indexed by the fact that // it's a primary key. for ($i = 1; $i < $size; $i++) { ...
[ "private", "function", "doHeavyIndexing", "(", ")", "{", "$", "pk", "=", "$", "this", "->", "getPrimaryKey", "(", ")", ";", "$", "size", "=", "count", "(", "$", "pk", ")", ";", "// We start at an offset of 1 because the entire column", "// list is generally implic...
Adds extra indices for multi-part primary key columns. For databases like MySQL, values in a where clause much match key part order from the left to right. So, in the key definition <code>PRIMARY KEY (FOO_ID, BAR_ID)</code>, <code>FOO_ID</code> <i>must</i> be the first element used in the <code>where</code> clause of ...
[ "Adds", "extra", "indices", "for", "multi", "-", "part", "primary", "key", "columns", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L306-L319
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addExtraIndices
public function addExtraIndices() { /** * A collection of indexed columns. The keys is the column name * (concatenated with a comma in the case of multi-col index), the value is * an array with the names of the indexes that index these columns. We use * it to determine wh...
php
public function addExtraIndices() { /** * A collection of indexed columns. The keys is the column name * (concatenated with a comma in the case of multi-col index), the value is * an array with the names of the indexes that index these columns. We use * it to determine wh...
[ "public", "function", "addExtraIndices", "(", ")", "{", "/**\n * A collection of indexed columns. The keys is the column name\n * (concatenated with a comma in the case of multi-col index), the value is\n * an array with the names of the indexes that index these columns. We use\n...
Adds extra indices for reverse foreign keys This is required for MySQL databases, and is called from Database::doFinalInitialization()
[ "Adds", "extra", "indices", "for", "reverse", "foreign", "keys", "This", "is", "required", "for", "MySQL", "databases", "and", "is", "called", "from", "Database", "::", "doFinalInitialization", "()" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L326-L394
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.createIndex
protected function createIndex($name, array $columns) { $index = new Index($name); $index->setColumns($columns); $index->resetColumnsSize(); $this->addIndex($index); return $index; }
php
protected function createIndex($name, array $columns) { $index = new Index($name); $index->setColumns($columns); $index->resetColumnsSize(); $this->addIndex($index); return $index; }
[ "protected", "function", "createIndex", "(", "$", "name", ",", "array", "$", "columns", ")", "{", "$", "index", "=", "new", "Index", "(", "$", "name", ")", ";", "$", "index", "->", "setColumns", "(", "$", "columns", ")", ";", "$", "index", "->", "r...
Creates a new index. @param string $name The index name @param array $columns The list of columns to index @return Index $index The created index
[ "Creates", "a", "new", "index", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L403-L412
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getBaseClass
public function getBaseClass() { if ($this->isAlias() && null === $this->baseClass) { return $this->alias; } if (null === $this->baseClass) { return $this->database->getBaseClass(); } return $this->baseClass; }
php
public function getBaseClass() { if ($this->isAlias() && null === $this->baseClass) { return $this->alias; } if (null === $this->baseClass) { return $this->database->getBaseClass(); } return $this->baseClass; }
[ "public", "function", "getBaseClass", "(", ")", "{", "if", "(", "$", "this", "->", "isAlias", "(", ")", "&&", "null", "===", "$", "this", "->", "baseClass", ")", "{", "return", "$", "this", "->", "alias", ";", "}", "if", "(", "null", "===", "$", ...
Returns the name of the base class used for superclass of all objects of this table. @return string
[ "Returns", "the", "name", "of", "the", "base", "class", "used", "for", "superclass", "of", "all", "objects", "of", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L468-L479
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addColumn
public function addColumn($col) { if ($col instanceof Column) { if (isset($this->columnsByName[$col->getName()])) { throw new EngineException(sprintf('Column "%s" declared twice in table "%s"', $col->getName(), $this->getName())); } $col->setTable($this)...
php
public function addColumn($col) { if ($col instanceof Column) { if (isset($this->columnsByName[$col->getName()])) { throw new EngineException(sprintf('Column "%s" declared twice in table "%s"', $col->getName(), $this->getName())); } $col->setTable($this)...
[ "public", "function", "addColumn", "(", "$", "col", ")", "{", "if", "(", "$", "col", "instanceof", "Column", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "columnsByName", "[", "$", "col", "->", "getName", "(", ")", "]", ")", ")", "{", "t...
Adds a new column to the table. @param Column|array $col @throws EngineException @return Column
[ "Adds", "a", "new", "column", "to", "the", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L523-L555
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.removeColumn
public function removeColumn($column) { if (is_string($column)) { $column = $this->getColumn($column); } $pos = $this->getColumnPosition($column); if (false === $pos) { throw new EngineException(sprintf('No column named %s found in table %s.', $column->getNam...
php
public function removeColumn($column) { if (is_string($column)) { $column = $this->getColumn($column); } $pos = $this->getColumnPosition($column); if (false === $pos) { throw new EngineException(sprintf('No column named %s found in table %s.', $column->getNam...
[ "public", "function", "removeColumn", "(", "$", "column", ")", "{", "if", "(", "is_string", "(", "$", "column", ")", ")", "{", "$", "column", "=", "$", "this", "->", "getColumn", "(", "$", "column", ")", ";", "}", "$", "pos", "=", "$", "this", "-...
Removes a column from the table. @param Column|string $column The Column or its name @throws EngineException
[ "Removes", "a", "column", "from", "the", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L575-L594
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addForeignKey
public function addForeignKey($foreignKey) { if ($foreignKey instanceof ForeignKey) { $fk = $foreignKey; $fk->setTable($this); $name = $fk->getPhpName() ?: $fk->getName(); if (isset($this->foreignKeysByName[$name])) { throw new EngineException...
php
public function addForeignKey($foreignKey) { if ($foreignKey instanceof ForeignKey) { $fk = $foreignKey; $fk->setTable($this); $name = $fk->getPhpName() ?: $fk->getName(); if (isset($this->foreignKeysByName[$name])) { throw new EngineException...
[ "public", "function", "addForeignKey", "(", "$", "foreignKey", ")", "{", "if", "(", "$", "foreignKey", "instanceof", "ForeignKey", ")", "{", "$", "fk", "=", "$", "foreignKey", ";", "$", "fk", "->", "setTable", "(", "$", "this", ")", ";", "$", "name", ...
Adds a new foreign key to this table. @param ForeignKey|array $foreignKey The foreign key mapping @return ForeignKey
[ "Adds", "a", "new", "foreign", "key", "to", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L624-L650
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getChildrenNames
public function getChildrenNames() { if (null === $this->inheritanceColumn || !$this->inheritanceColumn->isEnumeratedClasses()) { return null; } $names = []; foreach ($this->inheritanceColumn->getChildren() as $child) { $names[] = get_class($child...
php
public function getChildrenNames() { if (null === $this->inheritanceColumn || !$this->inheritanceColumn->isEnumeratedClasses()) { return null; } $names = []; foreach ($this->inheritanceColumn->getChildren() as $child) { $names[] = get_class($child...
[ "public", "function", "getChildrenNames", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "inheritanceColumn", "||", "!", "$", "this", "->", "inheritanceColumn", "->", "isEnumeratedClasses", "(", ")", ")", "{", "return", "null", ";", "}", "$", ...
Returns the subclasses that can be created from this table. @return array
[ "Returns", "the", "subclasses", "that", "can", "be", "created", "from", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L680-L693
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.setupReferrers
public function setupReferrers($throwErrors = false) { foreach ($this->foreignKeys as $foreignKey) { // table referrers $foreignTable = $this->database->getTable($foreignKey->getForeignTableName()); if (null !== $foreignTable) { $referrers = $foreignTabl...
php
public function setupReferrers($throwErrors = false) { foreach ($this->foreignKeys as $foreignKey) { // table referrers $foreignTable = $this->database->getTable($foreignKey->getForeignTableName()); if (null !== $foreignTable) { $referrers = $foreignTabl...
[ "public", "function", "setupReferrers", "(", "$", "throwErrors", "=", "false", ")", "{", "foreach", "(", "$", "this", "->", "foreignKeys", "as", "$", "foreignKey", ")", "{", "// table referrers", "$", "foreignTable", "=", "$", "this", "->", "database", "->",...
Browses the foreign keys and creates referrers for the foreign table. This method can be called several times on the same table. It only adds the missing referrers and is non-destructive. Warning: only use when all the tables were created. @param boolean $throwErrors @throws BuildException
[ "Browses", "the", "foreign", "keys", "and", "creates", "referrers", "for", "the", "foreign", "table", ".", "This", "method", "can", "be", "called", "several", "times", "on", "the", "same", "table", ".", "It", "only", "adds", "the", "missing", "referrers", ...
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L724-L810
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getCrossFks
public function getCrossFks() { $crossFks = []; foreach ($this->referrers as $refFK) { if ($refFK->getTable()->isCrossRef()) { $crossFK = new CrossForeignKeys($refFK, $this); foreach ($refFK->getOtherFks() as $fk) { if ($fk->isAtLeastOn...
php
public function getCrossFks() { $crossFks = []; foreach ($this->referrers as $refFK) { if ($refFK->getTable()->isCrossRef()) { $crossFK = new CrossForeignKeys($refFK, $this); foreach ($refFK->getOtherFks() as $fk) { if ($fk->isAtLeastOn...
[ "public", "function", "getCrossFks", "(", ")", "{", "$", "crossFks", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "referrers", "as", "$", "refFK", ")", "{", "if", "(", "$", "refFK", "->", "getTable", "(", ")", "->", "isCrossRef", "(", ")"...
Returns the list of cross foreign keys. @return CrossForeignKeys[]
[ "Returns", "the", "list", "of", "cross", "foreign", "keys", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L817-L836
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getOtherRequiredPrimaryKeys
public function getOtherRequiredPrimaryKeys(array $primaryKeys) { $pks = []; foreach ($this->getPrimaryKey() as $primaryKey) { if ($primaryKey->isNotNull() && !$primaryKey->hasDefaultValue() && !in_array($primaryKey, $primaryKeys, true)) { $pks = $primaryKey; ...
php
public function getOtherRequiredPrimaryKeys(array $primaryKeys) { $pks = []; foreach ($this->getPrimaryKey() as $primaryKey) { if ($primaryKey->isNotNull() && !$primaryKey->hasDefaultValue() && !in_array($primaryKey, $primaryKeys, true)) { $pks = $primaryKey; ...
[ "public", "function", "getOtherRequiredPrimaryKeys", "(", "array", "$", "primaryKeys", ")", "{", "$", "pks", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getPrimaryKey", "(", ")", "as", "$", "primaryKey", ")", "{", "if", "(", "$", "primaryKey"...
Returns all required(notNull && no defaultValue) primary keys which are not in $primaryKeys. @param Column[] $primaryKeys @return Column[]
[ "Returns", "all", "required", "(", "notNull", "&&", "no", "defaultValue", ")", "primary", "keys", "which", "are", "not", "in", "$primaryKeys", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L844-L854
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addIdMethodParameter
public function addIdMethodParameter($idMethodParameter) { if ($idMethodParameter instanceof IdMethodParameter) { $idMethodParameter->setTable($this); $this->idMethodParameters[] = $idMethodParameter; return $idMethodParameter; } $imp = new IdMethodParam...
php
public function addIdMethodParameter($idMethodParameter) { if ($idMethodParameter instanceof IdMethodParameter) { $idMethodParameter->setTable($this); $this->idMethodParameters[] = $idMethodParameter; return $idMethodParameter; } $imp = new IdMethodParam...
[ "public", "function", "addIdMethodParameter", "(", "$", "idMethodParameter", ")", "{", "if", "(", "$", "idMethodParameter", "instanceof", "IdMethodParameter", ")", "{", "$", "idMethodParameter", "->", "setTable", "(", "$", "this", ")", ";", "$", "this", "->", ...
Adds a new parameter for the strategy that generates primary keys. @param IdMethodParameter|array $idMethodParameter @return IdMethodParameter
[ "Adds", "a", "new", "parameter", "for", "the", "strategy", "that", "generates", "primary", "keys", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L903-L917
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.hasIndex
public function hasIndex($name) { foreach ($this->indices as $idx) { if ($idx->getName() == $name) { return true; } } return false; }
php
public function hasIndex($name) { foreach ($this->indices as $idx) { if ($idx->getName() == $name) { return true; } } return false; }
[ "public", "function", "hasIndex", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "indices", "as", "$", "idx", ")", "{", "if", "(", "$", "idx", "->", "getName", "(", ")", "==", "$", "name", ")", "{", "return", "true", ";", "}", "...
Checks if the table has a index by name. @param string $name @return boolean
[ "Checks", "if", "the", "table", "has", "a", "index", "by", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L942-L951
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addIndex
public function addIndex($index) { if ($index instanceof Index) { if ($this->hasIndex($index->getName())) { throw new InvalidArgumentException(sprintf('Index "%s" already exist.', $index->getName())); } if (!$index->getColumns()) { throw ne...
php
public function addIndex($index) { if ($index instanceof Index) { if ($this->hasIndex($index->getName())) { throw new InvalidArgumentException(sprintf('Index "%s" already exist.', $index->getName())); } if (!$index->getColumns()) { throw ne...
[ "public", "function", "addIndex", "(", "$", "index", ")", "{", "if", "(", "$", "index", "instanceof", "Index", ")", "{", "if", "(", "$", "this", "->", "hasIndex", "(", "$", "index", "->", "getName", "(", ")", ")", ")", "{", "throw", "new", "Invalid...
Adds a new index to the indices list and set the parent table of the column to the current table. @param Index|array $index @return Index @throw InvalidArgumentException
[ "Adds", "a", "new", "index", "to", "the", "indices", "list", "and", "set", "the", "parent", "table", "of", "the", "column", "to", "the", "current", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L962-L985
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.addUnique
public function addUnique($unique) { if ($unique instanceof Unique) { $unique->setTable($this); $unique->getName(); // we call this method so that the name is created now if it doesn't already exist. $this->unices[] = $unique; return $unique; } ...
php
public function addUnique($unique) { if ($unique instanceof Unique) { $unique->setTable($this); $unique->getName(); // we call this method so that the name is created now if it doesn't already exist. $this->unices[] = $unique; return $unique; } ...
[ "public", "function", "addUnique", "(", "$", "unique", ")", "{", "if", "(", "$", "unique", "instanceof", "Unique", ")", "{", "$", "unique", "->", "setTable", "(", "$", "this", ")", ";", "$", "unique", "->", "getName", "(", ")", ";", "// we call this me...
Adds a new Unique index to the list of unique indices and set the parent table of the column to the current table. @param Unique|array $unique @return Unique
[ "Adds", "a", "new", "Unique", "index", "to", "the", "list", "of", "unique", "indices", "and", "set", "the", "parent", "table", "of", "the", "column", "to", "the", "current", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L994-L1008
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getAdditionalBuilders
public function getAdditionalBuilders() { $additionalBuilders = []; foreach ($this->behaviors as $behavior) { $additionalBuilders = array_merge($additionalBuilders, $behavior->getAdditionalBuilders()); } return $additionalBuilders; }
php
public function getAdditionalBuilders() { $additionalBuilders = []; foreach ($this->behaviors as $behavior) { $additionalBuilders = array_merge($additionalBuilders, $behavior->getAdditionalBuilders()); } return $additionalBuilders; }
[ "public", "function", "getAdditionalBuilders", "(", ")", "{", "$", "additionalBuilders", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "behaviors", "as", "$", "behavior", ")", "{", "$", "additionalBuilders", "=", "array_merge", "(", "$", "additional...
Returns the list of additional builders provided by the table behaviors. @return array
[ "Returns", "the", "list", "of", "additional", "builders", "provided", "by", "the", "table", "behaviors", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1057-L1065
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getName
public function getName() { $tableName = ''; if ($this->hasSchema()) { $tableName = $this->guessSchemaName() . $this->database->getSchemaDelimiter(); } $tableName .= $this->commonName; return $tableName; }
php
public function getName() { $tableName = ''; if ($this->hasSchema()) { $tableName = $this->guessSchemaName() . $this->database->getSchemaDelimiter(); } $tableName .= $this->commonName; return $tableName; }
[ "public", "function", "getName", "(", ")", "{", "$", "tableName", "=", "''", ";", "if", "(", "$", "this", "->", "hasSchema", "(", ")", ")", "{", "$", "tableName", "=", "$", "this", "->", "guessSchemaName", "(", ")", ".", "$", "this", "->", "databas...
Returns the full table name (including schema name when possible). @return string
[ "Returns", "the", "full", "table", "name", "(", "including", "schema", "name", "when", "possible", ")", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1072-L1082
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.hasSchema
private function hasSchema() { return $this->database && ($this->schema ?: $this->database->getSchema()) && ($platform = $this->getPlatform()) && $platform->supportsSchemas() ; }
php
private function hasSchema() { return $this->database && ($this->schema ?: $this->database->getSchema()) && ($platform = $this->getPlatform()) && $platform->supportsSchemas() ; }
[ "private", "function", "hasSchema", "(", ")", "{", "return", "$", "this", "->", "database", "&&", "(", "$", "this", "->", "schema", "?", ":", "$", "this", "->", "database", "->", "getSchema", "(", ")", ")", "&&", "(", "$", "platform", "=", "$", "th...
Returns whether or not this table is linked to a schema. @return boolean
[ "Returns", "whether", "or", "not", "this", "table", "is", "linked", "to", "a", "schema", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1099-L1106
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getPhpName
public function getPhpName() { if (null === $this->phpName) { $this->phpName = $this->buildPhpName($this->getStdSeparatedName()); } return $this->phpName; }
php
public function getPhpName() { if (null === $this->phpName) { $this->phpName = $this->buildPhpName($this->getStdSeparatedName()); } return $this->phpName; }
[ "public", "function", "getPhpName", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "phpName", ")", "{", "$", "this", "->", "phpName", "=", "$", "this", "->", "buildPhpName", "(", "$", "this", "->", "getStdSeparatedName", "(", ")", ")", "...
Returns the name to use in PHP sources. @return string @throws EngineException
[ "Returns", "the", "name", "to", "use", "in", "PHP", "sources", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1144-L1151
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getNumLazyLoadColumns
public function getNumLazyLoadColumns() { $count = 0; foreach ($this->columns as $col) { if ($col->isLazyLoad()) { $count++; } } return $count; }
php
public function getNumLazyLoadColumns() { $count = 0; foreach ($this->columns as $col) { if ($col->isLazyLoad()) { $count++; } } return $count; }
[ "public", "function", "getNumLazyLoadColumns", "(", ")", "{", "$", "count", "=", "0", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "col", ")", "{", "if", "(", "$", "col", "->", "isLazyLoad", "(", ")", ")", "{", "$", "count", "++", ...
Returns the number of lazy loaded columns in this table. @return integer
[ "Returns", "the", "number", "of", "lazy", "loaded", "columns", "in", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1469-L1479
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.isUnique
public function isUnique(array $keys) { if (1 === count($keys)) { $column = $keys[0] instanceof Column ? $keys[0] : $this->getColumn($keys[0]); if ($column) { if ($column->isUnique()) { return true; } if ($column->i...
php
public function isUnique(array $keys) { if (1 === count($keys)) { $column = $keys[0] instanceof Column ? $keys[0] : $this->getColumn($keys[0]); if ($column) { if ($column->isUnique()) { return true; } if ($column->i...
[ "public", "function", "isUnique", "(", "array", "$", "keys", ")", "{", "if", "(", "1", "===", "count", "(", "$", "keys", ")", ")", "{", "$", "column", "=", "$", "keys", "[", "0", "]", "instanceof", "Column", "?", "$", "keys", "[", "0", "]", ":"...
Checks if $keys are a unique constraint in the table. (through primaryKey, through a regular unices constraints or for single keys when it has isUnique=true) @param Column[]|string[] $keys @return boolean
[ "Checks", "if", "$keys", "are", "a", "unique", "constraint", "in", "the", "table", ".", "(", "through", "primaryKey", "through", "a", "regular", "unices", "constraints", "or", "for", "single", "keys", "when", "it", "has", "isUnique", "=", "true", ")" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1545-L1604
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.isIndex
public function isIndex(array $keys) { if ($this->indices) { foreach ($this->indices as $index) { if (count($keys) === count($index->getColumns())) { $allAvailable = true; foreach ($keys as $key) { if (!$index->hasCo...
php
public function isIndex(array $keys) { if ($this->indices) { foreach ($this->indices as $index) { if (count($keys) === count($index->getColumns())) { $allAvailable = true; foreach ($keys as $key) { if (!$index->hasCo...
[ "public", "function", "isIndex", "(", "array", "$", "keys", ")", "{", "if", "(", "$", "this", "->", "indices", ")", "{", "foreach", "(", "$", "this", "->", "indices", "as", "$", "index", ")", "{", "if", "(", "count", "(", "$", "keys", ")", "===",...
Checks if a index exists with the given $keys. @param array $keys @return boolean
[ "Checks", "if", "a", "index", "exists", "with", "the", "given", "$keys", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1612-L1632
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.hasColumn
public function hasColumn($column, $caseInsensitive = false) { if ($column instanceof Column) { $column = $column->getName(); } if ($caseInsensitive) { return isset($this->columnsByLowercaseName[strtolower($column)]); } return isset($this->columnsByN...
php
public function hasColumn($column, $caseInsensitive = false) { if ($column instanceof Column) { $column = $column->getName(); } if ($caseInsensitive) { return isset($this->columnsByLowercaseName[strtolower($column)]); } return isset($this->columnsByN...
[ "public", "function", "hasColumn", "(", "$", "column", ",", "$", "caseInsensitive", "=", "false", ")", "{", "if", "(", "$", "column", "instanceof", "Column", ")", "{", "$", "column", "=", "$", "column", "->", "getName", "(", ")", ";", "}", "if", "(",...
Returns whether or not the table has a column. @param Column|string $column The Column object or its name @param boolean $caseInsensitive Whether the check is case insensitive. @return boolean
[ "Returns", "whether", "or", "not", "the", "table", "has", "a", "column", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1641-L1652
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getColumn
public function getColumn($name, $caseInsensitive = false) { if (!$this->hasColumn($name, $caseInsensitive)) { return null; // just to be explicit } if ($caseInsensitive) { return $this->columnsByLowercaseName[strtolower($name)]; } return $this->colu...
php
public function getColumn($name, $caseInsensitive = false) { if (!$this->hasColumn($name, $caseInsensitive)) { return null; // just to be explicit } if ($caseInsensitive) { return $this->columnsByLowercaseName[strtolower($name)]; } return $this->colu...
[ "public", "function", "getColumn", "(", "$", "name", ",", "$", "caseInsensitive", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "hasColumn", "(", "$", "name", ",", "$", "caseInsensitive", ")", ")", "{", "return", "null", ";", "// just to b...
Returns the Column object with the specified name. @param string $name The name of the column (e.g. 'my_column') @param boolean $caseInsensitive Whether the check is case insensitive. @return Column
[ "Returns", "the", "Column", "object", "with", "the", "specified", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1661-L1672
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getColumnByPhpName
public function getColumnByPhpName($phpName) { if (isset($this->columnsByPhpName[$phpName])) { return $this->columnsByPhpName[$phpName]; } return null; }
php
public function getColumnByPhpName($phpName) { if (isset($this->columnsByPhpName[$phpName])) { return $this->columnsByPhpName[$phpName]; } return null; }
[ "public", "function", "getColumnByPhpName", "(", "$", "phpName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "columnsByPhpName", "[", "$", "phpName", "]", ")", ")", "{", "return", "$", "this", "->", "columnsByPhpName", "[", "$", "phpName", "]",...
Returns a specified column by its php name. @param string $phpName @return Column
[ "Returns", "a", "specified", "column", "by", "its", "php", "name", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1680-L1687
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getForeignKeysReferencingTable
public function getForeignKeysReferencingTable($tableName) { $matches = []; foreach ($this->foreignKeys as $fk) { if ($fk->getForeignTableName() === $tableName) { $matches[] = $fk; } } return $matches; }
php
public function getForeignKeysReferencingTable($tableName) { $matches = []; foreach ($this->foreignKeys as $fk) { if ($fk->getForeignTableName() === $tableName) { $matches[] = $fk; } } return $matches; }
[ "public", "function", "getForeignKeysReferencingTable", "(", "$", "tableName", ")", "{", "$", "matches", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "foreignKeys", "as", "$", "fk", ")", "{", "if", "(", "$", "fk", "->", "getForeignTableName", "...
Returns all foreign keys from this table that reference the table passed in argument. @param string $tableName @return array
[ "Returns", "all", "foreign", "keys", "from", "this", "table", "that", "reference", "the", "table", "passed", "in", "argument", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1696-L1706
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getColumnForeignKeys
public function getColumnForeignKeys($column) { $matches = []; foreach ($this->foreignKeys as $fk) { if (in_array($column, $fk->getLocalColumns())) { $matches[] = $fk; } } return $matches; }
php
public function getColumnForeignKeys($column) { $matches = []; foreach ($this->foreignKeys as $fk) { if (in_array($column, $fk->getLocalColumns())) { $matches[] = $fk; } } return $matches; }
[ "public", "function", "getColumnForeignKeys", "(", "$", "column", ")", "{", "$", "matches", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "foreignKeys", "as", "$", "fk", ")", "{", "if", "(", "in_array", "(", "$", "column", ",", "$", "fk", ...
Returns the foreign keys that include $column in it's list of local columns. Eg. Foreign key (a, b, c) references tbl(x, y, z) will be returned of $column is either a, b or c. @param string $column Name of the column @return array
[ "Returns", "the", "foreign", "keys", "that", "include", "$column", "in", "it", "s", "list", "of", "local", "columns", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1718-L1728
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.quoteIdentifier
public function quoteIdentifier($text) { if (!$this->getPlatform()) { throw new RuntimeException('No platform specified. Can not quote without knowing which platform this table\'s database is using.'); } if ($this->isIdentifierQuotingEnabled()) { return $this->getPla...
php
public function quoteIdentifier($text) { if (!$this->getPlatform()) { throw new RuntimeException('No platform specified. Can not quote without knowing which platform this table\'s database is using.'); } if ($this->isIdentifierQuotingEnabled()) { return $this->getPla...
[ "public", "function", "quoteIdentifier", "(", "$", "text", ")", "{", "if", "(", "!", "$", "this", "->", "getPlatform", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "'No platform specified. Can not quote without knowing which platform this table\\'s datab...
Quotes a identifier depending on identifierQuotingEnabled. Needs a platform assigned to its database. @param string $text @return string
[ "Quotes", "a", "identifier", "depending", "on", "identifierQuotingEnabled", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1768-L1779
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getPrimaryKey
public function getPrimaryKey() { $pk = []; foreach ($this->columns as $col) { if ($col->isPrimaryKey()) { $pk[] = $col; } } return $pk; }
php
public function getPrimaryKey() { $pk = []; foreach ($this->columns as $col) { if ($col->isPrimaryKey()) { $pk[] = $col; } } return $pk; }
[ "public", "function", "getPrimaryKey", "(", ")", "{", "$", "pk", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "columns", "as", "$", "col", ")", "{", "if", "(", "$", "col", "->", "isPrimaryKey", "(", ")", ")", "{", "$", "pk", "[", "]",...
Returns the collection of Columns which make up the single primary key for this table. @return Column[]
[ "Returns", "the", "collection", "of", "Columns", "which", "make", "up", "the", "single", "primary", "key", "for", "this", "table", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1810-L1820
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.getAutoIncrementPrimaryKey
public function getAutoIncrementPrimaryKey() { if (IdMethod::NO_ID_METHOD !== $this->getIdMethod()) { foreach ($this->getPrimaryKey() as $pk) { if ($pk->isAutoIncrement()) { return $pk; } } } }
php
public function getAutoIncrementPrimaryKey() { if (IdMethod::NO_ID_METHOD !== $this->getIdMethod()) { foreach ($this->getPrimaryKey() as $pk) { if ($pk->isAutoIncrement()) { return $pk; } } } }
[ "public", "function", "getAutoIncrementPrimaryKey", "(", ")", "{", "if", "(", "IdMethod", "::", "NO_ID_METHOD", "!==", "$", "this", "->", "getIdMethod", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getPrimaryKey", "(", ")", "as", "$", "pk", ")...
Returns the auto incremented primary key. @return Column
[ "Returns", "the", "auto", "incremented", "primary", "key", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L1886-L1895
propelorm/Propel2
src/Propel/Generator/Model/Table.php
Table.isIdentifierQuotingEnabled
public function isIdentifierQuotingEnabled() { return (null !== $this->identifierQuoting || !$this->database) ? $this->identifierQuoting : $this->database->isIdentifierQuotingEnabled(); }
php
public function isIdentifierQuotingEnabled() { return (null !== $this->identifierQuoting || !$this->database) ? $this->identifierQuoting : $this->database->isIdentifierQuotingEnabled(); }
[ "public", "function", "isIdentifierQuotingEnabled", "(", ")", "{", "return", "(", "null", "!==", "$", "this", "->", "identifierQuoting", "||", "!", "$", "this", "->", "database", ")", "?", "$", "this", "->", "identifierQuoting", ":", "$", "this", "->", "da...
Checks if identifierQuoting is enabled. Looks up to its database->isIdentifierQuotingEnabled if identifierQuoting is null hence undefined. Use getIdentifierQuoting() if you need the raw value. @return boolean
[ "Checks", "if", "identifierQuoting", "is", "enabled", ".", "Looks", "up", "to", "its", "database", "-", ">", "isIdentifierQuotingEnabled", "if", "identifierQuoting", "is", "null", "hence", "undefined", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Table.php#L2026-L2029
propelorm/Propel2
src/Propel/Common/Config/Loader/PhpFileLoader.php
PhpFileLoader.load
public function load($file, $type = null) { $path = $this->getPath($file); //Use output buffering because in case $file contains invalid non-php content (i.e. plain text), include() function //write it on stdoutput ob_start(); $content = include $path; ob_end_clean()...
php
public function load($file, $type = null) { $path = $this->getPath($file); //Use output buffering because in case $file contains invalid non-php content (i.e. plain text), include() function //write it on stdoutput ob_start(); $content = include $path; ob_end_clean()...
[ "public", "function", "load", "(", "$", "file", ",", "$", "type", "=", "null", ")", "{", "$", "path", "=", "$", "this", "->", "getPath", "(", "$", "file", ")", ";", "//Use output buffering because in case $file contains invalid non-php content (i.e. plain text), inc...
Loads a PHP file. @param mixed $file The resource @param string $type The resource type @return array @throws \InvalidArgumentException if configuration file not found @throws \Propel\Common\Config\Exception\InvalidArgumentException if invalid json file @throws \Propel\Common\Config\E...
[ "Loads", "a", "PHP", "file", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/PhpFileLoader.php#L43-L60
propelorm/Propel2
src/Propel/Common/Config/Loader/XmlFileLoader.php
XmlFileLoader.load
public function load($file, $type = null) { $content = XmlToArrayConverter::convert($this->getPath($file)); $content = $this->resolveParams($content); //Resolve parameter placeholders (%name%) return $content; }
php
public function load($file, $type = null) { $content = XmlToArrayConverter::convert($this->getPath($file)); $content = $this->resolveParams($content); //Resolve parameter placeholders (%name%) return $content; }
[ "public", "function", "load", "(", "$", "file", ",", "$", "type", "=", "null", ")", "{", "$", "content", "=", "XmlToArrayConverter", "::", "convert", "(", "$", "this", "->", "getPath", "(", "$", "file", ")", ")", ";", "$", "content", "=", "$", "thi...
Loads an Xml file. @param mixed $file The resource @param string $type The resource type @return array @throws \InvalidArgumentException if configuration file not found @throws \Propel\Common\Config\Exception\InputOutputException if configuration file is not readable @throws \Prop...
[ "Loads", "an", "Xml", "file", "." ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/XmlFileLoader.php#L35-L41
propelorm/Propel2
src/Propel/Runtime/Collection/OnDemandCollection.php
OnDemandCollection.toArray
public function toArray($keyColumn = null, $usePrefix = false, $keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = []) { $ret = []; $keyGetterMethod = 'get' . $keyColumn; /** @var $obj ActiveRecordInterface */ foreach ($this as $key => $obj) { ...
php
public function toArray($keyColumn = null, $usePrefix = false, $keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = []) { $ret = []; $keyGetterMethod = 'get' . $keyColumn; /** @var $obj ActiveRecordInterface */ foreach ($this as $key => $obj) { ...
[ "public", "function", "toArray", "(", "$", "keyColumn", "=", "null", ",", "$", "usePrefix", "=", "false", ",", "$", "keyType", "=", "TableMap", "::", "TYPE_PHPNAME", ",", "$", "includeLazyLoadColumns", "=", "true", ",", "$", "alreadyDumpedObjects", "=", "[",...
Get an array representation of the collection Each object is turned into an array and the result is returned @param string $keyColumn If null, the returned array uses an incremental index. Otherwise, the array is indexed using the specified column @param boolean $usePrefix If true, the retur...
[ "Get", "an", "array", "representation", "of", "the", "collection", "Each", "object", "is", "turned", "into", "an", "array", "and", "the", "result", "is", "returned" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Collection/OnDemandCollection.php#L75-L88
propelorm/Propel2
src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php
TimestampableBehavior.modifyTable
public function modifyTable() { $table = $this->getTable(); if ($this->withCreatedAt() && !$table->hasColumn($this->getParameter('create_column'))) { $table->addColumn([ 'name' => $this->getParameter('create_column'), 'type' => 'TIMESTAMP' ]);...
php
public function modifyTable() { $table = $this->getTable(); if ($this->withCreatedAt() && !$table->hasColumn($this->getParameter('create_column'))) { $table->addColumn([ 'name' => $this->getParameter('create_column'), 'type' => 'TIMESTAMP' ]);...
[ "public", "function", "modifyTable", "(", ")", "{", "$", "table", "=", "$", "this", "->", "getTable", "(", ")", ";", "if", "(", "$", "this", "->", "withCreatedAt", "(", ")", "&&", "!", "$", "table", "->", "hasColumn", "(", "$", "this", "->", "getPa...
Add the create_column and update_columns to the current table
[ "Add", "the", "create_column", "and", "update_columns", "to", "the", "current", "table" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php#L44-L60
propelorm/Propel2
src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php
TimestampableBehavior.preUpdate
public function preUpdate($builder) { if ($this->withUpdatedAt()) { $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('update_column'))->getType()) === 'INTEGER' ? 'time()' : '\\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision()'...
php
public function preUpdate($builder) { if ($this->withUpdatedAt()) { $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('update_column'))->getType()) === 'INTEGER' ? 'time()' : '\\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision()'...
[ "public", "function", "preUpdate", "(", "$", "builder", ")", "{", "if", "(", "$", "this", "->", "withUpdatedAt", "(", ")", ")", "{", "$", "valueSource", "=", "strtoupper", "(", "$", "this", "->", "getTable", "(", ")", "->", "getColumn", "(", "$", "th...
Add code in ObjectBuilder::preUpdate @return string The code to put at the hook
[ "Add", "code", "in", "ObjectBuilder", "::", "preUpdate" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php#L83-L96
propelorm/Propel2
src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php
TimestampableBehavior.preInsert
public function preInsert($builder) { $script = '$time = time(); $highPrecision = \\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision();'; if ($this->withCreatedAt()) { $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('create_column'))->getType()) === ...
php
public function preInsert($builder) { $script = '$time = time(); $highPrecision = \\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision();'; if ($this->withCreatedAt()) { $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('create_column'))->getType()) === ...
[ "public", "function", "preInsert", "(", "$", "builder", ")", "{", "$", "script", "=", "'$time = time();\n$highPrecision = \\\\Propel\\\\Runtime\\\\Util\\\\PropelDateTime::createHighPrecision();'", ";", "if", "(", "$", "this", "->", "withCreatedAt", "(", ")", ")", "{", "...
Add code in ObjectBuilder::preInsert @return string The code to put at the hook
[ "Add", "code", "in", "ObjectBuilder", "::", "preInsert" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php#L103-L131
propelorm/Propel2
src/Propel/Generator/Behavior/I18n/I18nBehaviorObjectBuilderModifier.php
I18nBehaviorObjectBuilderModifier.addTranslatedColumnGetter
protected function addTranslatedColumnGetter(Column $column) { $objectBuilder = $this->builder->getNewObjectBuilder($this->behavior->getI18nTable()); $comment = ''; $functionStatement = ''; if ($this->isDateType($column->getType())) { $objectBuilder->addTemporalAccessorCo...
php
protected function addTranslatedColumnGetter(Column $column) { $objectBuilder = $this->builder->getNewObjectBuilder($this->behavior->getI18nTable()); $comment = ''; $functionStatement = ''; if ($this->isDateType($column->getType())) { $objectBuilder->addTemporalAccessorCo...
[ "protected", "function", "addTranslatedColumnGetter", "(", "Column", "$", "column", ")", "{", "$", "objectBuilder", "=", "$", "this", "->", "builder", "->", "getNewObjectBuilder", "(", "$", "this", "->", "behavior", "->", "getI18nTable", "(", ")", ")", ";", ...
cannot be specified by the user
[ "cannot", "be", "specified", "by", "the", "user" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/I18n/I18nBehaviorObjectBuilderModifier.php#L161-L183
propelorm/Propel2
src/Propel/Generator/Behavior/I18n/I18nBehaviorObjectBuilderModifier.php
I18nBehaviorObjectBuilderModifier.addTranslatedColumnSetter
protected function addTranslatedColumnSetter(Column $column) { $i18nTablePhpName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($this->behavior->getI18nTable())); $tablePhpName = $this->builder->getObjectClassName(); $objectBuilder = $this->builder->getNewO...
php
protected function addTranslatedColumnSetter(Column $column) { $i18nTablePhpName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($this->behavior->getI18nTable())); $tablePhpName = $this->builder->getObjectClassName(); $objectBuilder = $this->builder->getNewO...
[ "protected", "function", "addTranslatedColumnSetter", "(", "Column", "$", "column", ")", "{", "$", "i18nTablePhpName", "=", "$", "this", "->", "builder", "->", "getClassNameFromBuilder", "(", "$", "this", "->", "builder", "->", "getNewStubObjectBuilder", "(", "$",...
cannot be specified by the user
[ "cannot", "be", "specified", "by", "the", "user" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Behavior/I18n/I18nBehaviorObjectBuilderModifier.php#L187-L212
propelorm/Propel2
src/Propel/Runtime/DataFetcher/AbstractDataFetcher.php
AbstractDataFetcher.fetchColumn
public function fetchColumn($index = null) { $next = $this->fetch(); if ($next) { return null === $index ? current($next) : (isset($next[$index]) ? $next[$index] : null); } }
php
public function fetchColumn($index = null) { $next = $this->fetch(); if ($next) { return null === $index ? current($next) : (isset($next[$index]) ? $next[$index] : null); } }
[ "public", "function", "fetchColumn", "(", "$", "index", "=", "null", ")", "{", "$", "next", "=", "$", "this", "->", "fetch", "(", ")", ";", "if", "(", "$", "next", ")", "{", "return", "null", "===", "$", "index", "?", "current", "(", "$", "next",...
{@inheritDoc}
[ "{" ]
train
https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/DataFetcher/AbstractDataFetcher.php#L42-L49