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/Propel | runtime/lib/query/Criteria.php | Criteria.getColumnForAs | public function getColumnForAs($as)
{
if (isset($this->asColumns[$as])) {
return $this->asColumns[$as];
}
return null;
} | php | public function getColumnForAs($as)
{
if (isset($this->asColumns[$as])) {
return $this->asColumns[$as];
}
return null;
} | [
"public",
"function",
"getColumnForAs",
"(",
"$",
"as",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"asColumns",
"[",
"$",
"as",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"asColumns",
"[",
"$",
"as",
"]",
";",
"}",
"return",
"nul... | Returns the column name associated with an alias (AS-column).
@param string $as
@return string|null $string The name if found, null otherwise. | [
"Returns",
"the",
"column",
"name",
"associated",
"with",
"an",
"alias",
"(",
"AS",
"-",
"column",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L371-L378 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.getTableForAlias | public function getTableForAlias($alias)
{
if (isset($this->aliases[$alias])) {
return $this->aliases[$alias];
}
return null;
} | php | public function getTableForAlias($alias)
{
if (isset($this->aliases[$alias])) {
return $this->aliases[$alias];
}
return null;
} | [
"public",
"function",
"getTableForAlias",
"(",
"$",
"alias",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
"[",
"$",
"alias",
"]",
";",
"}",
"return",... | Returns the table name associated with an alias.
@param string $alias
@return string|null $string The name if given, null otherwise. | [
"Returns",
"the",
"table",
"name",
"associated",
"with",
"an",
"alias",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L427-L434 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.keyContainsValue | public function keyContainsValue($column)
{
// must use array_key_exists() because the key could
// exist but have a NULL value (that'd be valid).
return (array_key_exists($column, $this->map) && ($this->map[$column]->getValue() !== null));
} | php | public function keyContainsValue($column)
{
// must use array_key_exists() because the key could
// exist but have a NULL value (that'd be valid).
return (array_key_exists($column, $this->map) && ($this->map[$column]->getValue() !== null));
} | [
"public",
"function",
"keyContainsValue",
"(",
"$",
"column",
")",
"{",
"// must use array_key_exists() because the key could",
"// exist but have a NULL value (that'd be valid).",
"return",
"(",
"array_key_exists",
"(",
"$",
"column",
",",
"$",
"this",
"->",
"map",
")",
... | Does this Criteria object contain the specified key and does it have a value set for the key
@param string $column [table.]column
@return boolean True if this Criteria object contain the specified key and a value for that key | [
"Does",
"this",
"Criteria",
"object",
"contain",
"the",
"specified",
"key",
"and",
"does",
"it",
"have",
"a",
"value",
"set",
"for",
"the",
"key"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L489-L494 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.getLastCriterion | public function getLastCriterion()
{
if ($cnt = count($this->map)) {
$map = array_values($this->map);
return $map[$cnt - 1];
}
return null;
} | php | public function getLastCriterion()
{
if ($cnt = count($this->map)) {
$map = array_values($this->map);
return $map[$cnt - 1];
}
return null;
} | [
"public",
"function",
"getLastCriterion",
"(",
")",
"{",
"if",
"(",
"$",
"cnt",
"=",
"count",
"(",
"$",
"this",
"->",
"map",
")",
")",
"{",
"$",
"map",
"=",
"array_values",
"(",
"$",
"this",
"->",
"map",
")",
";",
"return",
"$",
"map",
"[",
"$",
... | Method to return the latest Criterion in a table.
@return Criterion A Criterion or null no Criterion is added. | [
"Method",
"to",
"return",
"the",
"latest",
"Criterion",
"in",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L555-L564 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.getNewCriterion | public function getNewCriterion($column, $value = null, $comparison = self::EQUAL)
{
return new Criterion($this, $column, $value, $comparison);
} | php | public function getNewCriterion($column, $value = null, $comparison = self::EQUAL)
{
return new Criterion($this, $column, $value, $comparison);
} | [
"public",
"function",
"getNewCriterion",
"(",
"$",
"column",
",",
"$",
"value",
"=",
"null",
",",
"$",
"comparison",
"=",
"self",
"::",
"EQUAL",
")",
"{",
"return",
"new",
"Criterion",
"(",
"$",
"this",
",",
"$",
"column",
",",
"$",
"value",
",",
"$"... | Method to return criterion that is not added automatically
to this Criteria. This can be used to chain the
Criterions to form a more complex where clause.
@param string $column Full name of column (for example TABLE.COLUMN).
@param mixed $value
@param string $comparison
@return Criterion | [
"Method",
"to",
"return",
"criterion",
"that",
"is",
"not",
"added",
"automatically",
"to",
"this",
"Criteria",
".",
"This",
"can",
"be",
"used",
"to",
"chain",
"the",
"Criterions",
"to",
"form",
"a",
"more",
"complex",
"where",
"clause",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L577-L580 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.getTablesColumns | public function getTablesColumns()
{
$tables = array();
foreach ($this->keys() as $key) {
$tableName = substr($key, 0, strrpos($key, '.'));
$tables[$tableName][] = $key;
}
return $tables;
} | php | public function getTablesColumns()
{
$tables = array();
foreach ($this->keys() as $key) {
$tableName = substr($key, 0, strrpos($key, '.'));
$tables[$tableName][] = $key;
}
return $tables;
} | [
"public",
"function",
"getTablesColumns",
"(",
")",
"{",
"$",
"tables",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"keys",
"(",
")",
"as",
"$",
"key",
")",
"{",
"$",
"tableName",
"=",
"substr",
"(",
"$",
"key",
",",
"0",
",",... | Shortcut method to get an array of columns indexed by table.
<code>
print_r($c->getTablesColumns());
=> array(
'book' => array('book.price', 'book.title'),
'author' => array('author.first_name')
)
</code>
@return array array(table => array(table.column1, table.column2)) | [
"Shortcut",
"method",
"to",
"get",
"an",
"array",
"of",
"columns",
"indexed",
"by",
"table",
".",
"<code",
">",
"print_r",
"(",
"$c",
"-",
">",
"getTablesColumns",
"()",
")",
";",
"=",
">",
"array",
"(",
"book",
"=",
">",
"array",
"(",
"book",
".",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L610-L619 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.setDbName | public function setDbName($dbName = null)
{
$this->dbName = ($dbName === null ? Propel::getDefaultDB() : $dbName);
} | php | public function setDbName($dbName = null)
{
$this->dbName = ($dbName === null ? Propel::getDefaultDB() : $dbName);
} | [
"public",
"function",
"setDbName",
"(",
"$",
"dbName",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"dbName",
"=",
"(",
"$",
"dbName",
"===",
"null",
"?",
"Propel",
"::",
"getDefaultDB",
"(",
")",
":",
"$",
"dbName",
")",
";",
"}"
] | Set the DatabaseMap name. If <code>null</code> is supplied, uses value
provided by <code>Propel::getDefaultDB()</code>.
@param string $dbName The Database (Map) name.
@return void | [
"Set",
"the",
"DatabaseMap",
"name",
".",
"If",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"supplied",
"uses",
"value",
"provided",
"by",
"<code",
">",
"Propel",
"::",
"getDefaultDB",
"()",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L655-L658 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.putAll | public function putAll($t)
{
if (is_array($t)) {
foreach ($t as $key => $value) {
if ($value instanceof Criterion) {
$this->map[$key] = $value;
} else {
$this->put($key, $value);
}
}
} els... | php | public function putAll($t)
{
if (is_array($t)) {
foreach ($t as $key => $value) {
if ($value instanceof Criterion) {
$this->map[$key] = $value;
} else {
$this->put($key, $value);
}
}
} els... | [
"public",
"function",
"putAll",
"(",
"$",
"t",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"t",
")",
")",
"{",
"foreach",
"(",
"$",
"t",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Criterion",
")",
"{"... | Copies all of the mappings from the specified Map to this Criteria
These mappings will replace any mappings that this Criteria had for any
of the keys currently in the specified Map.
if the map was another Criteria, its attributes are copied to this
Criteria, overwriting previous settings.
@param mixed $t Mappings to... | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"Map",
"to",
"this",
"Criteria",
"These",
"mappings",
"will",
"replace",
"any",
"mappings",
"that",
"this",
"Criteria",
"had",
"for",
"any",
"of",
"the",
"keys",
"currently",
"in",
"the",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L762-L775 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.add | public function add($critOrColumn, $value = null, $comparison = null)
{
$criterion = $this->getCriterionForCondition($critOrColumn, $value, $comparison);
if ($critOrColumn instanceof Criterion) {
$this->map[$critOrColumn->getTable() . '.' . $critOrColumn->getColumn()] = $criterion;
... | php | public function add($critOrColumn, $value = null, $comparison = null)
{
$criterion = $this->getCriterionForCondition($critOrColumn, $value, $comparison);
if ($critOrColumn instanceof Criterion) {
$this->map[$critOrColumn->getTable() . '.' . $critOrColumn->getColumn()] = $criterion;
... | [
"public",
"function",
"add",
"(",
"$",
"critOrColumn",
",",
"$",
"value",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"$",
"criterion",
"=",
"$",
"this",
"->",
"getCriterionForCondition",
"(",
"$",
"critOrColumn",
",",
"$",
"value",
",",
... | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. If is used as follow:
<code>
$crit = new Criteria();
$crit->add($column, $value, Criteria::GREATER_THAN);
</code>
Any comparison can be used.
The name of the table must be used implicitl... | [
"This",
"method",
"adds",
"a",
"new",
"criterion",
"to",
"the",
"list",
"of",
"criterias",
".",
"If",
"a",
"criterion",
"for",
"the",
"requested",
"column",
"already",
"exists",
"it",
"is",
"replaced",
".",
"If",
"is",
"used",
"as",
"follow",
":"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L798-L808 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.combine | public function combine($criterions = array(), $operator = self::LOGICAL_AND, $name = null)
{
$operatorMethod = (strtoupper($operator) == self::LOGICAL_AND) ? 'addAnd' : 'addOr';
$namedCriterions = array();
foreach ($criterions as $key) {
if (array_key_exists($key, $this->namedCr... | php | public function combine($criterions = array(), $operator = self::LOGICAL_AND, $name = null)
{
$operatorMethod = (strtoupper($operator) == self::LOGICAL_AND) ? 'addAnd' : 'addOr';
$namedCriterions = array();
foreach ($criterions as $key) {
if (array_key_exists($key, $this->namedCr... | [
"public",
"function",
"combine",
"(",
"$",
"criterions",
"=",
"array",
"(",
")",
",",
"$",
"operator",
"=",
"self",
"::",
"LOGICAL_AND",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"operatorMethod",
"=",
"(",
"strtoupper",
"(",
"$",
"operator",
")",
... | Combine several named criterions with a logical operator
@param array $criterions array of the name of the criterions to combine
@param string $operator logical operator, either Criteria::LOGICAL_AND, or Criteria::LOGICAL_OR
@param string $name optional name to combine the criterion later
@return Criteria
@... | [
"Combine",
"several",
"named",
"criterions",
"with",
"a",
"logical",
"operator"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L851-L874 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.addJoinObject | public function addJoinObject(Join $join)
{
$isAlreadyAdded = false;
foreach ($this->joins as $alreadyAddedJoin) {
if ($join->equals($alreadyAddedJoin)) {
$isAlreadyAdded = true;
break;
}
}
if (!$isAlreadyAdded) {
$... | php | public function addJoinObject(Join $join)
{
$isAlreadyAdded = false;
foreach ($this->joins as $alreadyAddedJoin) {
if ($join->equals($alreadyAddedJoin)) {
$isAlreadyAdded = true;
break;
}
}
if (!$isAlreadyAdded) {
$... | [
"public",
"function",
"addJoinObject",
"(",
"Join",
"$",
"join",
")",
"{",
"$",
"isAlreadyAdded",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"joins",
"as",
"$",
"alreadyAddedJoin",
")",
"{",
"if",
"(",
"$",
"join",
"->",
"equals",
"(",
"$",
... | Add a join object to the Criteria
@param Join $join A join object
@return Criteria A modified Criteria object | [
"Add",
"a",
"join",
"object",
"to",
"the",
"Criteria"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1008-L1023 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.removeSelectModifier | public function removeSelectModifier($modifier)
{
$this->selectModifiers = array_values(array_diff($this->selectModifiers, array($modifier)));
return $this;
} | php | public function removeSelectModifier($modifier)
{
$this->selectModifiers = array_values(array_diff($this->selectModifiers, array($modifier)));
return $this;
} | [
"public",
"function",
"removeSelectModifier",
"(",
"$",
"modifier",
")",
"{",
"$",
"this",
"->",
"selectModifiers",
"=",
"array_values",
"(",
"array_diff",
"(",
"$",
"this",
"->",
"selectModifiers",
",",
"array",
"(",
"$",
"modifier",
")",
")",
")",
";",
"... | Removes a modifier to the SQL statement.
Checks for existence before removal
@param string $modifier The modifier to add
@return Criteria Modified Criteria object (for fluent API) | [
"Removes",
"a",
"modifier",
"to",
"the",
"SQL",
"statement",
".",
"Checks",
"for",
"existence",
"before",
"removal"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1160-L1165 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.getCriterionForCondition | protected function getCriterionForCondition($p1, $value = null, $comparison = null)
{
if ($p1 instanceof Criterion) {
// it's already a Criterion, so ignore $value and $comparison
return $p1;
} elseif (is_int($comparison)) {
// $comparison is a PDO::PARAM_* consta... | php | protected function getCriterionForCondition($p1, $value = null, $comparison = null)
{
if ($p1 instanceof Criterion) {
// it's already a Criterion, so ignore $value and $comparison
return $p1;
} elseif (is_int($comparison)) {
// $comparison is a PDO::PARAM_* consta... | [
"protected",
"function",
"getCriterionForCondition",
"(",
"$",
"p1",
",",
"$",
"value",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"p1",
"instanceof",
"Criterion",
")",
"{",
"// it's already a Criterion, so ignore $value and $compa... | 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/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1722-L1736 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.addAnd | public function addAnd($p1, $value = null, $comparison = null, $preferColumnCondition = true)
{
$criterion = $this->getCriterionForCondition($p1, $value, $comparison);
$key = $criterion->getTable() . '.' . $criterion->getColumn();
if ($preferColumnCondition && $this->containsKey($key)) {
... | php | public function addAnd($p1, $value = null, $comparison = null, $preferColumnCondition = true)
{
$criterion = $this->getCriterionForCondition($p1, $value, $comparison);
$key = $criterion->getTable() . '.' . $criterion->getColumn();
if ($preferColumnCondition && $this->containsKey($key)) {
... | [
"public",
"function",
"addAnd",
"(",
"$",
"p1",
",",
"$",
"value",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
",",
"$",
"preferColumnCondition",
"=",
"true",
")",
"{",
"$",
"criterion",
"=",
"$",
"this",
"->",
"getCriterionForCondition",
"(",
"$",... | 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/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1757-L1772 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.addOr | public function addOr($p1, $value = null, $comparison = null, $preferColumnCondition = true)
{
$rightCriterion = $this->getCriterionForCondition($p1, $value, $comparison);
$key = $rightCriterion->getTable() . '.' . $rightCriterion->getColumn();
if ($preferColumnCondition && $this->containsK... | php | public function addOr($p1, $value = null, $comparison = null, $preferColumnCondition = true)
{
$rightCriterion = $this->getCriterionForCondition($p1, $value, $comparison);
$key = $rightCriterion->getTable() . '.' . $rightCriterion->getColumn();
if ($preferColumnCondition && $this->containsK... | [
"public",
"function",
"addOr",
"(",
"$",
"p1",
",",
"$",
"value",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
",",
"$",
"preferColumnCondition",
"=",
"true",
")",
"{",
"$",
"rightCriterion",
"=",
"$",
"this",
"->",
"getCriterionForCondition",
"(",
... | If a criterion for the requested column already exists, the condition is "OR"ed to the existing criterion (necessary for Propel 1.4 compatibility).
If no criterion for the requested column already exists, the condition is "OR"ed to the latest criterion.
If no criterion exist, the condition is added a new criterion
Any... | [
"If",
"a",
"criterion",
"for",
"the",
"requested",
"column",
"already",
"exists",
"the",
"condition",
"is",
"OR",
"ed",
"to",
"the",
"existing",
"criterion",
"(",
"necessary",
"for",
"Propel",
"1",
".",
"4",
"compatibility",
")",
".",
"If",
"no",
"criterio... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1793-L1816 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.addUsingOperator | public function addUsingOperator($p1, $value = null, $operator = null, $preferColumnCondition = true)
{
if ($this->defaultCombineOperator == Criteria::LOGICAL_OR) {
$this->defaultCombineOperator = Criteria::LOGICAL_AND;
return $this->addOr($p1, $value, $operator, $preferColumnCondit... | php | public function addUsingOperator($p1, $value = null, $operator = null, $preferColumnCondition = true)
{
if ($this->defaultCombineOperator == Criteria::LOGICAL_OR) {
$this->defaultCombineOperator = Criteria::LOGICAL_AND;
return $this->addOr($p1, $value, $operator, $preferColumnCondit... | [
"public",
"function",
"addUsingOperator",
"(",
"$",
"p1",
",",
"$",
"value",
"=",
"null",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"preferColumnCondition",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"defaultCombineOperator",
"==",
"Criteria",... | Overrides Criteria::add() to use the default combine operator
@see Criteria::add()
@param string|Criterion $p1 The column to run the comparison on (e.g. BookPeer::ID), or Criterion object
@param mixed $value
@param string $operator A String, like Criteria::E... | [
"Overrides",
"Criteria",
"::",
"add",
"()",
"to",
"use",
"the",
"default",
"combine",
"operator"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1832-L1841 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria._endif | public function _endif()
{
if (!$this->conditionalProxy) {
throw new PropelException('_endif() must be called after _if()');
}
$this->conditionalProxy = $this->conditionalProxy->getParentProxy();
if ($this->conditionalProxy) {
return $this->conditionalProxy-... | php | public function _endif()
{
if (!$this->conditionalProxy) {
throw new PropelException('_endif() must be called after _if()');
}
$this->conditionalProxy = $this->conditionalProxy->getParentProxy();
if ($this->conditionalProxy) {
return $this->conditionalProxy-... | [
"public",
"function",
"_endif",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"conditionalProxy",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'_endif() must be called after _if()'",
")",
";",
"}",
"$",
"this",
"->",
"conditionalProxy",
"=",
"$",
"... | Returns the current object
Allows for conditional statements in a fluid interface.
@return Criteria
@throws PropelException | [
"Returns",
"the",
"current",
"object",
"Allows",
"for",
"conditional",
"statements",
"in",
"a",
"fluid",
"interface",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L1927-L1941 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.guessPeerCountMethod | private function guessPeerCountMethod()
{
$selectMethod = $this->getPeerSelectMethod();
if ($selectMethod == 'doSelect') {
$countMethod = 'doCount';
} elseif (($pos = stripos($selectMethod, 'doSelectJoin')) === 0) {
$countMethod = 'doCount' . substr($selectMethod, str... | php | private function guessPeerCountMethod()
{
$selectMethod = $this->getPeerSelectMethod();
if ($selectMethod == 'doSelect') {
$countMethod = 'doCount';
} elseif (($pos = stripos($selectMethod, 'doSelectJoin')) === 0) {
$countMethod = 'doCount' . substr($selectMethod, str... | [
"private",
"function",
"guessPeerCountMethod",
"(",
")",
"{",
"$",
"selectMethod",
"=",
"$",
"this",
"->",
"getPeerSelectMethod",
"(",
")",
";",
"if",
"(",
"$",
"selectMethod",
"==",
"'doSelect'",
")",
"{",
"$",
"countMethod",
"=",
"'doCount'",
";",
"}",
"... | Guesses the Peer count method based on the select method. | [
"Guesses",
"the",
"Peer",
"count",
"method",
"based",
"on",
"the",
"select",
"method",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L254-L268 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.doRs | private function doRs()
{
$this->criteria->setOffset($this->start);
$this->criteria->setLimit($this->max);
$this->rs = call_user_func(array($this->getPeerClass(), $this->getPeerSelectMethod()), $this->criteria);
} | php | private function doRs()
{
$this->criteria->setOffset($this->start);
$this->criteria->setLimit($this->max);
$this->rs = call_user_func(array($this->getPeerClass(), $this->getPeerSelectMethod()), $this->criteria);
} | [
"private",
"function",
"doRs",
"(",
")",
"{",
"$",
"this",
"->",
"criteria",
"->",
"setOffset",
"(",
"$",
"this",
"->",
"start",
")",
";",
"$",
"this",
"->",
"criteria",
"->",
"setLimit",
"(",
"$",
"this",
"->",
"max",
")",
";",
"$",
"this",
"->",
... | Get the paged resultset
Main method which creates a paged result set based on the criteria
and the requested peer select method. | [
"Get",
"the",
"paged",
"resultset"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L291-L296 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getTotalPages | public function getTotalPages()
{
if (!isset($this->pages)) {
$recordCount = $this->getTotalRecordCount();
if ($this->max > 0) {
$this->pages = ceil($recordCount / $this->max);
} else {
$this->pages = 0;
}
}
ret... | php | public function getTotalPages()
{
if (!isset($this->pages)) {
$recordCount = $this->getTotalRecordCount();
if ($this->max > 0) {
$this->pages = ceil($recordCount / $this->max);
} else {
$this->pages = 0;
}
}
ret... | [
"public",
"function",
"getTotalPages",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pages",
")",
")",
"{",
"$",
"recordCount",
"=",
"$",
"this",
"->",
"getTotalRecordCount",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"max",
">... | get total pages
@return int $this->pages | [
"get",
"total",
"pages"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L351-L363 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getPrevLinks | public function getPrevLinks($range = 5)
{
$total = $this->getTotalPages();
$start = $this->getPage() - 1;
$end = $this->getPage() - $range;
$first = $this->getFirstPage();
$links = array();
for ($i = $start; $i > $end; $i--) {
if ($i < $first) {
... | php | public function getPrevLinks($range = 5)
{
$total = $this->getTotalPages();
$start = $this->getPage() - 1;
$end = $this->getPage() - $range;
$first = $this->getFirstPage();
$links = array();
for ($i = $start; $i > $end; $i--) {
if ($i < $first) {
... | [
"public",
"function",
"getPrevLinks",
"(",
"$",
"range",
"=",
"5",
")",
"{",
"$",
"total",
"=",
"$",
"this",
"->",
"getTotalPages",
"(",
")",
";",
"$",
"start",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
"-",
"1",
";",
"$",
"end",
"=",
"$",
"... | get an array of previous id's
@param int $range
@return array $links | [
"get",
"an",
"array",
"of",
"previous",
"id",
"s"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L372-L387 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getNextLinks | public function getNextLinks($range = 5)
{
$total = $this->getTotalPages();
$start = $this->getPage() + 1;
$end = $this->getPage() + $range;
$last = $this->getLastPage();
$links = array();
for ($i = $start; $i < $end; $i++) {
if ($i > $last) {
... | php | public function getNextLinks($range = 5)
{
$total = $this->getTotalPages();
$start = $this->getPage() + 1;
$end = $this->getPage() + $range;
$last = $this->getLastPage();
$links = array();
for ($i = $start; $i < $end; $i++) {
if ($i > $last) {
... | [
"public",
"function",
"getNextLinks",
"(",
"$",
"range",
"=",
"5",
")",
"{",
"$",
"total",
"=",
"$",
"this",
"->",
"getTotalPages",
"(",
")",
";",
"$",
"start",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
"+",
"1",
";",
"$",
"end",
"=",
"$",
"... | get an array of next id's
@param int $range
@return array $links | [
"get",
"an",
"array",
"of",
"next",
"id",
"s"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L396-L411 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getPrev | public function getPrev()
{
if ($this->getPage() != $this->getFirstPage()) {
$prev = $this->getPage() - 1;
} else {
$prev = false;
}
return $prev;
} | php | public function getPrev()
{
if ($this->getPage() != $this->getFirstPage()) {
$prev = $this->getPage() - 1;
} else {
$prev = false;
}
return $prev;
} | [
"public",
"function",
"getPrev",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPage",
"(",
")",
"!=",
"$",
"this",
"->",
"getFirstPage",
"(",
")",
")",
"{",
"$",
"prev",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
"-",
"1",
";",
"}",
"else"... | get previous id
@return mixed $prev | [
"get",
"previous",
"id"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L428-L437 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getNext | public function getNext()
{
if ($this->getPage() != $this->getLastPage()) {
$next = $this->getPage() + 1;
} else {
$next = false;
}
return $next;
} | php | public function getNext()
{
if ($this->getPage() != $this->getLastPage()) {
$next = $this->getPage() + 1;
} else {
$next = false;
}
return $next;
} | [
"public",
"function",
"getNext",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getPage",
"(",
")",
"!=",
"$",
"this",
"->",
"getLastPage",
"(",
")",
")",
"{",
"$",
"next",
"=",
"$",
"this",
"->",
"getPage",
"(",
")",
"+",
"1",
";",
"}",
"else",... | get next id
@return mixed $next | [
"get",
"next",
"id"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L444-L453 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.getTotalRecordCount | public function getTotalRecordCount()
{
if (!isset($this->rs)) {
$this->doRs();
}
if (empty($this->recordCount)) {
$this->countCriteria = clone $this->criteria;
$this->countCriteria->setLimit(0);
$this->countCriteria->setOffset(0);
... | php | public function getTotalRecordCount()
{
if (!isset($this->rs)) {
$this->doRs();
}
if (empty($this->recordCount)) {
$this->countCriteria = clone $this->criteria;
$this->countCriteria->setLimit(0);
$this->countCriteria->setOffset(0);
... | [
"public",
"function",
"getTotalRecordCount",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rs",
")",
")",
"{",
"$",
"this",
"->",
"doRs",
"(",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"recordCount",
")",
")",
... | Gets the total number of (un-LIMITed) records.
This method will perform a query that executes un-LIMITed query.
@return int Total number of records - disregarding page, maxrows, etc. | [
"Gets",
"the",
"total",
"number",
"of",
"(",
"un",
"-",
"LIMITed",
")",
"records",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L518-L534 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.current | public function current()
{
if (!isset($this->rs)) {
$this->doRs();
}
return $this->rs[$this->currentKey];
} | php | public function current()
{
if (!isset($this->rs)) {
$this->doRs();
}
return $this->rs[$this->currentKey];
} | [
"public",
"function",
"current",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rs",
")",
")",
"{",
"$",
"this",
"->",
"doRs",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"rs",
"[",
"$",
"this",
"->",
"currentKey",
"]",
... | Returns the current element of the iterator
@return mixed | [
"Returns",
"the",
"current",
"element",
"of",
"the",
"iterator"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L573-L580 |
propelorm/Propel | runtime/lib/util/PropelPager.php | PropelPager.valid | public function valid()
{
if (!isset($this->rs)) {
$this->doRs();
}
return in_array($this->currentKey, array_keys($this->rs));
} | php | public function valid()
{
if (!isset($this->rs)) {
$this->doRs();
}
return in_array($this->currentKey, array_keys($this->rs));
} | [
"public",
"function",
"valid",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rs",
")",
")",
"{",
"$",
"this",
"->",
"doRs",
"(",
")",
";",
"}",
"return",
"in_array",
"(",
"$",
"this",
"->",
"currentKey",
",",
"array_keys",
"(",... | Checks if the current key exists in the container
@return boolean | [
"Checks",
"if",
"the",
"current",
"key",
"exists",
"in",
"the",
"container"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelPager.php#L617-L624 |
propelorm/Propel | runtime/lib/collection/PropelArrayCollection.php | PropelArrayCollection.save | public function save($con = null)
{
if (!method_exists($this->getModel(), 'save')) {
throw new PropelException('Cannot save objects on a read-only model');
}
if (null === $con) {
$con = $this->getConnection(Propel::CONNECTION_WRITE);
}
$con->beginTrans... | php | public function save($con = null)
{
if (!method_exists($this->getModel(), 'save')) {
throw new PropelException('Cannot save objects on a read-only model');
}
if (null === $con) {
$con = $this->getConnection(Propel::CONNECTION_WRITE);
}
$con->beginTrans... | [
"public",
"function",
"save",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
",",
"'save'",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'Cannot save objects on a read-only ... | Save all the elements in the collection
@param PropelPDO $con
@throws PropelException | [
"Save",
"all",
"the",
"elements",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/collection/PropelArrayCollection.php#L28-L49 |
propelorm/Propel | runtime/lib/collection/PropelArrayCollection.php | PropelArrayCollection.delete | public function delete($con = null)
{
if (!method_exists($this->getModel(), 'delete')) {
throw new PropelException('Cannot delete objects on a read-only model');
}
if (null === $con) {
$con = $this->getConnection(Propel::CONNECTION_WRITE);
}
$con->begi... | php | public function delete($con = null)
{
if (!method_exists($this->getModel(), 'delete')) {
throw new PropelException('Cannot delete objects on a read-only model');
}
if (null === $con) {
$con = $this->getConnection(Propel::CONNECTION_WRITE);
}
$con->begi... | [
"public",
"function",
"delete",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
",",
"'delete'",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'Cannot delete objects on a read... | Delete all the elements in the collection
@param PropelPDO $con
@throws PropelException | [
"Delete",
"all",
"the",
"elements",
"in",
"the",
"collection"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/collection/PropelArrayCollection.php#L58-L79 |
propelorm/Propel | runtime/lib/collection/PropelArrayCollection.php | PropelArrayCollection.toArray | public function toArray($keyColumn = null, $usePrefix = false, $keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
{
$ret = array();
foreach ($this as $key => $element) {
$key = null === $keyColumn ? $key : $element[$keyColumn];
... | php | public function toArray($keyColumn = null, $usePrefix = false, $keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
{
$ret = array();
foreach ($this as $key => $element) {
$key = null === $keyColumn ? $key : $element[$keyColumn];
... | [
"public",
"function",
"toArray",
"(",
"$",
"keyColumn",
"=",
"null",
",",
"$",
"usePrefix",
"=",
"false",
",",
"$",
"keyType",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"arr... | Get an array representation of the collection
This is not an alias for getData(), since it returns a copy of the data
@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 returned array prefixes... | [
"Get",
"an",
"array",
"representation",
"of",
"the",
"collection",
"This",
"is",
"not",
"an",
"alias",
"for",
"getData",
"()",
"since",
"it",
"returns",
"a",
"copy",
"of",
"the",
"data"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/collection/PropelArrayCollection.php#L146-L156 |
propelorm/Propel | generator/lib/model/Table.php | Table.getStdSeparatedName | private function getStdSeparatedName()
{
if ($this->schema && $this->getBuildProperty('schemaAutoPrefix')) {
return $this->schema . NameGenerator::STD_SEPARATOR_CHAR . $this->nonPrefixedName;
} else {
return $this->nonPrefixedName;
}
} | php | private function getStdSeparatedName()
{
if ($this->schema && $this->getBuildProperty('schemaAutoPrefix')) {
return $this->schema . NameGenerator::STD_SEPARATOR_CHAR . $this->nonPrefixedName;
} else {
return $this->nonPrefixedName;
}
} | [
"private",
"function",
"getStdSeparatedName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"schema",
"&&",
"$",
"this",
"->",
"getBuildProperty",
"(",
"'schemaAutoPrefix'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"schema",
".",
"NameGenerator",
"::",
"... | get a qualified name of this table with scheme and common name separated by '_'
if schemaAutoPrefix is set. Otherwise get the common name.
@return string | [
"get",
"a",
"qualified",
"name",
"of",
"this",
"table",
"with",
"scheme",
"and",
"common",
"name",
"separated",
"by",
"_",
"if",
"schemaAutoPrefix",
"is",
"set",
".",
"Otherwise",
"get",
"the",
"common",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L321-L328 |
propelorm/Propel | generator/lib/model/Table.php | Table.setupObject | public function setupObject()
{
parent::setupObject();
$this->commonName = $this->getDatabase()->getTablePrefix() . $this->getAttribute("name");
$this->nonPrefixedName = $this->getAttribute('name');
// retrieves the method for converting from specified name to a PHP name.
$t... | php | public function setupObject()
{
parent::setupObject();
$this->commonName = $this->getDatabase()->getTablePrefix() . $this->getAttribute("name");
$this->nonPrefixedName = $this->getAttribute('name');
// retrieves the method for converting from specified name to a PHP name.
$t... | [
"public",
"function",
"setupObject",
"(",
")",
"{",
"parent",
"::",
"setupObject",
"(",
")",
";",
"$",
"this",
"->",
"commonName",
"=",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"->",
"getTablePrefix",
"(",
")",
".",
"$",
"this",
"->",
"getAttribute",
... | Sets up the Rule object based on the attributes that were passed to loadFromXML().
@see parent::loadFromXML() | [
"Sets",
"up",
"the",
"Rule",
"object",
"based",
"on",
"the",
"attributes",
"that",
"were",
"passed",
"to",
"loadFromXML",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L335-L366 |
propelorm/Propel | generator/lib/model/Table.php | Table.getColumnList | public function getColumnList($columns, $delim = ',')
{
$list = array();
foreach ($columns as $col) {
if ($col instanceof Column) {
$col = $col->getName();
}
$list[] = $col;
}
return implode($delim, $list);
} | php | public function getColumnList($columns, $delim = ',')
{
$list = array();
foreach ($columns as $col) {
if ($col instanceof Column) {
$col = $col->getName();
}
$list[] = $col;
}
return implode($delim, $list);
} | [
"public",
"function",
"getColumnList",
"(",
"$",
"columns",
",",
"$",
"delim",
"=",
"','",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"instanceof",
"Column"... | Creates a delimiter-delimited string list of column names
@see Platform::getColumnList() if quoting is required
@param array Column[] or string[]
@param string $delim The delimiter to use in separating the column names.
@return string | [
"Creates",
"a",
"delimiter",
"-",
"delimited",
"string",
"list",
"of",
"column",
"names"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L580-L591 |
propelorm/Propel | generator/lib/model/Table.php | Table.doNaming | public function doNaming()
{
// Assure names are unique across all databases.
try {
for ($i = 0, $size = count($this->foreignKeys); $i < $size; $i++) {
$fk = $this->foreignKeys[$i];
$name = $fk->getName();
if (empty($name)) {
... | php | public function doNaming()
{
// Assure names are unique across all databases.
try {
for ($i = 0, $size = count($this->foreignKeys); $i < $size; $i++) {
$fk = $this->foreignKeys[$i];
$name = $fk->getName();
if (empty($name)) {
... | [
"public",
"function",
"doNaming",
"(",
")",
"{",
"// Assure names are unique across all databases.",
"try",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"size",
"=",
"count",
"(",
"$",
"this",
"->",
"foreignKeys",
")",
";",
"$",
"i",
"<",
"$",
"size",
... | Names composing objects which haven't yet been named. This
currently consists of foreign-key and index entities. | [
"Names",
"composing",
"objects",
"which",
"haven",
"t",
"yet",
"been",
"named",
".",
"This",
"currently",
"consists",
"of",
"foreign",
"-",
"key",
"and",
"index",
"entities",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L597-L635 |
propelorm/Propel | generator/lib/model/Table.php | Table.acquireConstraintName | private function acquireConstraintName($nameType, $nbr)
{
$inputs = array();
$inputs[] = $this->getDatabase();
$inputs[] = $this->getCommonName();
$inputs[] = $nameType;
$inputs[] = $nbr;
return NameFactory::generateName(NameFactory::CONSTRAINT_GENERATOR, $inputs);
... | php | private function acquireConstraintName($nameType, $nbr)
{
$inputs = array();
$inputs[] = $this->getDatabase();
$inputs[] = $this->getCommonName();
$inputs[] = $nameType;
$inputs[] = $nbr;
return NameFactory::generateName(NameFactory::CONSTRAINT_GENERATOR, $inputs);
... | [
"private",
"function",
"acquireConstraintName",
"(",
"$",
"nameType",
",",
"$",
"nbr",
")",
"{",
"$",
"inputs",
"=",
"array",
"(",
")",
";",
"$",
"inputs",
"[",
"]",
"=",
"$",
"this",
"->",
"getDatabase",
"(",
")",
";",
"$",
"inputs",
"[",
"]",
"="... | Macro to a constraint name.
@param nameType constraint type
@param nbr unique number for this constraint type
@return unique name for constraint
@throws EngineException | [
"Macro",
"to",
"a",
"constraint",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L646-L655 |
propelorm/Propel | generator/lib/model/Table.php | Table.getBaseClass | public function getBaseClass()
{
if ($this->isAlias() && $this->baseClass === null) {
return $this->alias;
} elseif ($this->baseClass === null) {
return $this->getDatabase()->getBaseClass();
} else {
return $this->baseClass;
}
} | php | public function getBaseClass()
{
if ($this->isAlias() && $this->baseClass === null) {
return $this->alias;
} elseif ($this->baseClass === null) {
return $this->getDatabase()->getBaseClass();
} else {
return $this->baseClass;
}
} | [
"public",
"function",
"getBaseClass",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAlias",
"(",
")",
"&&",
"$",
"this",
"->",
"baseClass",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"alias",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",... | Gets the value of base class for classes produced from this table.
@return The base class for classes produced from this table. | [
"Gets",
"the",
"value",
"of",
"base",
"class",
"for",
"classes",
"produced",
"from",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L662-L671 |
propelorm/Propel | generator/lib/model/Table.php | Table.getBasePeer | public function getBasePeer()
{
if ($this->isAlias() && $this->basePeer === null) {
return $this->alias . "Peer";
} elseif ($this->basePeer === null) {
return $this->getDatabase()->getBasePeer();
} else {
return $this->basePeer;
}
} | php | public function getBasePeer()
{
if ($this->isAlias() && $this->basePeer === null) {
return $this->alias . "Peer";
} elseif ($this->basePeer === null) {
return $this->getDatabase()->getBasePeer();
} else {
return $this->basePeer;
}
} | [
"public",
"function",
"getBasePeer",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAlias",
"(",
")",
"&&",
"$",
"this",
"->",
"basePeer",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"alias",
".",
"\"Peer\"",
";",
"}",
"elseif",
"(",
"$"... | Get the value of basePeer.
@return value of basePeer. | [
"Get",
"the",
"value",
"of",
"basePeer",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L688-L697 |
propelorm/Propel | generator/lib/model/Table.php | Table.removeColumn | public function removeColumn($col)
{
if (is_string($col)) {
$col = $this->getColumn($col);
}
$pos = array_search($col, $this->columnList);
if (false === $pos) {
throw new EngineException(sprintf('No column named %s found in table %s', $col->getName(), $this->g... | php | public function removeColumn($col)
{
if (is_string($col)) {
$col = $this->getColumn($col);
}
$pos = array_search($col, $this->columnList);
if (false === $pos) {
throw new EngineException(sprintf('No column named %s found in table %s', $col->getName(), $this->g... | [
"public",
"function",
"removeColumn",
"(",
"$",
"col",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"col",
")",
")",
"{",
"$",
"col",
"=",
"$",
"this",
"->",
"getColumn",
"(",
"$",
"col",
")",
";",
"}",
"$",
"pos",
"=",
"array_search",
"(",
"$",
... | Removed a column from the table
@param Column|string $col the column to remove
@throws EngineException | [
"Removed",
"a",
"column",
"from",
"the",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L756-L771 |
propelorm/Propel | generator/lib/model/Table.php | Table.addValidator | public function addValidator($data)
{
if ($data instanceof Validator) {
$validator = $data;
$col = $this->getColumn($validator->getColumnName());
if ($col == null) {
throw new EngineException("Failed adding validator to table '" . $this->getName() . "': co... | php | public function addValidator($data)
{
if ($data instanceof Validator) {
$validator = $data;
$col = $this->getColumn($validator->getColumnName());
if ($col == null) {
throw new EngineException("Failed adding validator to table '" . $this->getName() . "': co... | [
"public",
"function",
"addValidator",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Validator",
")",
"{",
"$",
"validator",
"=",
"$",
"data",
";",
"$",
"col",
"=",
"$",
"this",
"->",
"getColumn",
"(",
"$",
"validator",
"->",
"get... | Add a validator to this table.
Supports two signatures:
- addValidator(Validator $validator)
- addValidator(array $attribs)
@param mixed $data Validator object or XML attribs (array) from <validator /> element.
@return Validator The added Validator.
@throws EngineException | [
"Add",
"a",
"validator",
"to",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L794-L814 |
propelorm/Propel | generator/lib/model/Table.php | Table.removeValidatorForColumn | public function removeValidatorForColumn($columnName)
{
foreach ($this->validatorList as $key => $validator) {
if ($validator->getColumnName() == $columnName) {
unset($this->validatorList[$key]);
}
}
} | php | public function removeValidatorForColumn($columnName)
{
foreach ($this->validatorList as $key => $validator) {
if ($validator->getColumnName() == $columnName) {
unset($this->validatorList[$key]);
}
}
} | [
"public",
"function",
"removeValidatorForColumn",
"(",
"$",
"columnName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"validatorList",
"as",
"$",
"key",
"=>",
"$",
"validator",
")",
"{",
"if",
"(",
"$",
"validator",
"->",
"getColumnName",
"(",
")",
"==",
... | Removes validators based on a column name
@param string $columnName The name of the column bearing a validator. | [
"Removes",
"validators",
"based",
"on",
"a",
"column",
"name"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L821-L828 |
propelorm/Propel | generator/lib/model/Table.php | Table.addForeignKey | public function addForeignKey($fkdata)
{
if ($fkdata instanceof ForeignKey) {
$fk = $fkdata;
$fk->setTable($this);
$this->foreignKeys[] = $fk;
if ($this->foreignTableNames === null) {
$this->foreignTableNames = array();
}
... | php | public function addForeignKey($fkdata)
{
if ($fkdata instanceof ForeignKey) {
$fk = $fkdata;
$fk->setTable($this);
$this->foreignKeys[] = $fk;
if ($this->foreignTableNames === null) {
$this->foreignTableNames = array();
}
... | [
"public",
"function",
"addForeignKey",
"(",
"$",
"fkdata",
")",
"{",
"if",
"(",
"$",
"fkdata",
"instanceof",
"ForeignKey",
")",
"{",
"$",
"fk",
"=",
"$",
"fkdata",
";",
"$",
"fk",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"fo... | A utility function to create a new foreign key
from attrib and add it to this table. | [
"A",
"utility",
"function",
"to",
"create",
"a",
"new",
"foreign",
"key",
"from",
"attrib",
"and",
"add",
"it",
"to",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L834-L856 |
propelorm/Propel | generator/lib/model/Table.php | Table.getChildrenNames | public function getChildrenNames()
{
if ($this->inheritanceColumn === null || !$this->inheritanceColumn->isEnumeratedClasses()) {
return null;
}
$children = $this->inheritanceColumn->getChildren();
$names = array();
for ($i = 0, $size = count($children); $i < $siz... | php | public function getChildrenNames()
{
if ($this->inheritanceColumn === null || !$this->inheritanceColumn->isEnumeratedClasses()) {
return null;
}
$children = $this->inheritanceColumn->getChildren();
$names = array();
for ($i = 0, $size = count($children); $i < $siz... | [
"public",
"function",
"getChildrenNames",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"inheritanceColumn",
"===",
"null",
"||",
"!",
"$",
"this",
"->",
"inheritanceColumn",
"->",
"isEnumeratedClasses",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
... | Get the subclasses that can be created from this table.
@return array string[] Class names | [
"Get",
"the",
"subclasses",
"that",
"can",
"be",
"created",
"from",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L874-L886 |
propelorm/Propel | generator/lib/model/Table.php | Table.addIdMethodParameter | public function addIdMethodParameter($impdata)
{
if ($impdata instanceof IdMethodParameter) {
$imp = $impdata;
$imp->setTable($this);
if ($this->idMethodParameters === null) {
$this->idMethodParameters = array();
}
$this->idMethodPa... | php | public function addIdMethodParameter($impdata)
{
if ($impdata instanceof IdMethodParameter) {
$imp = $impdata;
$imp->setTable($this);
if ($this->idMethodParameters === null) {
$this->idMethodParameters = array();
}
$this->idMethodPa... | [
"public",
"function",
"addIdMethodParameter",
"(",
"$",
"impdata",
")",
"{",
"if",
"(",
"$",
"impdata",
"instanceof",
"IdMethodParameter",
")",
"{",
"$",
"imp",
"=",
"$",
"impdata",
";",
"$",
"imp",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"if",
"... | A utility function to create a new id method parameter
from attrib or object and add it to this table. | [
"A",
"utility",
"function",
"to",
"create",
"a",
"new",
"id",
"method",
"parameter",
"from",
"attrib",
"or",
"object",
"and",
"add",
"it",
"to",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1036-L1053 |
propelorm/Propel | generator/lib/model/Table.php | Table.removeIndex | public function removeIndex($name)
{
//check if we have a index with this name already, then delete it
foreach ($this->indices as $n => $idx) {
if ($idx->getName() == $name) {
unset($this->indices[$n]);
return;
}
}
} | php | public function removeIndex($name)
{
//check if we have a index with this name already, then delete it
foreach ($this->indices as $n => $idx) {
if ($idx->getName() == $name) {
unset($this->indices[$n]);
return;
}
}
} | [
"public",
"function",
"removeIndex",
"(",
"$",
"name",
")",
"{",
"//check if we have a index with this name already, then delete it",
"foreach",
"(",
"$",
"this",
"->",
"indices",
"as",
"$",
"n",
"=>",
"$",
"idx",
")",
"{",
"if",
"(",
"$",
"idx",
"->",
"getNam... | Removed a index from the table
@param string $name | [
"Removed",
"a",
"index",
"from",
"the",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1060-L1070 |
propelorm/Propel | generator/lib/model/Table.php | Table.addIndex | public function addIndex($idxdata)
{
if ($idxdata instanceof Index) {
$index = $idxdata;
$index->setTable($this);
$index->getName(); // we call this method so that the name is created now if it doesn't already exist.
$this->indices[] = $index;
ret... | php | public function addIndex($idxdata)
{
if ($idxdata instanceof Index) {
$index = $idxdata;
$index->setTable($this);
$index->getName(); // we call this method so that the name is created now if it doesn't already exist.
$this->indices[] = $index;
ret... | [
"public",
"function",
"addIndex",
"(",
"$",
"idxdata",
")",
"{",
"if",
"(",
"$",
"idxdata",
"instanceof",
"Index",
")",
"{",
"$",
"index",
"=",
"$",
"idxdata",
";",
"$",
"index",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"$",
"index",
"->",
"ge... | Adds a new index to the index list and set the
parent table of the column to the current table | [
"Adds",
"a",
"new",
"index",
"to",
"the",
"index",
"list",
"and",
"set",
"the",
"parent",
"table",
"of",
"the",
"column",
"to",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1095-L1110 |
propelorm/Propel | generator/lib/model/Table.php | Table.addUnique | public function addUnique($unqdata)
{
if ($unqdata instanceof Unique) {
$unique = $unqdata;
$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;
... | php | public function addUnique($unqdata)
{
if ($unqdata instanceof Unique) {
$unique = $unqdata;
$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;
... | [
"public",
"function",
"addUnique",
"(",
"$",
"unqdata",
")",
"{",
"if",
"(",
"$",
"unqdata",
"instanceof",
"Unique",
")",
"{",
"$",
"unique",
"=",
"$",
"unqdata",
";",
"$",
"unique",
"->",
"setTable",
"(",
"$",
"this",
")",
";",
"$",
"unique",
"->",
... | Adds a new Unique to the Unique list and set the
parent table of the column to the current table | [
"Adds",
"a",
"new",
"Unique",
"to",
"the",
"Unique",
"list",
"and",
"set",
"the",
"parent",
"table",
"of",
"the",
"column",
"to",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1116-L1131 |
propelorm/Propel | generator/lib/model/Table.php | Table.getEarlyBehaviors | public function getEarlyBehaviors()
{
$behaviors = array();
foreach ($this->behaviors as $name => $behavior) {
if ($behavior->isEarly()) {
$behaviors[$name] = $behavior;
}
}
return $behaviors;
} | php | public function getEarlyBehaviors()
{
$behaviors = array();
foreach ($this->behaviors as $name => $behavior) {
if ($behavior->isEarly()) {
$behaviors[$name] = $behavior;
}
}
return $behaviors;
} | [
"public",
"function",
"getEarlyBehaviors",
"(",
")",
"{",
"$",
"behaviors",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"behaviors",
"as",
"$",
"name",
"=>",
"$",
"behavior",
")",
"{",
"if",
"(",
"$",
"behavior",
"->",
"isEarly",
... | Get the early table behaviors
@return Behavior[] | [
"Get",
"the",
"early",
"table",
"behaviors"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1180-L1190 |
propelorm/Propel | generator/lib/model/Table.php | Table.getAdditionalBuilders | public function getAdditionalBuilders()
{
$additionalBuilders = array();
foreach ($this->getBehaviors() as $behavior) {
$additionalBuilders = array_merge($additionalBuilders, $behavior->getAdditionalBuilders());
}
return $additionalBuilders;
} | php | public function getAdditionalBuilders()
{
$additionalBuilders = array();
foreach ($this->getBehaviors() as $behavior) {
$additionalBuilders = array_merge($additionalBuilders, $behavior->getAdditionalBuilders());
}
return $additionalBuilders;
} | [
"public",
"function",
"getAdditionalBuilders",
"(",
")",
"{",
"$",
"additionalBuilders",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBehaviors",
"(",
")",
"as",
"$",
"behavior",
")",
"{",
"$",
"additionalBuilders",
"=",
"array_merge",... | Get the additional builders provided by the table behaviors
@return array list of builder class names | [
"Get",
"the",
"additional",
"builders",
"provided",
"by",
"the",
"table",
"behaviors"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1238-L1246 |
propelorm/Propel | generator/lib/model/Table.php | Table.getName | public function getName()
{
if ($this->schema && $this->getDatabase() && $this->getDatabase()->getPlatform() && $this->getDatabase()->getPlatform()->supportsSchemas()) {
return $this->schema . '.' . $this->commonName;
} else {
return $this->commonName;
}
} | php | public function getName()
{
if ($this->schema && $this->getDatabase() && $this->getDatabase()->getPlatform() && $this->getDatabase()->getPlatform()->supportsSchemas()) {
return $this->schema . '.' . $this->commonName;
} else {
return $this->commonName;
}
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"schema",
"&&",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"&&",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"->",
"getPlatform",
"(",
")",
"&&",
"$",
"this",
"->",
"get... | Get the name of the Table | [
"Get",
"the",
"name",
"of",
"the",
"Table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1251-L1258 |
propelorm/Propel | generator/lib/model/Table.php | Table.getPhpName | public function getPhpName()
{
if ($this->phpName === null) {
$inputs = array();
$inputs[] = $this->getStdSeparatedName();
$inputs[] = $this->phpNamingMethod;
try {
$this->phpName = NameFactory::generateName(NameFactory::PHP_GENERATOR, $inputs)... | php | public function getPhpName()
{
if ($this->phpName === null) {
$inputs = array();
$inputs[] = $this->getStdSeparatedName();
$inputs[] = $this->phpNamingMethod;
try {
$this->phpName = NameFactory::generateName(NameFactory::PHP_GENERATOR, $inputs)... | [
"public",
"function",
"getPhpName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"phpName",
"===",
"null",
")",
"{",
"$",
"inputs",
"=",
"array",
"(",
")",
";",
"$",
"inputs",
"[",
"]",
"=",
"$",
"this",
"->",
"getStdSeparatedName",
"(",
")",
";",
... | Get name to use in PHP sources
@return string | [
"Get",
"name",
"to",
"use",
"in",
"PHP",
"sources"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1291-L1306 |
propelorm/Propel | generator/lib/model/Table.php | Table.getDefaultStringFormat | public function getDefaultStringFormat()
{
if (!$this->defaultStringFormat && $this->getDatabase() && $this->getDatabase()->getDefaultStringFormat()) {
return $this->getDatabase()->getDefaultStringFormat();
}
return $this->defaultStringFormat;
} | php | public function getDefaultStringFormat()
{
if (!$this->defaultStringFormat && $this->getDatabase() && $this->getDatabase()->getDefaultStringFormat()) {
return $this->getDatabase()->getDefaultStringFormat();
}
return $this->defaultStringFormat;
} | [
"public",
"function",
"getDefaultStringFormat",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"defaultStringFormat",
"&&",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"&&",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"->",
"getDefaultStringFormat",
"(",
... | Get the default string format for ActiveRecord objects in this Table,
or the one for the whole database if not set.
@return string The default string representation | [
"Get",
"the",
"default",
"string",
"format",
"for",
"ActiveRecord",
"objects",
"in",
"this",
"Table",
"or",
"the",
"one",
"for",
"the",
"whole",
"database",
"if",
"not",
"set",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1373-L1380 |
propelorm/Propel | generator/lib/model/Table.php | Table.getNumLazyLoadColumns | public function getNumLazyLoadColumns()
{
$count = 0;
foreach ($this->columnList as $col) {
if ($col->isLazyLoad()) {
$count++;
}
}
return $count;
} | php | public function getNumLazyLoadColumns()
{
$count = 0;
foreach ($this->columnList as $col) {
if ($col->isLazyLoad()) {
$count++;
}
}
return $count;
} | [
"public",
"function",
"getNumLazyLoadColumns",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"columnList",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"->",
"isLazyLoad",
"(",
")",
")",
"{",
"$",
"count",
"++... | Utility method to get the number of columns in this table | [
"Utility",
"method",
"to",
"get",
"the",
"number",
"of",
"columns",
"in",
"this",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1570-L1580 |
propelorm/Propel | generator/lib/model/Table.php | Table.hasEnumColumns | public function hasEnumColumns()
{
foreach ($this->getColumns() as $col) {
if ($col->isEnumType() || $col->getValueSet()) {
return true;
}
}
return false;
} | php | public function hasEnumColumns()
{
foreach ($this->getColumns() as $col) {
if ($col->isEnumType() || $col->getValueSet()) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasEnumColumns",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getColumns",
"(",
")",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"->",
"isEnumType",
"(",
")",
"||",
"$",
"col",
"->",
"getValueSet",
"(",
")",
")",... | Checks whether one of the columns is of type ENUM
@return boolean | [
"Checks",
"whether",
"one",
"of",
"the",
"columns",
"is",
"of",
"type",
"ENUM"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1587-L1597 |
propelorm/Propel | generator/lib/model/Table.php | Table.hasColumn | public function hasColumn($col, $caseInsensitive = false)
{
if ($col instanceof Column) {
$col = $col->getName();
}
if ($caseInsensitive) {
return array_key_exists(strtolower($col), $this->columnsByLowercaseName);
} else {
return array_key_exists($... | php | public function hasColumn($col, $caseInsensitive = false)
{
if ($col instanceof Column) {
$col = $col->getName();
}
if ($caseInsensitive) {
return array_key_exists(strtolower($col), $this->columnsByLowercaseName);
} else {
return array_key_exists($... | [
"public",
"function",
"hasColumn",
"(",
"$",
"col",
",",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"col",
"instanceof",
"Column",
")",
"{",
"$",
"col",
"=",
"$",
"col",
"->",
"getName",
"(",
")",
";",
"}",
"if",
"(",
"$",
"c... | Check whether the table has a column.
@param Column|string $col the column object or name (e.g. 'my_column')
@param boolean $caseInsensitive Whether the check is case insensitive. False by default.
@return boolean | [
"Check",
"whether",
"the",
"table",
"has",
"a",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1656-L1666 |
propelorm/Propel | generator/lib/model/Table.php | Table.getForeignKeysReferencingTable | public function getForeignKeysReferencingTable($tablename)
{
$matches = array();
$keys = $this->getForeignKeys();
foreach ($keys as $fk) {
if ($fk->getForeignTableName() === $tablename) {
$matches[] = $fk;
}
}
return $matches;
} | php | public function getForeignKeysReferencingTable($tablename)
{
$matches = array();
$keys = $this->getForeignKeys();
foreach ($keys as $fk) {
if ($fk->getForeignTableName() === $tablename) {
$matches[] = $fk;
}
}
return $matches;
} | [
"public",
"function",
"getForeignKeysReferencingTable",
"(",
"$",
"tablename",
")",
"{",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"$",
"keys",
"=",
"$",
"this",
"->",
"getForeignKeys",
"(",
")",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"fk",
")... | Get all the foreign keys from this table to the specified table.
@return array ForeignKey[] | [
"Get",
"all",
"the",
"foreign",
"keys",
"from",
"this",
"table",
"to",
"the",
"specified",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1708-L1719 |
propelorm/Propel | generator/lib/model/Table.php | Table.appendXml | public function appendXml(DOMNode $node)
{
$doc = ($node instanceof DOMDocument) ? $node : $node->ownerDocument;
$tableNode = $node->appendChild($doc->createElement('table'));
$tableNode->setAttribute('name', $this->getCommonName());
if ($this->getSchema() !== null) {
$... | php | public function appendXml(DOMNode $node)
{
$doc = ($node instanceof DOMDocument) ? $node : $node->ownerDocument;
$tableNode = $node->appendChild($doc->createElement('table'));
$tableNode->setAttribute('name', $this->getCommonName());
if ($this->getSchema() !== null) {
$... | [
"public",
"function",
"appendXml",
"(",
"DOMNode",
"$",
"node",
")",
"{",
"$",
"doc",
"=",
"(",
"$",
"node",
"instanceof",
"DOMDocument",
")",
"?",
"$",
"node",
":",
"$",
"node",
"->",
"ownerDocument",
";",
"$",
"tableNode",
"=",
"$",
"node",
"->",
"... | Appends XML nodes to passed-in DOMNode.
@param DOMNode $node | [
"Appends",
"XML",
"nodes",
"to",
"passed",
"-",
"in",
"DOMNode",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1821-L1923 |
propelorm/Propel | generator/lib/model/Table.php | Table.getPrimaryKey | public function getPrimaryKey()
{
$pk = array();
foreach ($this->columnList as $col) {
if ($col->isPrimaryKey()) {
$pk[] = $col;
}
}
return $pk;
} | php | public function getPrimaryKey()
{
$pk = array();
foreach ($this->columnList as $col) {
if ($col->isPrimaryKey()) {
$pk[] = $col;
}
}
return $pk;
} | [
"public",
"function",
"getPrimaryKey",
"(",
")",
"{",
"$",
"pk",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"columnList",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"->",
"isPrimaryKey",
"(",
")",
")",
"{",
"$",
"pk",... | Returns the collection of Columns which make up the single primary
key for this table.
@return Column[] A list of the primary key parts. | [
"Returns",
"the",
"collection",
"of",
"Columns",
"which",
"make",
"up",
"the",
"single",
"primary",
"key",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1931-L1941 |
propelorm/Propel | generator/lib/model/Table.php | Table.hasAutoIncrementPrimaryKey | public function hasAutoIncrementPrimaryKey()
{
if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
$pks = $this->getPrimaryKey();
foreach ($pks as $pk) {
if ($pk->isAutoIncrement()) {
return true;
}
}
}
... | php | public function hasAutoIncrementPrimaryKey()
{
if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
$pks = $this->getPrimaryKey();
foreach ($pks as $pk) {
if ($pk->isAutoIncrement()) {
return true;
}
}
}
... | [
"public",
"function",
"hasAutoIncrementPrimaryKey",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIdMethod",
"(",
")",
"!=",
"IDMethod",
"::",
"NO_ID_METHOD",
")",
"{",
"$",
"pks",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"foreach",
"("... | Determine whether this table has any auto-increment primary key(s).
@return boolean Whether this table has a non-"none" id method and has a primary key column that is auto-increment. | [
"Determine",
"whether",
"this",
"table",
"has",
"any",
"auto",
"-",
"increment",
"primary",
"key",
"(",
"s",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L1981-L1993 |
propelorm/Propel | generator/lib/model/Table.php | Table.getAutoIncrementPrimaryKey | public function getAutoIncrementPrimaryKey()
{
if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
$pks = $this->getPrimaryKey();
foreach ($pks as $pk) {
if ($pk->isAutoIncrement()) {
return $pk;
}
}
}
... | php | public function getAutoIncrementPrimaryKey()
{
if ($this->getIdMethod() != IDMethod::NO_ID_METHOD) {
$pks = $this->getPrimaryKey();
foreach ($pks as $pk) {
if ($pk->isAutoIncrement()) {
return $pk;
}
}
}
... | [
"public",
"function",
"getAutoIncrementPrimaryKey",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIdMethod",
"(",
")",
"!=",
"IDMethod",
"::",
"NO_ID_METHOD",
")",
"{",
"$",
"pks",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"foreach",
"("... | Gets the auto increment PK
@return Column|null | [
"Gets",
"the",
"auto",
"increment",
"PK"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L2000-L2012 |
propelorm/Propel | generator/lib/model/Table.php | Table.printList | private function printList($list)
{
$result = "";
$comma = 0;
for ($i = 0, $_i = count($list); $i < $_i; $i++) {
$col = $list[$i];
if ($col->isPrimaryKey()) {
$result .= ($comma++ ? ',' : '') . $this->getDatabase()->getPlatform()->quoteIdentifier($col-... | php | private function printList($list)
{
$result = "";
$comma = 0;
for ($i = 0, $_i = count($list); $i < $_i; $i++) {
$col = $list[$i];
if ($col->isPrimaryKey()) {
$result .= ($comma++ ? ',' : '') . $this->getDatabase()->getPlatform()->quoteIdentifier($col-... | [
"private",
"function",
"printList",
"(",
"$",
"list",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"$",
"comma",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"_i",
"=",
"count",
"(",
"$",
"list",
")",
";",
"$",
"i",
"<",
"$",
"_i"... | Returns the elements of the list, separated by commas.
@param array $list
@return A CSV list.
@deprecated Use the Platform::getColumnListDDL() method. | [
"Returns",
"the",
"elements",
"of",
"the",
"list",
"separated",
"by",
"commas",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Table.php#L2053-L2065 |
propelorm/Propel | generator/lib/model/Domain.php | Domain.copy | public function copy(Domain $domain)
{
$this->defaultValue = $domain->getDefaultValue();
$this->description = $domain->getDescription();
$this->name = $domain->getName();
$this->scale = $domain->getScale();
$this->size = $domain->getSize();
$this->sqlType = $domain->g... | php | public function copy(Domain $domain)
{
$this->defaultValue = $domain->getDefaultValue();
$this->description = $domain->getDescription();
$this->name = $domain->getName();
$this->scale = $domain->getScale();
$this->size = $domain->getSize();
$this->sqlType = $domain->g... | [
"public",
"function",
"copy",
"(",
"Domain",
"$",
"domain",
")",
"{",
"$",
"this",
"->",
"defaultValue",
"=",
"$",
"domain",
"->",
"getDefaultValue",
"(",
")",
";",
"$",
"this",
"->",
"description",
"=",
"$",
"domain",
"->",
"getDescription",
"(",
")",
... | Copy the values from current object into passed-in Domain.
@param Domain $domain Domain to copy values into. | [
"Copy",
"the",
"values",
"from",
"current",
"object",
"into",
"passed",
"-",
"in",
"Domain",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Domain.php#L86-L95 |
propelorm/Propel | generator/lib/model/Domain.php | Domain.setupObject | protected function setupObject()
{
$schemaType = strtoupper($this->getAttribute("type"));
$this->copy($this->getDatabase()->getPlatform()->getDomainForType($schemaType));
//Name
$this->name = $this->getAttribute("name");
// Default value
$defval = $this->getAttribut... | php | protected function setupObject()
{
$schemaType = strtoupper($this->getAttribute("type"));
$this->copy($this->getDatabase()->getPlatform()->getDomainForType($schemaType));
//Name
$this->name = $this->getAttribute("name");
// Default value
$defval = $this->getAttribut... | [
"protected",
"function",
"setupObject",
"(",
")",
"{",
"$",
"schemaType",
"=",
"strtoupper",
"(",
"$",
"this",
"->",
"getAttribute",
"(",
"\"type\"",
")",
")",
";",
"$",
"this",
"->",
"copy",
"(",
"$",
"this",
"->",
"getDatabase",
"(",
")",
"->",
"getP... | Sets up the Domain object based on the attributes that were passed to loadFromXML().
@see parent::loadFromXML() | [
"Sets",
"up",
"the",
"Domain",
"object",
"based",
"on",
"the",
"attributes",
"that",
"were",
"passed",
"to",
"loadFromXML",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Domain.php#L102-L121 |
propelorm/Propel | generator/lib/model/Domain.php | Domain.getPhpDefaultValue | public function getPhpDefaultValue()
{
if ($this->defaultValue === null) {
return null;
}
if ($this->defaultValue->isExpression()) {
throw new EngineException("Cannot get PHP version of default value for default value EXPRESSION.");
}
if ($this->prop... | php | public function getPhpDefaultValue()
{
if ($this->defaultValue === null) {
return null;
}
if ($this->defaultValue->isExpression()) {
throw new EngineException("Cannot get PHP version of default value for default value EXPRESSION.");
}
if ($this->prop... | [
"public",
"function",
"getPhpDefaultValue",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"defaultValue",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"defaultValue",
"->",
"isExpression",
"(",
")",
")",
"{",
"throw... | Gets the default value, type-casted for use in PHP OM.
@return mixed
@see getDefaultValue()
@throws EngineException | [
"Gets",
"the",
"default",
"value",
"type",
"-",
"casted",
"for",
"use",
"in",
"PHP",
"OM",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Domain.php#L276-L295 |
propelorm/Propel | generator/lib/model/Domain.php | Domain.printSize | public function printSize()
{
if ($this->size !== null && $this->scale !== null) {
return '(' . $this->size . ',' . $this->scale . ')';
} elseif ($this->size !== null) {
return '(' . $this->size . ')';
} else {
return "";
}
} | php | public function printSize()
{
if ($this->size !== null && $this->scale !== null) {
return '(' . $this->size . ',' . $this->scale . ')';
} elseif ($this->size !== null) {
return '(' . $this->size . ')';
} else {
return "";
}
} | [
"public",
"function",
"printSize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"size",
"!==",
"null",
"&&",
"$",
"this",
"->",
"scale",
"!==",
"null",
")",
"{",
"return",
"'('",
".",
"$",
"this",
"->",
"size",
".",
"','",
".",
"$",
"this",
"->",... | Return the size and scale in brackets for use in an sql schema.
@return string Size and scale or an empty String if there are no values
available. | [
"Return",
"the",
"size",
"and",
"scale",
"in",
"brackets",
"for",
"use",
"in",
"an",
"sql",
"schema",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Domain.php#L351-L360 |
propelorm/Propel | runtime/lib/util/PropelModelPager.php | PropelModelPager.getResults | public function getResults()
{
if (null === $this->results) {
$this->results = $this->getQuery()
->find($this->con);
}
return $this->results;
} | php | public function getResults()
{
if (null === $this->results) {
$this->results = $this->getQuery()
->find($this->con);
}
return $this->results;
} | [
"public",
"function",
"getResults",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"results",
")",
"{",
"$",
"this",
"->",
"results",
"=",
"$",
"this",
"->",
"getQuery",
"(",
")",
"->",
"find",
"(",
"$",
"this",
"->",
"con",
")",
";"... | Get the collection of results in the page
@return PropelCollection A collection of results | [
"Get",
"the",
"collection",
"of",
"results",
"in",
"the",
"page"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelModelPager.php#L97-L105 |
propelorm/Propel | runtime/lib/util/PropelModelPager.php | PropelModelPager.getLastIndex | public function getLastIndex()
{
if ($this->page == 0) {
return $this->nbResults;
} else {
if (($this->page * $this->maxPerPage) >= $this->nbResults) {
return $this->nbResults;
} else {
return ($this->page * $this->maxPerPage);
... | php | public function getLastIndex()
{
if ($this->page == 0) {
return $this->nbResults;
} else {
if (($this->page * $this->maxPerPage) >= $this->nbResults) {
return $this->nbResults;
} else {
return ($this->page * $this->maxPerPage);
... | [
"public",
"function",
"getLastIndex",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"page",
"==",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"nbResults",
";",
"}",
"else",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"page",
"*",
"$",
"this",
"->",
... | Get the index of the last element in the page
Always less than or equal to $maxPerPage
@return int | [
"Get",
"the",
"index",
"of",
"the",
"last",
"element",
"in",
"the",
"page",
"Always",
"less",
"than",
"or",
"equal",
"to",
"$maxPerPage"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/PropelModelPager.php#L171-L182 |
propelorm/Propel | generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php | AggregateColumnBehavior.modifyTable | public function modifyTable()
{
$table = $this->getTable();
if (!$columnName = $this->getParameter('name')) {
throw new InvalidArgumentException(sprintf('You must define a \'name\' parameter for the \'aggregate_column\' behavior in the \'%s\' table', $table->getName()));
}
... | php | public function modifyTable()
{
$table = $this->getTable();
if (!$columnName = $this->getParameter('name')) {
throw new InvalidArgumentException(sprintf('You must define a \'name\' parameter for the \'aggregate_column\' behavior in the \'%s\' table', $table->getName()));
}
... | [
"public",
"function",
"modifyTable",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"if",
"(",
"!",
"$",
"columnName",
"=",
"$",
"this",
"->",
"getParameter",
"(",
"'name'",
")",
")",
"{",
"throw",
"new",
"InvalidArgu... | Add the aggregate key to the current table | [
"Add",
"the",
"aggregate",
"key",
"to",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php#L35-L60 |
propelorm/Propel | runtime/lib/parser/yaml/sfYamlInline.php | sfYamlInline.load | public static function load($value)
{
$value = trim($value);
if (0 == strlen($value)) {
return '';
}
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('ASCII');
}
switc... | php | public static function load($value)
{
$value = trim($value);
if (0 == strlen($value)) {
return '';
}
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('ASCII');
}
switc... | [
"public",
"static",
"function",
"load",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"trim",
"(",
"$",
"value",
")",
";",
"if",
"(",
"0",
"==",
"strlen",
"(",
"$",
"value",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"function_exists",... | Convert a YAML string to a PHP array.
@param string $value A YAML string
@return array A PHP array representing the YAML string | [
"Convert",
"a",
"YAML",
"string",
"to",
"a",
"PHP",
"array",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/yaml/sfYamlInline.php#L32-L61 |
propelorm/Propel | runtime/lib/parser/yaml/sfYamlInline.php | sfYamlInline.dumpArray | protected static function dumpArray($value)
{
// array
$keys = array_keys($value);
if (
(1 == count($keys) && '0' == $keys[0])
||
(count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
{
$out... | php | protected static function dumpArray($value)
{
// array
$keys = array_keys($value);
if (
(1 == count($keys) && '0' == $keys[0])
||
(count($keys) > 1 && array_reduce($keys, create_function('$v,$w', 'return (integer) $v + $w;'), 0) == count($keys) * (count($keys) - 1) / 2))
{
$out... | [
"protected",
"static",
"function",
"dumpArray",
"(",
"$",
"value",
")",
"{",
"// array",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"value",
")",
";",
"if",
"(",
"(",
"1",
"==",
"count",
"(",
"$",
"keys",
")",
"&&",
"'0'",
"==",
"$",
"keys",
"[",
... | Dumps a PHP array to a YAML string.
@param array $value The PHP array to dump
@return string The YAML string representing the PHP array | [
"Dumps",
"a",
"PHP",
"array",
"to",
"a",
"YAML",
"string",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/yaml/sfYamlInline.php#L123-L147 |
propelorm/Propel | runtime/lib/parser/yaml/sfYamlInline.php | sfYamlInline.parseQuotedScalar | protected static function parseQuotedScalar($scalar, &$i)
{
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
}
$output = substr($match[0], 1, strlen($match[0])... | php | protected static function parseQuotedScalar($scalar, &$i)
{
if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
throw new InvalidArgumentException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i)));
}
$output = substr($match[0], 1, strlen($match[0])... | [
"protected",
"static",
"function",
"parseQuotedScalar",
"(",
"$",
"scalar",
",",
"&",
"$",
"i",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/'",
".",
"self",
"::",
"REGEX_QUOTED_STRING",
".",
"'/Au'",
",",
"substr",
"(",
"$",
"scalar",
",",
"$",
"i"... | Parses a quoted scalar to YAML.
@param string $scalar
@param integer $i
@return string A YAML string | [
"Parses",
"a",
"quoted",
"scalar",
"to",
"YAML",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/yaml/sfYamlInline.php#L196-L215 |
propelorm/Propel | runtime/lib/parser/yaml/sfYamlInline.php | sfYamlInline.parseSequence | protected static function parseSequence($sequence, &$i = 0)
{
$output = array();
$len = strlen($sequence);
$i += 1;
// [foo, bar, ...]
while ($i < $len) {
switch ($sequence[$i]) {
case '[':
// nested sequence
$output[] = self::parseSequence($sequence, $i);
... | php | protected static function parseSequence($sequence, &$i = 0)
{
$output = array();
$len = strlen($sequence);
$i += 1;
// [foo, bar, ...]
while ($i < $len) {
switch ($sequence[$i]) {
case '[':
// nested sequence
$output[] = self::parseSequence($sequence, $i);
... | [
"protected",
"static",
"function",
"parseSequence",
"(",
"$",
"sequence",
",",
"&",
"$",
"i",
"=",
"0",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"sequence",
")",
";",
"$",
"i",
"+=",
"1",
";",
"... | Parses a sequence to a YAML string.
@param string $sequence
@param integer $i
@return string A YAML string | [
"Parses",
"a",
"sequence",
"to",
"a",
"YAML",
"string",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/yaml/sfYamlInline.php#L225-L269 |
propelorm/Propel | generator/lib/behavior/sortable/SortableBehavior.php | SortableBehavior.modifyTable | public function modifyTable()
{
$table = $this->getTable();
if (!$table->containsColumn($this->getParameter('rank_column'))) {
$table->addColumn(array(
'name' => $this->getParameter('rank_column'),
'type' => 'INTEGER'
));
}
if ... | php | public function modifyTable()
{
$table = $this->getTable();
if (!$table->containsColumn($this->getParameter('rank_column'))) {
$table->addColumn(array(
'name' => $this->getParameter('rank_column'),
'type' => 'INTEGER'
));
}
if ... | [
"public",
"function",
"modifyTable",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"if",
"(",
"!",
"$",
"table",
"->",
"containsColumn",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'rank_column'",
")",
")",
")",
"{... | Add the rank_column to the current table | [
"Add",
"the",
"rank_column",
"to",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/sortable/SortableBehavior.php#L39-L79 |
propelorm/Propel | generator/lib/behavior/sortable/SortableBehavior.php | SortableBehavior.addParameter | public function addParameter($attribute)
{
if ('scope_column' === $attribute['name']) {
$this->parameters['scope_column'] .= ($this->parameters['scope_column'] ? ',' : '') . $attribute['value'];
} else {
parent::addParameter($attribute);
}
} | php | public function addParameter($attribute)
{
if ('scope_column' === $attribute['name']) {
$this->parameters['scope_column'] .= ($this->parameters['scope_column'] ? ',' : '') . $attribute['value'];
} else {
parent::addParameter($attribute);
}
} | [
"public",
"function",
"addParameter",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"'scope_column'",
"===",
"$",
"attribute",
"[",
"'name'",
"]",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"'scope_column'",
"]",
".=",
"(",
"$",
"this",
"->",
"paramet... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/sortable/SortableBehavior.php#L159-L166 |
propelorm/Propel | generator/lib/builder/om/PHP5TableMapBuilder.php | PHP5TableMapBuilder.addClassOpen | protected function addClassOpen(&$script)
{
$table = $this->getTable();
$script .= "
/**
* This class defines the structure of the '" . $table->getName() . "' table.
*
*";
if ($this->getBuildProperty('addTimeStamp')) {
$now = strftime('%c');
$script .= "
* This c... | php | protected function addClassOpen(&$script)
{
$table = $this->getTable();
$script .= "
/**
* This class defines the structure of the '" . $table->getName() . "' table.
*
*";
if ($this->getBuildProperty('addTimeStamp')) {
$now = strftime('%c');
$script .= "
* This c... | [
"protected",
"function",
"addClassOpen",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"script",
".=",
"\"\n\n/**\n * This class defines the structure of the '\"",
".",
"$",
"table",
"->",
"getName",
"... | Adds class phpdoc comment and opening of class.
@param string &$script The script will be modified in this method. | [
"Adds",
"class",
"phpdoc",
"comment",
"and",
"opening",
"of",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5TableMapBuilder.php#L67-L96 |
propelorm/Propel | generator/lib/builder/om/PHP5TableMapBuilder.php | PHP5TableMapBuilder.addClassBody | protected function addClassBody(&$script)
{
$this->declareClasses('TableMap', 'RelationMap');
$this->addConstants($script);
$this->addAttributes($script);
$this->addInitialize($script);
$this->addBuildRelations($script);
$this->addGetBehaviors($script);
} | php | protected function addClassBody(&$script)
{
$this->declareClasses('TableMap', 'RelationMap');
$this->addConstants($script);
$this->addAttributes($script);
$this->addInitialize($script);
$this->addBuildRelations($script);
$this->addGetBehaviors($script);
} | [
"protected",
"function",
"addClassBody",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"declareClasses",
"(",
"'TableMap'",
",",
"'RelationMap'",
")",
";",
"$",
"this",
"->",
"addConstants",
"(",
"$",
"script",
")",
";",
"$",
"this",
"->",
"addAt... | Specifies the methods that are added as part of the map builder class.
This can be overridden by subclasses that wish to add more methods.
@see ObjectBuilder::addClassBody() | [
"Specifies",
"the",
"methods",
"that",
"are",
"added",
"as",
"part",
"of",
"the",
"map",
"builder",
"class",
".",
"This",
"can",
"be",
"overridden",
"by",
"subclasses",
"that",
"wish",
"to",
"add",
"more",
"methods",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5TableMapBuilder.php#L104-L112 |
propelorm/Propel | generator/lib/builder/om/PHP5TableMapBuilder.php | PHP5TableMapBuilder.addInitialize | protected function addInitialize(&$script)
{
$table = $this->getTable();
$platform = $this->getPlatform();
$script .= "
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @retur... | php | protected function addInitialize(&$script)
{
$table = $this->getTable();
$platform = $this->getPlatform();
$script .= "
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @retur... | [
"protected",
"function",
"addInitialize",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"platform",
"=",
"$",
"this",
"->",
"getPlatform",
"(",
")",
";",
"$",
"script",
".=",
"\"\n /**\n ... | Adds the addInitialize() method to the table map class.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"addInitialize",
"()",
"method",
"to",
"the",
"table",
"map",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5TableMapBuilder.php#L156-L268 |
propelorm/Propel | generator/lib/builder/om/PHP5TableMapBuilder.php | PHP5TableMapBuilder.addBuildRelations | protected function addBuildRelations(&$script)
{
$script .= "
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{";
foreach ($this->getTable()->getForeignKeys() as $fkey) {
$columnMapping = 'array(';
for... | php | protected function addBuildRelations(&$script)
{
$script .= "
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{";
foreach ($this->getTable()->getForeignKeys() as $fkey) {
$columnMapping = 'array(';
for... | [
"protected",
"function",
"addBuildRelations",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"script",
".=",
"\"\n /**\n * Build the RelationMap objects for this table relationships\n */\n public function buildRelations()\n {\"",
";",
"foreach",
"(",
"$",
"this",
"->",
... | Adds the method that build the RelationMap objects
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"method",
"that",
"build",
"the",
"RelationMap",
"objects"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5TableMapBuilder.php#L275-L323 |
propelorm/Propel | generator/lib/builder/om/PHP5TableMapBuilder.php | PHP5TableMapBuilder.addGetBehaviors | protected function addGetBehaviors(&$script)
{
if ($behaviors = $this->getTable()->getBehaviors()) {
$script .= "
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function... | php | protected function addGetBehaviors(&$script)
{
if ($behaviors = $this->getTable()->getBehaviors()) {
$script .= "
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function... | [
"protected",
"function",
"addGetBehaviors",
"(",
"&",
"$",
"script",
")",
"{",
"if",
"(",
"$",
"behaviors",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getBehaviors",
"(",
")",
")",
"{",
"$",
"script",
".=",
"\"\n /**\n *\n * Gets the lis... | Adds the behaviors getter
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"behaviors",
"getter"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5TableMapBuilder.php#L330-L352 |
propelorm/Propel | generator/lib/model/Rule.php | Rule.setupObject | protected function setupObject()
{
$this->name = $this->getAttribute("name");
$this->value = $this->getAttribute("value");
$this->classname = $this->getAttribute("class");
/*
* Set some default values if they are not specified.
* This is especially useful for maxLeng... | php | protected function setupObject()
{
$this->name = $this->getAttribute("name");
$this->value = $this->getAttribute("value");
$this->classname = $this->getAttribute("class");
/*
* Set some default values if they are not specified.
* This is especially useful for maxLeng... | [
"protected",
"function",
"setupObject",
"(",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"\"name\"",
")",
";",
"$",
"this",
"->",
"value",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"\"value\"",
")",
";",
"$",
... | Sets up the Rule object based on the attributes that were passed to loadFromXML().
@see parent::loadFromXML() | [
"Sets",
"up",
"the",
"Rule",
"object",
"based",
"on",
"the",
"attributes",
"that",
"were",
"passed",
"to",
"loadFromXML",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Rule.php#L35-L61 |
propelorm/Propel | generator/lib/model/Rule.php | Rule.getClass | public function getClass()
{
if ($this->classname === null && $this->name !== null) {
return "propel.validator." . ucfirst($this->name) . "Validator";
}
return $this->classname;
} | php | public function getClass()
{
if ($this->classname === null && $this->name !== null) {
return "propel.validator." . ucfirst($this->name) . "Validator";
}
return $this->classname;
} | [
"public",
"function",
"getClass",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"classname",
"===",
"null",
"&&",
"$",
"this",
"->",
"name",
"!==",
"null",
")",
"{",
"return",
"\"propel.validator.\"",
".",
"ucfirst",
"(",
"$",
"this",
"->",
"name",
")",... | Gets the dot-path name of class to use for rule.
If no class was specified, this method will build a default classname
based on the 'name' attribute. E.g. 'maxLength' -> 'propel.validator.MaxLengthValidator'
@return string dot-path classname (e.g. myapp.propel.MyValidator) | [
"Gets",
"the",
"dot",
"-",
"path",
"name",
"of",
"class",
"to",
"use",
"for",
"rule",
".",
"If",
"no",
"class",
"was",
"specified",
"this",
"method",
"will",
"build",
"a",
"default",
"classname",
"based",
"on",
"the",
"name",
"attribute",
".",
"E",
"."... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Rule.php#L104-L111 |
propelorm/Propel | runtime/lib/parser/PropelXMLParser.php | PropelXMLParser.getRootNode | protected function getRootNode($rootElementName = 'data')
{
$xml = new DOMDocument('1.0', 'UTF-8');
$xml->preserveWhiteSpace = false;
$xml->formatOutput = true;
$rootElement = $xml->createElement($rootElementName);
$xml->appendChild($rootElement);
return $rootElement... | php | protected function getRootNode($rootElementName = 'data')
{
$xml = new DOMDocument('1.0', 'UTF-8');
$xml->preserveWhiteSpace = false;
$xml->formatOutput = true;
$rootElement = $xml->createElement($rootElementName);
$xml->appendChild($rootElement);
return $rootElement... | [
"protected",
"function",
"getRootNode",
"(",
"$",
"rootElementName",
"=",
"'data'",
")",
"{",
"$",
"xml",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"xml",
"->",
"preserveWhiteSpace",
"=",
"false",
";",
"$",
"xml",
"->",
"for... | Create a DOMDocument and get the root DOMNode using a root element name
@param string $rootElementName The Root Element Name
@return DOMNode The root DOMNode | [
"Create",
"a",
"DOMDocument",
"and",
"get",
"the",
"root",
"DOMNode",
"using",
"a",
"root",
"element",
"name"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/PropelXMLParser.php#L52-L61 |
propelorm/Propel | runtime/lib/parser/PropelXMLParser.php | PropelXMLParser.arrayToDOM | protected function arrayToDOM($array, $rootElement, $charset = null, $removeNumbersFromKeys = false)
{
foreach ($array as $key => $value) {
if ($removeNumbersFromKeys) {
$key = preg_replace('/[^a-z]/i', '', $key);
}
$element = $rootElement->ownerDocument->... | php | protected function arrayToDOM($array, $rootElement, $charset = null, $removeNumbersFromKeys = false)
{
foreach ($array as $key => $value) {
if ($removeNumbersFromKeys) {
$key = preg_replace('/[^a-z]/i', '', $key);
}
$element = $rootElement->ownerDocument->... | [
"protected",
"function",
"arrayToDOM",
"(",
"$",
"array",
",",
"$",
"rootElement",
",",
"$",
"charset",
"=",
"null",
",",
"$",
"removeNumbersFromKeys",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{"... | @param array $array
@param DOMElement $rootElement
@param string $charset
@param boolean $removeNumbersFromKeys
@return DOMElement | [
"@param",
"array",
"$array",
"@param",
"DOMElement",
"$rootElement",
"@param",
"string",
"$charset",
"@param",
"boolean",
"$removeNumbersFromKeys"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/PropelXMLParser.php#L99-L126 |
propelorm/Propel | runtime/lib/parser/PropelXMLParser.php | PropelXMLParser.toArray | public function toArray($data)
{
$doc = new DomDocument('1.0', 'UTF-8');
$doc->loadXML($data);
$element = $doc->documentElement;
return $this->convertDOMElementToArray($element);
} | php | public function toArray($data)
{
$doc = new DomDocument('1.0', 'UTF-8');
$doc->loadXML($data);
$element = $doc->documentElement;
return $this->convertDOMElementToArray($element);
} | [
"public",
"function",
"toArray",
"(",
"$",
"data",
")",
"{",
"$",
"doc",
"=",
"new",
"DomDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"doc",
"->",
"loadXML",
"(",
"$",
"data",
")",
";",
"$",
"element",
"=",
"$",
"doc",
"->",
"documentEle... | Converts data from XML to an associative array.
@param string $data Source data to convert, as an XML string
@return array Converted data | [
"Converts",
"data",
"from",
"XML",
"to",
"an",
"associative",
"array",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/PropelXMLParser.php#L135-L142 |
propelorm/Propel | generator/lib/behavior/archivable/ArchivableBehaviorQueryBuilderModifier.php | ArchivableBehaviorQueryBuilderModifier.queryMethods | public function queryMethods(QueryBuilder $builder)
{
$script = '';
$script .= $this->addArchive($builder);
if ($this->behavior->isArchiveOnUpdate()) {
$script .= $this->addSetArchiveOnUpdate($builder);
$script .= $this->addUpdateWithoutArchive($builder);
}
... | php | public function queryMethods(QueryBuilder $builder)
{
$script = '';
$script .= $this->addArchive($builder);
if ($this->behavior->isArchiveOnUpdate()) {
$script .= $this->addSetArchiveOnUpdate($builder);
$script .= $this->addUpdateWithoutArchive($builder);
}
... | [
"public",
"function",
"queryMethods",
"(",
"QueryBuilder",
"$",
"builder",
")",
"{",
"$",
"script",
"=",
"''",
";",
"$",
"script",
".=",
"$",
"this",
"->",
"addArchive",
"(",
"$",
"builder",
")",
";",
"if",
"(",
"$",
"this",
"->",
"behavior",
"->",
"... | @param QueryBuilder $builder
@return string the PHP code to be added to the builder | [
"@param",
"QueryBuilder",
"$builder"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/archivable/ArchivableBehaviorQueryBuilderModifier.php#L94-L108 |
propelorm/Propel | generator/lib/task/PropelSQLTask.php | PropelSQLTask.createSqlDbMap | protected function createSqlDbMap()
{
if ($this->getSqlDbMap() === null) {
return;
}
// Produce the sql -> database map
$sqldbmap = new Properties();
// Check to see if the sqldbmap has already been created.
if ($this->getSqlDbMap()->exists()) {
... | php | protected function createSqlDbMap()
{
if ($this->getSqlDbMap() === null) {
return;
}
// Produce the sql -> database map
$sqldbmap = new Properties();
// Check to see if the sqldbmap has already been created.
if ($this->getSqlDbMap()->exists()) {
... | [
"protected",
"function",
"createSqlDbMap",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getSqlDbMap",
"(",
")",
"===",
"null",
")",
"{",
"return",
";",
"}",
"// Produce the sql -> database map",
"$",
"sqldbmap",
"=",
"new",
"Properties",
"(",
")",
";",
"/... | Create the sql -> database map.
@throws IOException - if unable to store properties | [
"Create",
"the",
"sql",
"-",
">",
"database",
"map",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLTask.php#L81-L124 |
propelorm/Propel | generator/lib/task/PropelSQLTask.php | PropelSQLTask.getWarnings | public function getWarnings(Database $database, PropelPLatformInterface $platform)
{
foreach ($database->getTablesForSql() as $table) {
foreach ($table->getForeignKeys() as $fk) {
if ($platform instanceof MssqlPlatform && $fk->hasOnUpdate() && $fk->getOnUpdate() == ForeignKey::S... | php | public function getWarnings(Database $database, PropelPLatformInterface $platform)
{
foreach ($database->getTablesForSql() as $table) {
foreach ($table->getForeignKeys() as $fk) {
if ($platform instanceof MssqlPlatform && $fk->hasOnUpdate() && $fk->getOnUpdate() == ForeignKey::S... | [
"public",
"function",
"getWarnings",
"(",
"Database",
"$",
"database",
",",
"PropelPLatformInterface",
"$",
"platform",
")",
"{",
"foreach",
"(",
"$",
"database",
"->",
"getTablesForSql",
"(",
")",
"as",
"$",
"table",
")",
"{",
"foreach",
"(",
"$",
"table",
... | main() | [
"main",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLTask.php#L182-L218 |
propelorm/Propel | generator/lib/task/PropelSQLTask.php | PropelSQLTask.packageDataModels | protected function packageDataModels()
{
static $packagedDataModels;
if (is_null($packagedDataModels)) {
$dataModels = $this->getDataModels();
$dataModel = array_shift($dataModels);
$packagedDataModels = array();
$platform = $this->getGeneratorConfi... | php | protected function packageDataModels()
{
static $packagedDataModels;
if (is_null($packagedDataModels)) {
$dataModels = $this->getDataModels();
$dataModel = array_shift($dataModels);
$packagedDataModels = array();
$platform = $this->getGeneratorConfi... | [
"protected",
"function",
"packageDataModels",
"(",
")",
"{",
"static",
"$",
"packagedDataModels",
";",
"if",
"(",
"is_null",
"(",
"$",
"packagedDataModels",
")",
")",
"{",
"$",
"dataModels",
"=",
"$",
"this",
"->",
"getDataModels",
"(",
")",
";",
"$",
"dat... | Packages the datamodels to one datamodel per package
This applies only when the the packageObjectModel option is set. We need to
re-package the datamodels to allow the database package attribute to control
which tables go into which SQL file.
@return array The packaged datamodels | [
"Packages",
"the",
"datamodels",
"to",
"one",
"datamodel",
"per",
"package"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLTask.php#L229-L259 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.normalizeFKey | public function normalizeFKey($attrib)
{
if ($attrib === null || strtoupper($attrib) == "NONE") {
$attrib = self::NONE;
}
$attrib = strtoupper($attrib);
if ($attrib == "SETNULL") {
$attrib = self::SETNULL;
}
return $attrib;
} | php | public function normalizeFKey($attrib)
{
if ($attrib === null || strtoupper($attrib) == "NONE") {
$attrib = self::NONE;
}
$attrib = strtoupper($attrib);
if ($attrib == "SETNULL") {
$attrib = self::SETNULL;
}
return $attrib;
} | [
"public",
"function",
"normalizeFKey",
"(",
"$",
"attrib",
")",
"{",
"if",
"(",
"$",
"attrib",
"===",
"null",
"||",
"strtoupper",
"(",
"$",
"attrib",
")",
"==",
"\"NONE\"",
")",
"{",
"$",
"attrib",
"=",
"self",
"::",
"NONE",
";",
"}",
"$",
"attrib",
... | normalizes the input of onDelete, onUpdate attributes | [
"normalizes",
"the",
"input",
"of",
"onDelete",
"onUpdate",
"attributes"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L112-L123 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.hasOnUpdate | public function hasOnUpdate()
{
$database = $this->getTable()->getDatabase();
if($database instanceof Database &&
$this->onUpdate === $database->getPlatform()->getDefaultFKOnUpdateBehavior()) {
return false;
}
return ($this->onUpdate !== self::NONE);
} | php | public function hasOnUpdate()
{
$database = $this->getTable()->getDatabase();
if($database instanceof Database &&
$this->onUpdate === $database->getPlatform()->getDefaultFKOnUpdateBehavior()) {
return false;
}
return ($this->onUpdate !== self::NONE);
} | [
"public",
"function",
"hasOnUpdate",
"(",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getDatabase",
"(",
")",
";",
"if",
"(",
"$",
"database",
"instanceof",
"Database",
"&&",
"$",
"this",
"->",
"onUpdate",
"===",
"$"... | returns whether or not the onUpdate attribute is set | [
"returns",
"whether",
"or",
"not",
"the",
"onUpdate",
"attribute",
"is",
"set"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L128-L137 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.hasOnDelete | public function hasOnDelete()
{
$database = $this->getTable()->getDatabase();
if($database instanceof Database &&
$this->onDelete === $database->getPlatform()->getDefaultFKOnDeleteBehavior()) {
return false;
}
return ($this->onDelete !== self::NONE);
} | php | public function hasOnDelete()
{
$database = $this->getTable()->getDatabase();
if($database instanceof Database &&
$this->onDelete === $database->getPlatform()->getDefaultFKOnDeleteBehavior()) {
return false;
}
return ($this->onDelete !== self::NONE);
} | [
"public",
"function",
"hasOnDelete",
"(",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getDatabase",
"(",
")",
";",
"if",
"(",
"$",
"database",
"instanceof",
"Database",
"&&",
"$",
"this",
"->",
"onDelete",
"===",
"$"... | returns whether or not the onDelete attribute is set | [
"returns",
"whether",
"or",
"not",
"the",
"onDelete",
"attribute",
"is",
"set"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L142-L151 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getForeignTableName | public function getForeignTableName()
{
if ($this->foreignSchemaName && $this->getTable()->getDatabase()->getPlatform()->supportsSchemas()) {
return $this->foreignSchemaName . '.' . $this->foreignTableCommonName;
} else {
return $this->foreignTableCommonName;
}
} | php | public function getForeignTableName()
{
if ($this->foreignSchemaName && $this->getTable()->getDatabase()->getPlatform()->supportsSchemas()) {
return $this->foreignSchemaName . '.' . $this->foreignTableCommonName;
} else {
return $this->foreignTableCommonName;
}
} | [
"public",
"function",
"getForeignTableName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"foreignSchemaName",
"&&",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getDatabase",
"(",
")",
"->",
"getPlatform",
"(",
")",
"->",
"supportsSchemas",
"(",
")",
... | Get the foreignTableName of the FK
@return string foreign table qualified name | [
"Get",
"the",
"foreignTableName",
"of",
"the",
"FK"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L270-L277 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.addReference | public function addReference($p1, $p2 = null)
{
if (is_array($p1)) {
$this->addReference(@$p1["local"], @$p1["foreign"]);
} else {
if ($p1 instanceof Column) {
$p1 = $p1->getName();
}
if ($p2 instanceof Column) {
$p2 = $... | php | public function addReference($p1, $p2 = null)
{
if (is_array($p1)) {
$this->addReference(@$p1["local"], @$p1["foreign"]);
} else {
if ($p1 instanceof Column) {
$p1 = $p1->getName();
}
if ($p2 instanceof Column) {
$p2 = $... | [
"public",
"function",
"addReference",
"(",
"$",
"p1",
",",
"$",
"p2",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"p1",
")",
")",
"{",
"$",
"this",
"->",
"addReference",
"(",
"@",
"$",
"p1",
"[",
"\"local\"",
"]",
",",
"@",
"$",
"p1... | Adds a new reference entry to the foreign key. | [
"Adds",
"a",
"new",
"reference",
"entry",
"to",
"the",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L358-L372 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getLocalColumnObjects | public function getLocalColumnObjects()
{
$columns = array();
$localTable = $this->getTable();
foreach ($this->localColumns as $columnName) {
$columns[] = $localTable->getColumn($columnName);
}
return $columns;
} | php | public function getLocalColumnObjects()
{
$columns = array();
$localTable = $this->getTable();
foreach ($this->localColumns as $columnName) {
$columns[] = $localTable->getColumn($columnName);
}
return $columns;
} | [
"public",
"function",
"getLocalColumnObjects",
"(",
")",
"{",
"$",
"columns",
"=",
"array",
"(",
")",
";",
"$",
"localTable",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"localColumns",
"as",
"$",
"columnName",
... | Return an array of local column objects.
@return array Column[] | [
"Return",
"an",
"array",
"of",
"local",
"column",
"objects",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L418-L427 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getLocalForeignMapping | public function getLocalForeignMapping()
{
$h = array();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$h[$this->localColumns[$i]] = $this->foreignColumns[$i];
}
return $h;
} | php | public function getLocalForeignMapping()
{
$h = array();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$h[$this->localColumns[$i]] = $this->foreignColumns[$i];
}
return $h;
} | [
"public",
"function",
"getLocalForeignMapping",
"(",
")",
"{",
"$",
"h",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"size",
"=",
"count",
"(",
"$",
"this",
"->",
"localColumns",
")",
";",
"$",
"i",
"<",
"$",
"size",
... | Utility method to get local column to foreign column
mapping for this foreign key. | [
"Utility",
"method",
"to",
"get",
"local",
"column",
"to",
"foreign",
"column",
"mapping",
"for",
"this",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L453-L461 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getForeignLocalMapping | public function getForeignLocalMapping()
{
$h = array();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$h[$this->foreignColumns[$i]] = $this->localColumns[$i];
}
return $h;
} | php | public function getForeignLocalMapping()
{
$h = array();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$h[$this->foreignColumns[$i]] = $this->localColumns[$i];
}
return $h;
} | [
"public",
"function",
"getForeignLocalMapping",
"(",
")",
"{",
"$",
"h",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
"$",
"size",
"=",
"count",
"(",
"$",
"this",
"->",
"localColumns",
")",
";",
"$",
"i",
"<",
"$",
"size",
... | Utility method to get local column to foreign column
mapping for this foreign key. | [
"Utility",
"method",
"to",
"get",
"local",
"column",
"to",
"foreign",
"column",
"mapping",
"for",
"this",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L467-L475 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getColumnObjectsMapping | public function getColumnObjectsMapping()
{
$mapping = array();
$localTable = $this->getTable();
$foreignTable = $this->getForeignTable();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$mapping[]= array(
'local' => $localTable->get... | php | public function getColumnObjectsMapping()
{
$mapping = array();
$localTable = $this->getTable();
$foreignTable = $this->getForeignTable();
for ($i = 0, $size = count($this->localColumns); $i < $size; $i++) {
$mapping[]= array(
'local' => $localTable->get... | [
"public",
"function",
"getColumnObjectsMapping",
"(",
")",
"{",
"$",
"mapping",
"=",
"array",
"(",
")",
";",
"$",
"localTable",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"foreignTable",
"=",
"$",
"this",
"->",
"getForeignTable",
"(",
")",
... | Utility method to get local and foreign column objects
mapping for this foreign key. | [
"Utility",
"method",
"to",
"get",
"local",
"and",
"foreign",
"column",
"objects",
"mapping",
"for",
"this",
"foreign",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L481-L494 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getMappedForeignColumn | public function getMappedForeignColumn($local)
{
$m = $this->getLocalForeignMapping();
if (isset($m[$local])) {
return $m[$local];
}
return null;
} | php | public function getMappedForeignColumn($local)
{
$m = $this->getLocalForeignMapping();
if (isset($m[$local])) {
return $m[$local];
}
return null;
} | [
"public",
"function",
"getMappedForeignColumn",
"(",
"$",
"local",
")",
"{",
"$",
"m",
"=",
"$",
"this",
"->",
"getLocalForeignMapping",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"m",
"[",
"$",
"local",
"]",
")",
")",
"{",
"return",
"$",
"m",
"[... | Get the foreign column mapped to specified local column.
@return string Column name. | [
"Get",
"the",
"foreign",
"column",
"mapped",
"to",
"specified",
"local",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L501-L509 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getMappedLocalColumn | public function getMappedLocalColumn($foreign)
{
$m = $this->getForeignLocalMapping();
if (isset($m[$foreign])) {
return $m[$foreign];
}
return null;
} | php | public function getMappedLocalColumn($foreign)
{
$m = $this->getForeignLocalMapping();
if (isset($m[$foreign])) {
return $m[$foreign];
}
return null;
} | [
"public",
"function",
"getMappedLocalColumn",
"(",
"$",
"foreign",
")",
"{",
"$",
"m",
"=",
"$",
"this",
"->",
"getForeignLocalMapping",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"m",
"[",
"$",
"foreign",
"]",
")",
")",
"{",
"return",
"$",
"m",
... | Get the local column mapped to specified foreign column.
@return string Column name. | [
"Get",
"the",
"local",
"column",
"mapped",
"to",
"specified",
"foreign",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L516-L524 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.isLocalColumnsRequired | public function isLocalColumnsRequired()
{
foreach ($this->getLocalColumns() as $columnName) {
if (!$this->getTable()->getColumn($columnName)->isNotNull()) {
return false;
}
}
return true;
} | php | public function isLocalColumnsRequired()
{
foreach ($this->getLocalColumns() as $columnName) {
if (!$this->getTable()->getColumn($columnName)->isNotNull()) {
return false;
}
}
return true;
} | [
"public",
"function",
"isLocalColumnsRequired",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getLocalColumns",
"(",
")",
"as",
"$",
"columnName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getColumn",
"(",
"$",
"col... | Whether this foreign key uses a required column, or a list of required columns.
@return boolean | [
"Whether",
"this",
"foreign",
"key",
"uses",
"a",
"required",
"column",
"or",
"a",
"list",
"of",
"required",
"columns",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L577-L586 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.isForeignPrimaryKey | public function isForeignPrimaryKey()
{
$lfmap = $this->getLocalForeignMapping();
$foreignTable = $this->getForeignTable();
$foreignPKCols = array();
foreach ($foreignTable->getPrimaryKey() as $fPKCol) {
$foreignPKCols[] = $fPKCol->getName();
}
$foreignC... | php | public function isForeignPrimaryKey()
{
$lfmap = $this->getLocalForeignMapping();
$foreignTable = $this->getForeignTable();
$foreignPKCols = array();
foreach ($foreignTable->getPrimaryKey() as $fPKCol) {
$foreignPKCols[] = $fPKCol->getName();
}
$foreignC... | [
"public",
"function",
"isForeignPrimaryKey",
"(",
")",
"{",
"$",
"lfmap",
"=",
"$",
"this",
"->",
"getLocalForeignMapping",
"(",
")",
";",
"$",
"foreignTable",
"=",
"$",
"this",
"->",
"getForeignTable",
"(",
")",
";",
"$",
"foreignPKCols",
"=",
"array",
"(... | Whether this foreign key is also the primary key of the foreign table.
@return boolean Returns true if all columns inside this foreign key are primary keys of the foreign table | [
"Whether",
"this",
"foreign",
"key",
"is",
"also",
"the",
"primary",
"key",
"of",
"the",
"foreign",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L593-L609 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.