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 | generator/lib/model/ForeignKey.php | ForeignKey.isLocalPrimaryKey | public function isLocalPrimaryKey()
{
$localCols = $this->getLocalColumns();
$localPKColumnObjs = $this->getTable()->getPrimaryKey();
$localPKCols = array();
foreach ($localPKColumnObjs as $lPKCol) {
$localPKCols[] = $lPKCol->getName();
}
return ((count... | php | public function isLocalPrimaryKey()
{
$localCols = $this->getLocalColumns();
$localPKColumnObjs = $this->getTable()->getPrimaryKey();
$localPKCols = array();
foreach ($localPKColumnObjs as $lPKCol) {
$localPKCols[] = $lPKCol->getName();
}
return ((count... | [
"public",
"function",
"isLocalPrimaryKey",
"(",
")",
"{",
"$",
"localCols",
"=",
"$",
"this",
"->",
"getLocalColumns",
"(",
")",
";",
"$",
"localPKColumnObjs",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
";",
"$",
"loca... | Whether this foreign key is also the primary key of the local table.
@return boolean True if all local columns are at the same time a primary key | [
"Whether",
"this",
"foreign",
"key",
"is",
"also",
"the",
"primary",
"key",
"of",
"the",
"local",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L664-L676 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.isAtLeastOneLocalPrimaryKey | public function isAtLeastOneLocalPrimaryKey()
{
$localCols = $this->getLocalColumnObjects();
foreach ($localCols as $localCol) {
if ($this->getTable()->getColumn($localCol->getName())->isPrimaryKey()) {
return true;
}
}
return false;
} | php | public function isAtLeastOneLocalPrimaryKey()
{
$localCols = $this->getLocalColumnObjects();
foreach ($localCols as $localCol) {
if ($this->getTable()->getColumn($localCol->getName())->isPrimaryKey()) {
return true;
}
}
return false;
} | [
"public",
"function",
"isAtLeastOneLocalPrimaryKey",
"(",
")",
"{",
"$",
"localCols",
"=",
"$",
"this",
"->",
"getLocalColumnObjects",
"(",
")",
";",
"foreach",
"(",
"$",
"localCols",
"as",
"$",
"localCol",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getTable... | Whether at least one local column is also a primary key.
@return boolean True if there is at least one column that is a primary key | [
"Whether",
"at",
"least",
"one",
"local",
"column",
"is",
"also",
"a",
"primary",
"key",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L683-L694 |
propelorm/Propel | generator/lib/model/ForeignKey.php | ForeignKey.getOtherFks | public function getOtherFks()
{
$fks = array();
foreach ($this->getTable()->getForeignKeys() as $fk) {
if ($fk !== $this) {
$fks[] = $fk;
}
}
return $fks;
} | php | public function getOtherFks()
{
$fks = array();
foreach ($this->getTable()->getForeignKeys() as $fk) {
if ($fk !== $this) {
$fks[] = $fk;
}
}
return $fks;
} | [
"public",
"function",
"getOtherFks",
"(",
")",
"{",
"$",
"fks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getForeignKeys",
"(",
")",
"as",
"$",
"fk",
")",
"{",
"if",
"(",
"$",
"fk",
"!==",
"$",
... | Get the other foreign keys starting on the same table
Used in many-to-many relationships
@return ForeignKey | [
"Get",
"the",
"other",
"foreign",
"keys",
"starting",
"on",
"the",
"same",
"table",
"Used",
"in",
"many",
"-",
"to",
"-",
"many",
"relationships"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ForeignKey.php#L753-L763 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.hasColumn | public function hasColumn($name, $normalize = true)
{
if ($name instanceof ColumnMap) {
$name = $name->getColumnName();
} elseif ($normalize) {
$name = ColumnMap::normalizeName($name);
}
return isset($this->columns[$name]);
} | php | public function hasColumn($name, $normalize = true)
{
if ($name instanceof ColumnMap) {
$name = $name->getColumnName();
} elseif ($normalize) {
$name = ColumnMap::normalizeName($name);
}
return isset($this->columns[$name]);
} | [
"public",
"function",
"hasColumn",
"(",
"$",
"name",
",",
"$",
"normalize",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"name",
"instanceof",
"ColumnMap",
")",
"{",
"$",
"name",
"=",
"$",
"name",
"->",
"getColumnName",
"(",
")",
";",
"}",
"elseif",
"(",
... | Does this table contain the specified column?
@param mixed $name name of the column or ColumnMap instance
@param boolean $normalize Normalize the column name (if column name not like FIRST_NAME)
@return boolean True if the table contains the column. | [
"Does",
"this",
"table",
"contain",
"the",
"specified",
"column?"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L355-L364 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.getColumn | public function getColumn($name, $normalize = true)
{
if ($normalize) {
$name = ColumnMap::normalizeName($name);
}
if (!$this->hasColumn($name, false)) {
throw new PropelException("Cannot fetch ColumnMap for undefined column: " . $name);
}
return $thi... | php | public function getColumn($name, $normalize = true)
{
if ($normalize) {
$name = ColumnMap::normalizeName($name);
}
if (!$this->hasColumn($name, false)) {
throw new PropelException("Cannot fetch ColumnMap for undefined column: " . $name);
}
return $thi... | [
"public",
"function",
"getColumn",
"(",
"$",
"name",
",",
"$",
"normalize",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"normalize",
")",
"{",
"$",
"name",
"=",
"ColumnMap",
"::",
"normalizeName",
"(",
"$",
"name",
")",
";",
"}",
"if",
"(",
"!",
"$",
... | Get a ColumnMap for the table.
@param string $name A String with the name of the table.
@param boolean $normalize Normalize the column name (if column name not like FIRST_NAME)
@return ColumnMap A ColumnMap.
@throws PropelException if the column is undefined | [
"Get",
"a",
"ColumnMap",
"for",
"the",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L375-L385 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.getColumnByPhpName | public function getColumnByPhpName($phpName)
{
if (!isset($this->columnsByPhpName[$phpName])) {
throw new PropelException("Cannot fetch ColumnMap for undefined column phpName: " . $phpName);
}
return $this->columnsByPhpName[$phpName];
} | php | public function getColumnByPhpName($phpName)
{
if (!isset($this->columnsByPhpName[$phpName])) {
throw new PropelException("Cannot fetch ColumnMap for undefined column phpName: " . $phpName);
}
return $this->columnsByPhpName[$phpName];
} | [
"public",
"function",
"getColumnByPhpName",
"(",
"$",
"phpName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"columnsByPhpName",
"[",
"$",
"phpName",
"]",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"\"Cannot fetch ColumnMap for undef... | Get a ColumnMap for the table.
@param string $phpName A String with the name of the table.
@return ColumnMap A ColumnMap.
@throws PropelException if the column is undefined | [
"Get",
"a",
"ColumnMap",
"for",
"the",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L407-L414 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.addValidator | public function addValidator($columnName, $name, $classname, $value, $message)
{
if (false !== ($pos = strpos($columnName, '.'))) {
$columnName = substr($columnName, $pos + 1);
}
$col = $this->getColumn($columnName);
if ($col !== null) {
$validator = new Vali... | php | public function addValidator($columnName, $name, $classname, $value, $message)
{
if (false !== ($pos = strpos($columnName, '.'))) {
$columnName = substr($columnName, $pos + 1);
}
$col = $this->getColumn($columnName);
if ($col !== null) {
$validator = new Vali... | [
"public",
"function",
"addValidator",
"(",
"$",
"columnName",
",",
"$",
"name",
",",
"$",
"classname",
",",
"$",
"value",
",",
"$",
"message",
")",
"{",
"if",
"(",
"false",
"!==",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"columnName",
",",
"'.'",
... | Add a validator to a table's column
@param string $columnName The name of the validator's column
@param string $name The rule name of this validator
@param string $classname The dot-path name of class to use (e.g. myapp.propel.MyValidator)
@param string $value
@param string $message The error message which i... | [
"Add",
"a",
"validator",
"to",
"a",
"table",
"s",
"column"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L545-L560 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.addRelation | public function addRelation($name, $tablePhpName, $type, $columnMapping = array(), $onDelete = null, $onUpdate = null, $pluralName = null)
{
// note: using phpName for the second table allows the use of DatabaseMap::getTableByPhpName()
// and this method autoloads the TableMap if the table isn't loa... | php | public function addRelation($name, $tablePhpName, $type, $columnMapping = array(), $onDelete = null, $onUpdate = null, $pluralName = null)
{
// note: using phpName for the second table allows the use of DatabaseMap::getTableByPhpName()
// and this method autoloads the TableMap if the table isn't loa... | [
"public",
"function",
"addRelation",
"(",
"$",
"name",
",",
"$",
"tablePhpName",
",",
"$",
"type",
",",
"$",
"columnMapping",
"=",
"array",
"(",
")",
",",
"$",
"onDelete",
"=",
"null",
",",
"$",
"onUpdate",
"=",
"null",
",",
"$",
"pluralName",
"=",
"... | Adds a RelationMap to the table
@param string $name The relation name
@param string $tablePhpName The related table name
@param integer $type The relation type (either RelationMap::MANY_TO_ONE, RelationMap::ONE_TO_MANY, or RelationMAp::ONE_TO_ONE)
@param array $columnMapping An associative array... | [
"Adds",
"a",
"RelationMap",
"to",
"the",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L584-L614 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.getRelation | public function getRelation($name)
{
if (!array_key_exists($name, $this->getRelations())) {
throw new PropelException('Calling getRelation() on an unknown relation, ' . $name);
}
return $this->relations[$name];
} | php | public function getRelation($name)
{
if (!array_key_exists($name, $this->getRelations())) {
throw new PropelException('Calling getRelation() on an unknown relation, ' . $name);
}
return $this->relations[$name];
} | [
"public",
"function",
"getRelation",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"getRelations",
"(",
")",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'Calling getRelation() on an unkn... | Gets a RelationMap of the table by relation name
This method will build the relations if they are not built yet
@param String $name The relation name
@return RelationMap The relation object
@throws PropelException When called on an inexistent relation | [
"Gets",
"a",
"RelationMap",
"of",
"the",
"table",
"by",
"relation",
"name",
"This",
"method",
"will",
"build",
"the",
"relations",
"if",
"they",
"are",
"not",
"built",
"yet"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L638-L645 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.removePrefix | protected function removePrefix($data)
{
return $this->hasPrefix($data) ? substr($data, strlen($this->prefix)) : $data;
} | php | protected function removePrefix($data)
{
return $this->hasPrefix($data) ? substr($data, strlen($this->prefix)) : $data;
} | [
"protected",
"function",
"removePrefix",
"(",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"hasPrefix",
"(",
"$",
"data",
")",
"?",
"substr",
"(",
"$",
"data",
",",
"strlen",
"(",
"$",
"this",
"->",
"prefix",
")",
")",
":",
"$",
"data",
";",... | Removes the PREFIX if found
@deprecated Not used anywhere in Propel
@param string $data A String.
@return string A String with data, but with prefix removed. | [
"Removes",
"the",
"PREFIX",
"if",
"found"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L801-L804 |
propelorm/Propel | runtime/lib/map/TableMap.php | TableMap.removeUnderScores | final public function removeUnderScores($data)
{
$out = '';
$tmp = $this->removePrefix($data);
$tok = strtok($tmp, '_');
while ($tok) {
$out .= ucfirst($tok);
$tok = strtok('_');
}
return $out;
} | php | final public function removeUnderScores($data)
{
$out = '';
$tmp = $this->removePrefix($data);
$tok = strtok($tmp, '_');
while ($tok) {
$out .= ucfirst($tok);
$tok = strtok('_');
}
return $out;
} | [
"final",
"public",
"function",
"removeUnderScores",
"(",
"$",
"data",
")",
"{",
"$",
"out",
"=",
"''",
";",
"$",
"tmp",
"=",
"$",
"this",
"->",
"removePrefix",
"(",
"$",
"data",
")",
";",
"$",
"tok",
"=",
"strtok",
"(",
"$",
"tmp",
",",
"'_'",
")... | Removes the PREFIX, removes the underscores and makes
first letter caps.
SCARAB_FOO_BAR becomes FooBar.
@deprecated Not used anywhere in Propel. At buildtime, use Column::generatePhpName() for that purpose
@param string $data
@return string A String with data processed. | [
"Removes",
"the",
"PREFIX",
"removes",
"the",
"underscores",
"and",
"makes",
"first",
"letter",
"caps",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/TableMap.php#L818-L829 |
propelorm/Propel | runtime/lib/adapter/DBMySQL.php | DBMySQL.prepareParams | public function prepareParams($params)
{
$params = parent::prepareParams($params);
// Whitelist based on https://bugs.php.net/bug.php?id=47802
// And https://bugs.php.net/bug.php?id=47802
$whitelist = array(
'ASCII',
'CP1250',
'CP1251',
... | php | public function prepareParams($params)
{
$params = parent::prepareParams($params);
// Whitelist based on https://bugs.php.net/bug.php?id=47802
// And https://bugs.php.net/bug.php?id=47802
$whitelist = array(
'ASCII',
'CP1250',
'CP1251',
... | [
"public",
"function",
"prepareParams",
"(",
"$",
"params",
")",
"{",
"$",
"params",
"=",
"parent",
"::",
"prepareParams",
"(",
"$",
"params",
")",
";",
"// Whitelist based on https://bugs.php.net/bug.php?id=47802",
"// And https://bugs.php.net/bug.php?id=47802",
"$",
"whi... | Prepare connection parameters.
See: http://www.propelorm.org/ticket/1360
@param array $params
@return array
@throws PropelException | [
"Prepare",
"connection",
"parameters",
".",
"See",
":",
"http",
":",
"//",
"www",
".",
"propelorm",
".",
"org",
"/",
"ticket",
"/",
"1360"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/adapter/DBMySQL.php#L217-L261 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getPeerBuilder | public function getPeerBuilder()
{
if (!isset($this->peerBuilder)) {
$this->peerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'peer');
}
return $this->peerBuilder;
} | php | public function getPeerBuilder()
{
if (!isset($this->peerBuilder)) {
$this->peerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'peer');
}
return $this->peerBuilder;
} | [
"public",
"function",
"getPeerBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"peerBuilder",
")",
")",
"{",
"$",
"this",
"->",
"peerBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfiguredBuilder",
... | Returns new or existing Peer builder class for this table.
@return PeerBuilder | [
"Returns",
"new",
"or",
"existing",
"Peer",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L190-L197 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getStubPeerBuilder | public function getStubPeerBuilder()
{
if (!isset($this->stubPeerBuilder)) {
$this->stubPeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'peerstub');
}
return $this->stubPeerBuilder;
} | php | public function getStubPeerBuilder()
{
if (!isset($this->stubPeerBuilder)) {
$this->stubPeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'peerstub');
}
return $this->stubPeerBuilder;
} | [
"public",
"function",
"getStubPeerBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stubPeerBuilder",
")",
")",
"{",
"$",
"this",
"->",
"stubPeerBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfigured... | Returns new or existing stub Peer builder class for this table.
@return PeerBuilder | [
"Returns",
"new",
"or",
"existing",
"stub",
"Peer",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L218-L225 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getNodeBuilder | public function getNodeBuilder()
{
if (!isset($this->nodeBuilder)) {
$this->nodeBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'node');
}
return $this->nodeBuilder;
} | php | public function getNodeBuilder()
{
if (!isset($this->nodeBuilder)) {
$this->nodeBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'node');
}
return $this->nodeBuilder;
} | [
"public",
"function",
"getNodeBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nodeBuilder",
")",
")",
"{",
"$",
"this",
"->",
"nodeBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfiguredBuilder",
... | Returns new or existing node Object builder class for this table.
@return ObjectBuilder | [
"Returns",
"new",
"or",
"existing",
"node",
"Object",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L330-L337 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getNodePeerBuilder | public function getNodePeerBuilder()
{
if (!isset($this->nodePeerBuilder)) {
$this->nodePeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodepeer');
}
return $this->nodePeerBuilder;
} | php | public function getNodePeerBuilder()
{
if (!isset($this->nodePeerBuilder)) {
$this->nodePeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodepeer');
}
return $this->nodePeerBuilder;
} | [
"public",
"function",
"getNodePeerBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nodePeerBuilder",
")",
")",
"{",
"$",
"this",
"->",
"nodePeerBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfigured... | Returns new or existing node Peer builder class for this table.
@return PeerBuilder | [
"Returns",
"new",
"or",
"existing",
"node",
"Peer",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L344-L351 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getStubNodeBuilder | public function getStubNodeBuilder()
{
if (!isset($this->stubNodeBuilder)) {
$this->stubNodeBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodestub');
}
return $this->stubNodeBuilder;
} | php | public function getStubNodeBuilder()
{
if (!isset($this->stubNodeBuilder)) {
$this->stubNodeBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodestub');
}
return $this->stubNodeBuilder;
} | [
"public",
"function",
"getStubNodeBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stubNodeBuilder",
")",
")",
"{",
"$",
"this",
"->",
"stubNodeBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfigured... | Returns new or existing stub node Object builder class for this table.
@return ObjectBuilder | [
"Returns",
"new",
"or",
"existing",
"stub",
"node",
"Object",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L358-L365 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getStubNodePeerBuilder | public function getStubNodePeerBuilder()
{
if (!isset($this->stubNodePeerBuilder)) {
$this->stubNodePeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodepeerstub');
}
return $this->stubNodePeerBuilder;
} | php | public function getStubNodePeerBuilder()
{
if (!isset($this->stubNodePeerBuilder)) {
$this->stubNodePeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodepeerstub');
}
return $this->stubNodePeerBuilder;
} | [
"public",
"function",
"getStubNodePeerBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stubNodePeerBuilder",
")",
")",
"{",
"$",
"this",
"->",
"stubNodePeerBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"g... | Returns new or existing stub node Peer builder class for this table.
@return PeerBuilder | [
"Returns",
"new",
"or",
"existing",
"stub",
"node",
"Peer",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L372-L379 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getNestedSetBuilder | public function getNestedSetBuilder()
{
if (!isset($this->nestedSetBuilder)) {
$this->nestedSetBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nestedset');
}
return $this->nestedSetBuilder;
} | php | public function getNestedSetBuilder()
{
if (!isset($this->nestedSetBuilder)) {
$this->nestedSetBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nestedset');
}
return $this->nestedSetBuilder;
} | [
"public",
"function",
"getNestedSetBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nestedSetBuilder",
")",
")",
"{",
"$",
"this",
"->",
"nestedSetBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfigu... | Returns new or existing nested set object builder class for this table.
@return ObjectBuilder | [
"Returns",
"new",
"or",
"existing",
"nested",
"set",
"object",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L386-L393 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getNestedSetPeerBuilder | public function getNestedSetPeerBuilder()
{
if (!isset($this->nestedSetPeerBuilder)) {
$this->nestedSetPeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nestedsetpeer');
}
return $this->nestedSetPeerBuilder;
} | php | public function getNestedSetPeerBuilder()
{
if (!isset($this->nestedSetPeerBuilder)) {
$this->nestedSetPeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nestedsetpeer');
}
return $this->nestedSetPeerBuilder;
} | [
"public",
"function",
"getNestedSetPeerBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"nestedSetPeerBuilder",
")",
")",
"{",
"$",
"this",
"->",
"nestedSetPeerBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
... | Returns new or existing nested set Peer builder class for this table.
@return PeerBuilder | [
"Returns",
"new",
"or",
"existing",
"nested",
"set",
"Peer",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L400-L407 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getDataSQLBuilder | public function getDataSQLBuilder()
{
if (!isset($this->dataSqlBuilder)) {
$this->dataSqlBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'datasql');
}
return $this->dataSqlBuilder;
} | php | public function getDataSQLBuilder()
{
if (!isset($this->dataSqlBuilder)) {
$this->dataSqlBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'datasql');
}
return $this->dataSqlBuilder;
} | [
"public",
"function",
"getDataSQLBuilder",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataSqlBuilder",
")",
")",
"{",
"$",
"this",
"->",
"dataSqlBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfiguredBui... | Returns new or existing data sql builder class for this table.
@return DataSQLBuilder | [
"Returns",
"new",
"or",
"existing",
"data",
"sql",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L414-L421 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getNewQueryInheritanceBuilder | public function getNewQueryInheritanceBuilder($child)
{
$queryInheritanceBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'queryinheritance');
$queryInheritanceBuilder->setChild($child);
return $queryInheritanceBuilder;
} | php | public function getNewQueryInheritanceBuilder($child)
{
$queryInheritanceBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'queryinheritance');
$queryInheritanceBuilder->setChild($child);
return $queryInheritanceBuilder;
} | [
"public",
"function",
"getNewQueryInheritanceBuilder",
"(",
"$",
"child",
")",
"{",
"$",
"queryInheritanceBuilder",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfiguredBuilder",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
",",
"'queryin... | Returns new Query Inheritance builder class for this table.
@return ObjectBuilder | [
"Returns",
"new",
"Query",
"Inheritance",
"builder",
"class",
"for",
"this",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L534-L540 |
propelorm/Propel | generator/lib/builder/DataModelBuilder.php | DataModelBuilder.getPlatform | public function getPlatform()
{
if (null === $this->platform) {
// try to load the platform from the table
if ($this->getTable() && $this->getTable()->getDatabase()) {
$this->setPlatform($this->getTable()->getDatabase()->getPlatform());
}
}
... | php | public function getPlatform()
{
if (null === $this->platform) {
// try to load the platform from the table
if ($this->getTable() && $this->getTable()->getDatabase()) {
$this->setPlatform($this->getTable()->getDatabase()->getPlatform());
}
}
... | [
"public",
"function",
"getPlatform",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"platform",
")",
"{",
"// try to load the platform from the table",
"if",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"&&",
"$",
"this",
"->",
"getTable",
"(... | Convenience method to returns the Platform class for this table (database).
@return PropelPlatformInterface | [
"Convenience",
"method",
"to",
"returns",
"the",
"Platform",
"class",
"for",
"this",
"table",
"(",
"database",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/DataModelBuilder.php#L616-L626 |
propelorm/Propel | runtime/lib/formatter/PropelFormatter.php | PropelFormatter.init | public function init(ModelCriteria $criteria)
{
$this->dbName = $criteria->getDbName();
$this->setClass($criteria->getModelName());
$this->setWith($criteria->getWith());
$this->asColumns = $criteria->getAsColumns();
$this->hasLimit = $criteria->getLimit() != 0;
retur... | php | public function init(ModelCriteria $criteria)
{
$this->dbName = $criteria->getDbName();
$this->setClass($criteria->getModelName());
$this->setWith($criteria->getWith());
$this->asColumns = $criteria->getAsColumns();
$this->hasLimit = $criteria->getLimit() != 0;
retur... | [
"public",
"function",
"init",
"(",
"ModelCriteria",
"$",
"criteria",
")",
"{",
"$",
"this",
"->",
"dbName",
"=",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
";",
"$",
"this",
"->",
"setClass",
"(",
"$",
"criteria",
"->",
"getModelName",
"(",
")",
")"... | Define the hydration schema based on a query object.
Fills the Formatter's properties using a Criteria as source
@param ModelCriteria $criteria
@return PropelFormatter The current formatter object | [
"Define",
"the",
"hydration",
"schema",
"based",
"on",
"a",
"query",
"object",
".",
"Fills",
"the",
"Formatter",
"s",
"properties",
"using",
"a",
"Criteria",
"as",
"source"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/formatter/PropelFormatter.php#L44-L53 |
propelorm/Propel | runtime/lib/formatter/PropelFormatter.php | PropelFormatter.getWorkerObject | protected function getWorkerObject($col, $class)
{
$key = $col . '_' . $class;
if (isset($this->currentObjects[$key])) {
$this->currentObjects[$key]->clear();
} else {
$this->currentObjects[$key] = new $class();
}
return $this->currentObjects[$key];
... | php | protected function getWorkerObject($col, $class)
{
$key = $col . '_' . $class;
if (isset($this->currentObjects[$key])) {
$this->currentObjects[$key]->clear();
} else {
$this->currentObjects[$key] = new $class();
}
return $this->currentObjects[$key];
... | [
"protected",
"function",
"getWorkerObject",
"(",
"$",
"col",
",",
"$",
"class",
")",
"{",
"$",
"key",
"=",
"$",
"col",
".",
"'_'",
".",
"$",
"class",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"currentObjects",
"[",
"$",
"key",
"]",
")",
")... | Gets the worker object for the class.
To save memory, we don't create a new object for each row,
But we keep hydrating a single object per class.
The column offset in the row is used to index the array of classes
As there may be more than one object of the same class in the chain
@param int $col Offset of the obj... | [
"Gets",
"the",
"worker",
"object",
"for",
"the",
"class",
".",
"To",
"save",
"memory",
"we",
"don",
"t",
"create",
"a",
"new",
"object",
"for",
"each",
"row",
"But",
"we",
"keep",
"hydrating",
"a",
"single",
"object",
"per",
"class",
".",
"The",
"colum... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/formatter/PropelFormatter.php#L171-L182 |
propelorm/Propel | runtime/lib/formatter/PropelFormatter.php | PropelFormatter.getSingleObjectFromRow | public function getSingleObjectFromRow($row, $class, &$col = 0)
{
$obj = $this->getWorkerObject($col, $class);
$col = $obj->hydrate($row, $col);
return $obj;
} | php | public function getSingleObjectFromRow($row, $class, &$col = 0)
{
$obj = $this->getWorkerObject($col, $class);
$col = $obj->hydrate($row, $col);
return $obj;
} | [
"public",
"function",
"getSingleObjectFromRow",
"(",
"$",
"row",
",",
"$",
"class",
",",
"&",
"$",
"col",
"=",
"0",
")",
"{",
"$",
"obj",
"=",
"$",
"this",
"->",
"getWorkerObject",
"(",
"$",
"col",
",",
"$",
"class",
")",
";",
"$",
"col",
"=",
"$... | Gets a Propel object hydrated from a selection of columns in statement row
@param array $row associative array indexed by column number,
as returned by PDOStatement::fetch(PDO::FETCH_NUM)
@param string $class The classname of the object to create
@param int $col The start column for the hydration (modified)
@ret... | [
"Gets",
"a",
"Propel",
"object",
"hydrated",
"from",
"a",
"selection",
"of",
"columns",
"in",
"statement",
"row"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/formatter/PropelFormatter.php#L194-L200 |
propelorm/Propel | generator/lib/platform/MysqlPlatform.php | MysqlPlatform.getIndexColumnListDDL | protected function getIndexColumnListDDL(Index $index)
{
$list = array();
foreach ($index->getColumns() as $col) {
$list[] = $this->quoteIdentifier($col) . ($index->hasColumnSize($col) ? '(' . $index->getColumnSize($col) . ')' : '');
}
return implode(', ', $list);
} | php | protected function getIndexColumnListDDL(Index $index)
{
$list = array();
foreach ($index->getColumns() as $col) {
$list[] = $this->quoteIdentifier($col) . ($index->hasColumnSize($col) ? '(' . $index->getColumnSize($col) . ')' : '');
}
return implode(', ', $list);
} | [
"protected",
"function",
"getIndexColumnListDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"index",
"->",
"getColumns",
"(",
")",
"as",
"$",
"col",
")",
"{",
"$",
"list",
"[",
"]",
"=",
"$... | Creates a comma-separated list of column names for the index.
For MySQL unique indexes there is the option of specifying size, so we cannot simply use
the getColumnsList() method.
@param Index $index
@return string | [
"Creates",
"a",
"comma",
"-",
"separated",
"list",
"of",
"column",
"names",
"for",
"the",
"index",
".",
"For",
"MySQL",
"unique",
"indexes",
"there",
"is",
"the",
"option",
"of",
"specifying",
"size",
"so",
"we",
"cannot",
"simply",
"use",
"the",
"getColum... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/MysqlPlatform.php#L388-L396 |
propelorm/Propel | generator/lib/platform/MysqlPlatform.php | MysqlPlatform.getAddIndexDDL | public function getAddIndexDDL(Index $index)
{
$pattern = "
CREATE %sINDEX %s ON %s (%s);
";
return sprintf($pattern,
$this->getIndexType($index),
$this->quoteIdentifier($index->getName()),
$this->quoteIdentifier($index->getTable()->getName()),
$this-... | php | public function getAddIndexDDL(Index $index)
{
$pattern = "
CREATE %sINDEX %s ON %s (%s);
";
return sprintf($pattern,
$this->getIndexType($index),
$this->quoteIdentifier($index->getName()),
$this->quoteIdentifier($index->getTable()->getName()),
$this-... | [
"public",
"function",
"getAddIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"$",
"pattern",
"=",
"\"\nCREATE %sINDEX %s ON %s (%s);\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"getIndexType",
"(",
"$",
"index",
")",
",",
"$... | Builds the DDL SQL to add an Index.
@param Index $index
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"add",
"an",
"Index",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/MysqlPlatform.php#L423-L435 |
propelorm/Propel | generator/lib/platform/MysqlPlatform.php | MysqlPlatform.getChangeColumnDDL | public function getChangeColumnDDL($fromColumn, $toColumn)
{
$pattern = "
ALTER TABLE %s CHANGE %s %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fromColumn->getTable()->getName()),
$this->quoteIdentifier($fromColumn->getName()),
$this->getColumnDDL($toC... | php | public function getChangeColumnDDL($fromColumn, $toColumn)
{
$pattern = "
ALTER TABLE %s CHANGE %s %s;
";
return sprintf($pattern,
$this->quoteIdentifier($fromColumn->getTable()->getName()),
$this->quoteIdentifier($fromColumn->getName()),
$this->getColumnDDL($toC... | [
"public",
"function",
"getChangeColumnDDL",
"(",
"$",
"fromColumn",
",",
"$",
"toColumn",
")",
"{",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s CHANGE %s %s;\n\"",
";",
"return",
"sprintf",
"(",
"$",
"pattern",
",",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
... | Builds the DDL SQL to change a column
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"change",
"a",
"column"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/MysqlPlatform.php#L630-L641 |
propelorm/Propel | generator/lib/model/diff/PropelColumnComparator.php | PropelColumnComparator.computeDiff | public static function computeDiff(Column $fromColumn, Column $toColumn)
{
if ($changedProperties = self::compareColumns($fromColumn, $toColumn)) {
if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) {
$platform = $fromColumn->hasPlatform() ? $fromColumn->getPlatform() : ... | php | public static function computeDiff(Column $fromColumn, Column $toColumn)
{
if ($changedProperties = self::compareColumns($fromColumn, $toColumn)) {
if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) {
$platform = $fromColumn->hasPlatform() ? $fromColumn->getPlatform() : ... | [
"public",
"static",
"function",
"computeDiff",
"(",
"Column",
"$",
"fromColumn",
",",
"Column",
"$",
"toColumn",
")",
"{",
"if",
"(",
"$",
"changedProperties",
"=",
"self",
"::",
"compareColumns",
"(",
"$",
"fromColumn",
",",
"$",
"toColumn",
")",
")",
"{"... | Compute and return the difference between two column objects
@param Column $fromColumn
@param Column $toColumn
@return PropelColumnDiff|boolean return false if the two columns are similar | [
"Compute",
"and",
"return",
"the",
"difference",
"between",
"two",
"column",
"objects"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/diff/PropelColumnComparator.php#L31-L49 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.setFormatter | public function setFormatter($formatter)
{
if (is_string($formatter)) {
$formatter = new $formatter();
}
if (!$formatter instanceof PropelFormatter) {
throw new PropelException('setFormatter() only accepts classes extending PropelFormatter');
}
$this->... | php | public function setFormatter($formatter)
{
if (is_string($formatter)) {
$formatter = new $formatter();
}
if (!$formatter instanceof PropelFormatter) {
throw new PropelException('setFormatter() only accepts classes extending PropelFormatter');
}
$this->... | [
"public",
"function",
"setFormatter",
"(",
"$",
"formatter",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"formatter",
")",
")",
"{",
"$",
"formatter",
"=",
"new",
"$",
"formatter",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"formatter",
"instanceof",
"... | Sets the formatter to use for the find() output
Formatters must extend PropelFormatter
Use the ModelCriteria constants for class names:
<code>
$c->setFormatter(ModelCriteria::FORMAT_ARRAY);
</code>
@param string|PropelFormatter $formatter a formatter class name, or a formatter instance
@return ModelCriteria The curre... | [
"Sets",
"the",
"formatter",
"to",
"use",
"for",
"the",
"find",
"()",
"output",
"Formatters",
"must",
"extend",
"PropelFormatter",
"Use",
"the",
"ModelCriteria",
"constants",
"for",
"class",
"names",
":",
"<code",
">",
"$c",
"-",
">",
"setFormatter",
"(",
"Mo... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L168-L179 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.orWhere | public function orWhere($clause, $value = null, $bindingType = null)
{
return $this
->_or()
->where($clause, $value, $bindingType);
} | php | public function orWhere($clause, $value = null, $bindingType = null)
{
return $this
->_or()
->where($clause, $value, $bindingType);
} | [
"public",
"function",
"orWhere",
"(",
"$",
"clause",
",",
"$",
"value",
"=",
"null",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_or",
"(",
")",
"->",
"where",
"(",
"$",
"clause",
",",
"$",
"value",
",",
"$",
"bi... | Adds a condition on a column based on a pseudo SQL clause
Uses introspection to translate the column phpName into a fully qualified name
<code>
// simple clause
$c->orWhere('b.Title = ?', 'foo');
// named conditions
$c->condition('cond1', 'b.Title = ?', 'foo');
$c->condition('cond2', 'b.ISBN = ?', 12345);
$c->orWhere(a... | [
"Adds",
"a",
"condition",
"on",
"a",
"column",
"based",
"on",
"a",
"pseudo",
"SQL",
"clause",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name",
"<code",
">",
"//",
"simple",
"clause",
"$c",
"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L325-L330 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.groupBy | public function groupBy($columnName)
{
list(, $realColumnName) = $this->getColumnFromName($columnName, false);
$this->addGroupByColumn($realColumnName);
return $this;
} | php | public function groupBy($columnName)
{
list(, $realColumnName) = $this->getColumnFromName($columnName, false);
$this->addGroupByColumn($realColumnName);
return $this;
} | [
"public",
"function",
"groupBy",
"(",
"$",
"columnName",
")",
"{",
"list",
"(",
",",
"$",
"realColumnName",
")",
"=",
"$",
"this",
"->",
"getColumnFromName",
"(",
"$",
"columnName",
",",
"false",
")",
";",
"$",
"this",
"->",
"addGroupByColumn",
"(",
"$",... | Adds a GROUB BY clause to the query
Usability layer on top of Criteria::addGroupByColumn()
Infers $column $columnName
Examples:
$c->groupBy('Book.AuthorId')
=> $c->addGroupByColumn(BookPeer::AUTHOR_ID)
@param string $columnName The column to group by
@return ModelCriteria The current object, for fluid interface | [
"Adds",
"a",
"GROUB",
"BY",
"clause",
"to",
"the",
"query",
"Usability",
"layer",
"on",
"top",
"of",
"Criteria",
"::",
"addGroupByColumn",
"()",
"Infers",
"$column",
"$columnName",
"Examples",
":",
"$c",
"-",
">",
"groupBy",
"(",
"Book",
".",
"AuthorId",
"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L414-L420 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.groupByClass | public function groupByClass($class)
{
if ($class == $this->getModelAliasOrName()) {
// column of the Criteria's model
$tableMap = $this->getTableMap();
} elseif (isset($this->joins[$class])) {
// column of a relations's model
$tableMap = $this->joins[... | php | public function groupByClass($class)
{
if ($class == $this->getModelAliasOrName()) {
// column of the Criteria's model
$tableMap = $this->getTableMap();
} elseif (isset($this->joins[$class])) {
// column of a relations's model
$tableMap = $this->joins[... | [
"public",
"function",
"groupByClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"class",
"==",
"$",
"this",
"->",
"getModelAliasOrName",
"(",
")",
")",
"{",
"// column of the Criteria's model",
"$",
"tableMap",
"=",
"$",
"this",
"->",
"getTableMap",
"(",
... | Adds a GROUB BY clause for all columns of a model to the query
Examples:
$c->groupBy('Book');
=> $c->addGroupByColumn(BookPeer::ID);
=> $c->addGroupByColumn(BookPeer::TITLE);
=> $c->addGroupByColumn(BookPeer::AUTHOR_ID);
=> $c->addGroupByColumn(BookPeer::PUBLISHER_ID);
@param string $class The class name or alias
@re... | [
"Adds",
"a",
"GROUB",
"BY",
"clause",
"for",
"all",
"columns",
"of",
"a",
"model",
"to",
"the",
"query",
"Examples",
":",
"$c",
"-",
">",
"groupBy",
"(",
"Book",
")",
";",
"=",
">",
"$c",
"-",
">",
"addGroupByColumn",
"(",
"BookPeer",
"::",
"ID",
"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L437-L457 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.select | public function select($columnArray)
{
if (!count($columnArray) || $columnArray == '') {
throw new PropelException('You must ask for at least one column');
}
if ($columnArray == '*') {
$columnArray = array();
foreach (call_user_func(array($this->modelPeer... | php | public function select($columnArray)
{
if (!count($columnArray) || $columnArray == '') {
throw new PropelException('You must ask for at least one column');
}
if ($columnArray == '*') {
$columnArray = array();
foreach (call_user_func(array($this->modelPeer... | [
"public",
"function",
"select",
"(",
"$",
"columnArray",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"columnArray",
")",
"||",
"$",
"columnArray",
"==",
"''",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'You must ask for at least one column'",
")",
"... | Makes the ModelCriteria return a string, array, or PropelArrayCollection
Examples:
ArticleQuery::create()->select('Name')->find();
=> PropelArrayCollection Object ('Foo', 'Bar')
ArticleQuery::create()->select('Name')->findOne();
=> string 'Foo'
ArticleQuery::create()->select(array('Id', 'Name'))->find();
=> PropelArr... | [
"Makes",
"the",
"ModelCriteria",
"return",
"a",
"string",
"array",
"or",
"PropelArrayCollection",
"Examples",
":",
"ArticleQuery",
"::",
"create",
"()",
"-",
">",
"select",
"(",
"Name",
")",
"-",
">",
"find",
"()",
";",
"=",
">",
"PropelArrayCollection",
"Ob... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L526-L542 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.with | public function with($relation)
{
if (!isset($this->joins[$relation])) {
throw new PropelException('Unknown relation name or alias ' . $relation);
}
$join = $this->joins[$relation];
if ($join->getRelationMap()->getType() == RelationMap::MANY_TO_MANY) {
throw n... | php | public function with($relation)
{
if (!isset($this->joins[$relation])) {
throw new PropelException('Unknown relation name or alias ' . $relation);
}
$join = $this->joins[$relation];
if ($join->getRelationMap()->getType() == RelationMap::MANY_TO_MANY) {
throw n... | [
"public",
"function",
"with",
"(",
"$",
"relation",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"joins",
"[",
"$",
"relation",
"]",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'Unknown relation name or alias '",
".",
"$",
"rela... | Adds a relation to hydrate together with the main object
The relation must be initialized via a join() prior to calling with()
Examples:
<code>
$c->join('Book.Author');
$c->with('Author');
$c->join('Book.Author a', Criteria::RIGHT_JOIN);
$c->with('a');
</code>
WARNING: on a one-to-many relationship, the use of with() ... | [
"Adds",
"a",
"relation",
"to",
"hydrate",
"together",
"with",
"the",
"main",
"object",
"The",
"relation",
"must",
"be",
"initialized",
"via",
"a",
"join",
"()",
"prior",
"to",
"calling",
"with",
"()",
"Examples",
":",
"<code",
">",
"$c",
"-",
">",
"join"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L855-L879 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.withColumn | public function withColumn($clause, $name = null)
{
if (null === $name) {
$name = str_replace(array('.', '(', ')'), '', $clause);
}
$clause = trim($clause);
$this->replaceNames($clause);
// check that the columns of the main class are already added (if this is the... | php | public function withColumn($clause, $name = null)
{
if (null === $name) {
$name = str_replace(array('.', '(', ')'), '', $clause);
}
$clause = trim($clause);
$this->replaceNames($clause);
// check that the columns of the main class are already added (if this is the... | [
"public",
"function",
"withColumn",
"(",
"$",
"clause",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"array",
"(",
"'.'",
",",
"'('",
",",
"')'",
")",
",",
"''",
... | Adds a supplementary column to the select clause
These columns can later be retrieved from the hydrated objects using getVirtualColumn()
@param string $clause The SQL clause with object model column names
e.g. 'UPPER(Author.FirstName)'
@param string $name Optional alias for the added column
If no alias is provided, th... | [
"Adds",
"a",
"supplementary",
"column",
"to",
"the",
"select",
"clause",
"These",
"columns",
"can",
"later",
"be",
"retrieved",
"from",
"the",
"hydrated",
"objects",
"using",
"getVirtualColumn",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L925-L939 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.useQuery | public function useQuery($relationName, $secondaryCriteriaClass = null)
{
if (!isset($this->joins[$relationName])) {
throw new PropelException('Unknown class or alias ' . $relationName);
}
$className = $this->joins[$relationName]->getTableMap()->getPhpName();
if (null ===... | php | public function useQuery($relationName, $secondaryCriteriaClass = null)
{
if (!isset($this->joins[$relationName])) {
throw new PropelException('Unknown class or alias ' . $relationName);
}
$className = $this->joins[$relationName]->getTableMap()->getPhpName();
if (null ===... | [
"public",
"function",
"useQuery",
"(",
"$",
"relationName",
",",
"$",
"secondaryCriteriaClass",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"joins",
"[",
"$",
"relationName",
"]",
")",
")",
"{",
"throw",
"new",
"PropelExceptio... | Initializes a secondary ModelCriteria object, to be later merged with the current object
@see ModelCriteria::endUse()
@param string $relationName Relation name or alias
@param string $secondaryCriteriaClass Classname for the ModelCriteria to be used
@return ModelCriteria The secondary criteria object... | [
"Initializes",
"a",
"secondary",
"ModelCriteria",
"object",
"to",
"be",
"later",
"merged",
"with",
"the",
"current",
"object"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L953-L970 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.clear | public function clear()
{
parent::clear();
$this->with = array();
$this->primaryCriteria = null;
$this->formatter = null;
$this->select = null;
$this->modelAlias = $this->originalModelAlias;
$this->currentAlias = null;
$this->setDbName($this->original... | php | public function clear()
{
parent::clear();
$this->with = array();
$this->primaryCriteria = null;
$this->formatter = null;
$this->select = null;
$this->modelAlias = $this->originalModelAlias;
$this->currentAlias = null;
$this->setDbName($this->original... | [
"public",
"function",
"clear",
"(",
")",
"{",
"parent",
"::",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"with",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"primaryCriteria",
"=",
"null",
";",
"$",
"this",
"->",
"formatter",
"=",
"null",
";",
... | Clear the conditions to allow the reuse of the query object.
The ModelCriteria's Model and alias 'all the properties set by construct) will remain.
@return ModelCriteria The primary criteria object | [
"Clear",
"the",
"conditions",
"to",
"allow",
"the",
"reuse",
"of",
"the",
"query",
"object",
".",
"The",
"ModelCriteria",
"s",
"Model",
"and",
"alias",
"all",
"the",
"properties",
"set",
"by",
"construct",
")",
"will",
"remain",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1020-L1039 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.addSelfSelectColumns | public function addSelfSelectColumns()
{
call_user_func(array($this->modelPeerName, 'addSelectColumns'), $this, $this->useAliasInSQL ? $this->modelAlias : null);
return $this;
} | php | public function addSelfSelectColumns()
{
call_user_func(array($this->modelPeerName, 'addSelectColumns'), $this, $this->useAliasInSQL ? $this->modelAlias : null);
return $this;
} | [
"public",
"function",
"addSelfSelectColumns",
"(",
")",
"{",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"modelPeerName",
",",
"'addSelectColumns'",
")",
",",
"$",
"this",
",",
"$",
"this",
"->",
"useAliasInSQL",
"?",
"$",
"this",
"->",
"modelAli... | Adds the select columns for a the current table
@return ModelCriteria The current object, for fluid interface | [
"Adds",
"the",
"select",
"columns",
"for",
"a",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1100-L1105 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.addRelationSelectColumns | public function addRelationSelectColumns($relation)
{
$join = $this->joins[$relation];
call_user_func(array($join->getTableMap()->getPeerClassname(), 'addSelectColumns'), $this, $join->getRelationAlias());
return $this;
} | php | public function addRelationSelectColumns($relation)
{
$join = $this->joins[$relation];
call_user_func(array($join->getTableMap()->getPeerClassname(), 'addSelectColumns'), $this, $join->getRelationAlias());
return $this;
} | [
"public",
"function",
"addRelationSelectColumns",
"(",
"$",
"relation",
")",
"{",
"$",
"join",
"=",
"$",
"this",
"->",
"joins",
"[",
"$",
"relation",
"]",
";",
"call_user_func",
"(",
"array",
"(",
"$",
"join",
"->",
"getTableMap",
"(",
")",
"->",
"getPee... | Adds the select columns for a relation
@param string $relation The relation name or alias, as defined in join()
@return ModelCriteria The current object, for fluid interface | [
"Adds",
"the",
"select",
"columns",
"for",
"a",
"relation"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1114-L1120 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.find | public function find($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria->doSelect($con);
re... | php | public function find($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria->doSelect($con);
re... | [
"public",
"function",
"find",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Propel",
"::",
"CONNECTION_... | Issue a SELECT query based on the current ModelCriteria
and format the list of results with the current formatter
By default, returns an array of model objects
@param PropelPDO $con an optional connection object
@return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter | [
"Issue",
"a",
"SELECT",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"format",
"the",
"list",
"of",
"results",
"with",
"the",
"current",
"formatter",
"By",
"default",
"returns",
"an",
"array",
"of",
"model",
"objects"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1220-L1230 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findOne | public function findOne($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->limit(1);
$stmt = $crite... | php | public function findOne($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->limit(1);
$stmt = $crite... | [
"public",
"function",
"findOne",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Propel",
"::",
"CONNECTI... | Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
and format the result with the current formatter
By default, returns a model object
@param PropelPDO $con an optional connection object
@return mixed the result, formatted by the current formatter | [
"Issue",
"a",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"and",
"format",
"the",
"result",
"with",
"the",
"current",
"formatter",
"By",
"default",
"returns",
"a",
"model",
"object"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1241-L1252 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findPk | public function findPk($key, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteria = $this->isKeepQuery(... | php | public function findPk($key, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteria = $this->isKeepQuery(... | [
"public",
"function",
"findPk",
"(",
"$",
"key",
",",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Propel... | Find object by primary key
Behaves differently if the model has simple or composite primary key
<code>
// simple primary key
$book = $c->findPk(12, $con);
// composite primary key
$bookOpinion = $c->findPk(array(34, 634), $con);
</code>
@param mixed $key Primary key to use for the query
@param PropelPDO $con an o... | [
"Find",
"object",
"by",
"primary",
"key",
"Behaves",
"differently",
"if",
"the",
"model",
"has",
"simple",
"or",
"composite",
"primary",
"key",
"<code",
">",
"//",
"simple",
"primary",
"key",
"$book",
"=",
"$c",
"-",
">",
"findPk",
"(",
"12",
"$con",
")"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1297-L1320 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findPks | public function findPks($keys, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteria = $this->isKeepQuer... | php | public function findPks($keys, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
// As the query uses a PK condition, no limit(1) is necessary.
$this->basePreSelect($con);
$criteria = $this->isKeepQuer... | [
"public",
"function",
"findPks",
"(",
"$",
"keys",
",",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Prop... | Find objects by primary key
Behaves differently if the model has simple or composite primary key
<code>
// simple primary key
$books = $c->findPks(array(12, 56, 832), $con);
// composite primary key
$bookOpinion = $c->findPks(array(array(34, 634), array(45, 518), array(34, 765)), $con);
</code>
@param array $keys ... | [
"Find",
"objects",
"by",
"primary",
"key",
"Behaves",
"differently",
"if",
"the",
"model",
"has",
"simple",
"or",
"composite",
"primary",
"key",
"<code",
">",
"//",
"simple",
"primary",
"key",
"$books",
"=",
"$c",
"-",
">",
"findPks",
"(",
"array",
"(",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1339-L1359 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.doSelect | protected function doSelect($con)
{
// check that the columns of the main class are already added (if this is the primary ModelCriteria)
if (!$this->hasSelectClause() && !$this->getPrimaryCriteria()) {
$this->addSelfSelectColumns();
}
$this->configureSelectColumns();
... | php | protected function doSelect($con)
{
// check that the columns of the main class are already added (if this is the primary ModelCriteria)
if (!$this->hasSelectClause() && !$this->getPrimaryCriteria()) {
$this->addSelfSelectColumns();
}
$this->configureSelectColumns();
... | [
"protected",
"function",
"doSelect",
"(",
"$",
"con",
")",
"{",
"// check that the columns of the main class are already added (if this is the primary ModelCriteria)",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSelectClause",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"getPrim... | Builds, binds and executes a SELECT query based on the current object.
@param PropelPDO $con A connection object
@return PDOStatement A PDO statement executed using the connection, ready to be fetched
@throws PropelException | [
"Builds",
"binds",
"and",
"executes",
"a",
"SELECT",
"query",
"based",
"on",
"the",
"current",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1370-L1393 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findBy | public function findBy($column, $value, $con = null)
{
$method = 'filterBy' . $column;
$this->$method($value);
return $this->find($con);
} | php | public function findBy($column, $value, $con = null)
{
$method = 'filterBy' . $column;
$this->$method($value);
return $this->find($con);
} | [
"public",
"function",
"findBy",
"(",
"$",
"column",
",",
"$",
"value",
",",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"method",
"=",
"'filterBy'",
".",
"$",
"column",
";",
"$",
"this",
"->",
"$",
"method",
"(",
"$",
"value",
")",
";",
"return",
"$"... | Apply a condition on a column and issues the SELECT query
@see filterBy()
@see find()
@param string $column A string representing the column phpName, e.g. 'AuthorId'
@param mixed $value A value for the condition
@param PropelPDO $con An optional connection object
@return mixed the list of resu... | [
"Apply",
"a",
"condition",
"on",
"a",
"column",
"and",
"issues",
"the",
"SELECT",
"query"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1407-L1413 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findByArray | public function findByArray($conditions, $con = null)
{
$this->filterByArray($conditions);
return $this->find($con);
} | php | public function findByArray($conditions, $con = null)
{
$this->filterByArray($conditions);
return $this->find($con);
} | [
"public",
"function",
"findByArray",
"(",
"$",
"conditions",
",",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"filterByArray",
"(",
"$",
"conditions",
")",
";",
"return",
"$",
"this",
"->",
"find",
"(",
"$",
"con",
")",
";",
"}"
] | Apply a list of conditions on columns and issues the SELECT query
<code>
$c->findByArray(array(
'Title' => 'War And Peace',
'Publisher' => $publisher
), $con);
</code>
@see filterByArray()
@see find()
@param mixed $conditions An array of conditions, using column phpNames as key
@param PropelPDO $c... | [
"Apply",
"a",
"list",
"of",
"conditions",
"on",
"columns",
"and",
"issues",
"the",
"SELECT",
"query",
"<code",
">",
"$c",
"-",
">",
"findByArray",
"(",
"array",
"(",
"Title",
"=",
">",
"War",
"And",
"Peace",
"Publisher",
"=",
">",
"$publisher",
")",
"$... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1432-L1437 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findOneBy | public function findOneBy($column, $value, $con = null)
{
$method = 'filterBy' . $column;
$this->$method($value);
return $this->findOne($con);
} | php | public function findOneBy($column, $value, $con = null)
{
$method = 'filterBy' . $column;
$this->$method($value);
return $this->findOne($con);
} | [
"public",
"function",
"findOneBy",
"(",
"$",
"column",
",",
"$",
"value",
",",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"method",
"=",
"'filterBy'",
".",
"$",
"column",
";",
"$",
"this",
"->",
"$",
"method",
"(",
"$",
"value",
")",
";",
"return",
... | Apply a condition on a column and issues the SELECT ... LIMIT 1 query
@see filterBy()
@see findOne()
@param mixed $column A string representing thecolumn phpName, e.g. 'AuthorId'
@param mixed $value A value for the condition
@param PropelPDO $con an optional connection object
@return mixed th... | [
"Apply",
"a",
"condition",
"on",
"a",
"column",
"and",
"issues",
"the",
"SELECT",
"...",
"LIMIT",
"1",
"query"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1451-L1457 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.findOneByArray | public function findOneByArray($conditions, $con = null)
{
$this->filterByArray($conditions);
return $this->findOne($con);
} | php | public function findOneByArray($conditions, $con = null)
{
$this->filterByArray($conditions);
return $this->findOne($con);
} | [
"public",
"function",
"findOneByArray",
"(",
"$",
"conditions",
",",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"filterByArray",
"(",
"$",
"conditions",
")",
";",
"return",
"$",
"this",
"->",
"findOne",
"(",
"$",
"con",
")",
";",
"}"
] | Apply a list of conditions on columns and issues the SELECT ... LIMIT 1 query
<code>
$c->findOneByArray(array(
'Title' => 'War And Peace',
'Publisher' => $publisher
), $con);
</code>
@see filterByArray()
@see findOne()
@param mixed $conditions An array of conditions, using column phpNames as key
@... | [
"Apply",
"a",
"list",
"of",
"conditions",
"on",
"columns",
"and",
"issues",
"the",
"SELECT",
"...",
"LIMIT",
"1",
"query",
"<code",
">",
"$c",
"-",
">",
"findOneByArray",
"(",
"array",
"(",
"Title",
"=",
">",
"War",
"And",
"Peace",
"Publisher",
"=",
">... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1476-L1481 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.count | public function count($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName($this->getDbName()); // ... | php | public function count($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$criteria->setDbName($this->getDbName()); // ... | [
"public",
"function",
"count",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Propel",
"::",
"CONNECTION... | Issue a SELECT COUNT(*) query based on the current ModelCriteria
@param PropelPDO $con an optional connection object
@return integer the number of results | [
"Issue",
"a",
"SELECT",
"COUNT",
"(",
"*",
")",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1490-L1514 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.delete | public function delete($con = null)
{
if (count($this->getMap()) == 0) {
throw new PropelException('delete() expects a Criteria with at least one condition. Use deleteAll() to delete all the rows of a table');
}
if ($con === null) {
$con = Propel::getConnection($this... | php | public function delete($con = null)
{
if (count($this->getMap()) == 0) {
throw new PropelException('delete() expects a Criteria with at least one condition. Use deleteAll() to delete all the rows of a table');
}
if ($con === null) {
$con = Propel::getConnection($this... | [
"public",
"function",
"delete",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"getMap",
"(",
")",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'delete() expects a Criteria with at least one conditio... | Issue a DELETE query based on the current ModelCriteria
An optional hook on basePreDelete() can prevent the actual deletion
@param PropelPDO $con an optional connection object
@return integer the number of deleted rows
@throws PropelException | [
"Issue",
"a",
"DELETE",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"An",
"optional",
"hook",
"on",
"basePreDelete",
"()",
"can",
"prevent",
"the",
"actual",
"deletion"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1639-L1665 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.deleteAll | public function deleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
if (!$affectedRows = $this->basePreDelete($con)) {
$affectedRows = $this... | php | public function deleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
if (!$affectedRows = $this->basePreDelete($con)) {
$affectedRows = $this... | [
"public",
"function",
"deleteAll",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
",",
"Propel",
"::",
"CONNEC... | Issue a DELETE query based on the current ModelCriteria deleting all rows in the table
An optional hook on basePreDelete() can prevent the actual deletion
@param PropelPDO $con an optional connection object
@return integer the number of deleted rows
@throws Exception|PropelException | [
"Issue",
"a",
"DELETE",
"query",
"based",
"on",
"the",
"current",
"ModelCriteria",
"deleting",
"all",
"rows",
"in",
"the",
"table",
"An",
"optional",
"hook",
"on",
"basePreDelete",
"()",
"can",
"prevent",
"the",
"actual",
"deletion"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1692-L1710 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.basePreUpdate | protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
{
return $this->preUpdate($values, $con, $forceIndividualSaves);
} | php | protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
{
return $this->preUpdate($values, $con, $forceIndividualSaves);
} | [
"protected",
"function",
"basePreUpdate",
"(",
"&",
"$",
"values",
",",
"PropelPDO",
"$",
"con",
",",
"$",
"forceIndividualSaves",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"preUpdate",
"(",
"$",
"values",
",",
"$",
"con",
",",
"$",
"forceIndi... | Code to execute before every UPDATE statement
@param array $values The associative array of columns and values for the update
@param PropelPDO $con The connection object used by the query
@param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doU... | [
"Code",
"to",
"execute",
"before",
"every",
"UPDATE",
"statement"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1734-L1737 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.update | public function update($values, $con = null, $forceIndividualSaves = false)
{
if (!is_array($values)) {
throw new PropelException('set() expects an array as first argument');
}
if (count($this->getJoins())) {
throw new PropelException('set() does not support multitabl... | php | public function update($values, $con = null, $forceIndividualSaves = false)
{
if (!is_array($values)) {
throw new PropelException('set() expects an array as first argument');
}
if (count($this->getJoins())) {
throw new PropelException('set() does not support multitabl... | [
"public",
"function",
"update",
"(",
"$",
"values",
",",
"$",
"con",
"=",
"null",
",",
"$",
"forceIndividualSaves",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'set() e... | Issue an UPDATE query based the current ModelCriteria and a list of changes.
An optional hook on basePreUpdate() can prevent the actual update.
Beware that behaviors based on hooks in the object's save() method
will only be triggered if you force individual saves, i.e. if you pass true as second argument.
@param array... | [
"Issue",
"an",
"UPDATE",
"query",
"based",
"the",
"current",
"ModelCriteria",
"and",
"a",
"list",
"of",
"changes",
".",
"An",
"optional",
"hook",
"on",
"basePreUpdate",
"()",
"can",
"prevent",
"the",
"actual",
"update",
".",
"Beware",
"that",
"behaviors",
"b... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1772-L1804 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.getCriterionForClause | protected function getCriterionForClause($clause, $value, $bindingType = null)
{
$clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
// this is enough to determine the type to bind the parameter to
... | php | protected function getCriterionForClause($clause, $value, $bindingType = null)
{
$clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
// this is enough to determine the type to bind the parameter to
... | [
"protected",
"function",
"getCriterionForClause",
"(",
"$",
"clause",
",",
"$",
"value",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"$",
"clause",
"=",
"trim",
"(",
"$",
"clause",
")",
";",
"if",
"(",
"$",
"this",
"->",
"replaceNames",
"(",
"$",
... | Creates a Criterion object based on a SQL clause and a value
Uses introspection to translate the column phpName into a fully qualified name
@param string $clause The pseudo SQL clause, e.g. 'AuthorId = ?'
@param mixed $value A value for the condition
@param string $bindingType
@return Criterion a Criterio... | [
"Creates",
"a",
"Criterion",
"object",
"based",
"on",
"a",
"SQL",
"clause",
"and",
"a",
"value",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1875-L1911 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.convertValueForColumn | protected function convertValueForColumn($value, ColumnMap $colMap)
{
if ($colMap->getType() == 'OBJECT' && is_object($value)) {
if (is_array($value)) {
$value = array_map('serialize', $value);
} else {
$value = serialize($value);
}
... | php | protected function convertValueForColumn($value, ColumnMap $colMap)
{
if ($colMap->getType() == 'OBJECT' && is_object($value)) {
if (is_array($value)) {
$value = array_map('serialize', $value);
} else {
$value = serialize($value);
}
... | [
"protected",
"function",
"convertValueForColumn",
"(",
"$",
"value",
",",
"ColumnMap",
"$",
"colMap",
")",
"{",
"if",
"(",
"$",
"colMap",
"->",
"getType",
"(",
")",
"==",
"'OBJECT'",
"&&",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"is_a... | Converts value for some column types
@param mixed $value The value to convert
@param ColumnMap $colMap The ColumnMap object
@return mixed The converted value | [
"Converts",
"value",
"for",
"some",
"column",
"types"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1921-L1940 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.replaceNames | protected function replaceNames(&$clause)
{
$this->replacedColumns = array();
$this->currentAlias = '';
$this->foundMatch = false;
$isAfterBackslash = false;
$isInString = false;
$stringQuotes = '';
$parsedString = '';
$stringToTransform = '';
... | php | protected function replaceNames(&$clause)
{
$this->replacedColumns = array();
$this->currentAlias = '';
$this->foundMatch = false;
$isAfterBackslash = false;
$isInString = false;
$stringQuotes = '';
$parsedString = '';
$stringToTransform = '';
... | [
"protected",
"function",
"replaceNames",
"(",
"&",
"$",
"clause",
")",
"{",
"$",
"this",
"->",
"replacedColumns",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"currentAlias",
"=",
"''",
";",
"$",
"this",
"->",
"foundMatch",
"=",
"false",
";",
"$",
... | Replaces complete column names (like Article.AuthorId) in an SQL clause
by their exact Propel column fully qualified name (e.g. article.AUTHOR_ID)
but ignores the column names inside quotes
e.g. 'CONCAT(Book.Title, "Book.Title") = ?'
=> 'CONCAT(book.TITLE, "Book.Title") = ?'
@param string $clause SQL clause to inspect... | [
"Replaces",
"complete",
"column",
"names",
"(",
"like",
"Article",
".",
"AuthorId",
")",
"in",
"an",
"SQL",
"clause",
"by",
"their",
"exact",
"Propel",
"column",
"fully",
"qualified",
"name",
"(",
"e",
".",
"g",
".",
"article",
".",
"AUTHOR_ID",
")",
"bu... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L1953-L2003 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.doReplaceNameInExpression | protected function doReplaceNameInExpression($matches)
{
$key = $matches[0];
list($column, $realColumnName) = $this->getColumnFromName($key);
if ($column instanceof ColumnMap) {
$this->replacedColumns[] = $column;
$this->foundMatch = true;
return $realCol... | php | protected function doReplaceNameInExpression($matches)
{
$key = $matches[0];
list($column, $realColumnName) = $this->getColumnFromName($key);
if ($column instanceof ColumnMap) {
$this->replacedColumns[] = $column;
$this->foundMatch = true;
return $realCol... | [
"protected",
"function",
"doReplaceNameInExpression",
"(",
"$",
"matches",
")",
"{",
"$",
"key",
"=",
"$",
"matches",
"[",
"0",
"]",
";",
"list",
"(",
"$",
"column",
",",
"$",
"realColumnName",
")",
"=",
"$",
"this",
"->",
"getColumnFromName",
"(",
"$",
... | Callback function to replace column names by their real name in a clause
e.g. 'Book.Title IN ?'
=> 'book.TITLE IN ?'
@param array $matches Matches found by preg_replace_callback
@return string the column name replacement | [
"Callback",
"function",
"to",
"replace",
"column",
"names",
"by",
"their",
"real",
"name",
"in",
"a",
"clause",
"e",
".",
"g",
".",
"Book",
".",
"Title",
"IN",
"?",
"=",
">",
"book",
".",
"TITLE",
"IN",
"?"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L2014-L2026 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.getColumnFromName | protected function getColumnFromName($phpName, $failSilently = true)
{
if (strpos($phpName, '.') === false) {
$prefix = $this->getModelAliasOrName();
} else {
// $prefix could be either class name or table name
list($prefix, $phpName) = explode('.', $phpName);
... | php | protected function getColumnFromName($phpName, $failSilently = true)
{
if (strpos($phpName, '.') === false) {
$prefix = $this->getModelAliasOrName();
} else {
// $prefix could be either class name or table name
list($prefix, $phpName) = explode('.', $phpName);
... | [
"protected",
"function",
"getColumnFromName",
"(",
"$",
"phpName",
",",
"$",
"failSilently",
"=",
"true",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"phpName",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"$",
"prefix",
"=",
"$",
"this",
"->",
"getModelAli... | Finds a column and a SQL translation for a pseudo SQL column name
Respects table aliases previously registered in a join() or addAlias()
Examples:
<code>
$c->getColumnFromName('Book.Title');
=> array($bookTitleColumnMap, 'book.TITLE')
$c->join('Book.Author a')
->getColumnFromName('a.FirstName');
=> array($authorFirstNa... | [
"Finds",
"a",
"column",
"and",
"a",
"SQL",
"translation",
"for",
"a",
"pseudo",
"SQL",
"column",
"name",
"Respects",
"table",
"aliases",
"previously",
"registered",
"in",
"a",
"join",
"()",
"or",
"addAlias",
"()",
"Examples",
":",
"<code",
">",
"$c",
"-",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L2047-L2098 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.addUsingAlias | public function addUsingAlias($column, $value = null, $operator = null)
{
return $this->addUsingOperator($this->getAliasedColName($column), $value, $operator);
} | php | public function addUsingAlias($column, $value = null, $operator = null)
{
return $this->addUsingOperator($this->getAliasedColName($column), $value, $operator);
} | [
"public",
"function",
"addUsingAlias",
"(",
"$",
"column",
",",
"$",
"value",
"=",
"null",
",",
"$",
"operator",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingOperator",
"(",
"$",
"this",
"->",
"getAliasedColName",
"(",
"$",
"column",
")",... | Overrides Criteria::add() to force the use of a true table alias if it exists
@see Criteria::add()
@param string $column The colName of column to run the condition on (e.g. BookPeer::ID)
@param mixed $value
@param string $operator A String, like Criteria::EQUAL.
@return ModelCriteria A modified Criteria ob... | [
"Overrides",
"Criteria",
"::",
"add",
"()",
"to",
"force",
"the",
"use",
"of",
"a",
"true",
"table",
"alias",
"if",
"it",
"exists"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L2183-L2186 |
propelorm/Propel | runtime/lib/query/ModelCriteria.php | ModelCriteria.explain | public function explain($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName());
}
$this->basePreSelect($con);
// check that the columns of the main class are already added (if this is the primary ModelCriteria)
if (!$this->hasSelectC... | php | public function explain($con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName());
}
$this->basePreSelect($con);
// check that the columns of the main class are already added (if this is the primary ModelCriteria)
if (!$this->hasSelectC... | [
"public",
"function",
"explain",
"(",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"con",
"===",
"null",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getConnection",
"(",
"$",
"this",
"->",
"getDbName",
"(",
")",
")",
";",
"}",
"$",
"this",
... | Make explain plan of the query
@param PropelPDO $con propel connection
@throws PropelException on error
@return array array of the explain plan | [
"Make",
"explain",
"plan",
"of",
"the",
"query"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/ModelCriteria.php#L2315-L2337 |
propelorm/Propel | generator/lib/model/Database.php | Database.setupObject | protected function setupObject()
{
parent::setupObject();
$this->name = $this->getAttribute("name");
$this->baseClass = $this->getAttribute("baseClass");
$this->basePeer = $this->getAttribute("basePeer");
$this->defaultIdMethod = $this->getAttribute("defaultIdMethod", IDMetho... | php | protected function setupObject()
{
parent::setupObject();
$this->name = $this->getAttribute("name");
$this->baseClass = $this->getAttribute("baseClass");
$this->basePeer = $this->getAttribute("basePeer");
$this->defaultIdMethod = $this->getAttribute("defaultIdMethod", IDMetho... | [
"protected",
"function",
"setupObject",
"(",
")",
"{",
"parent",
"::",
"setupObject",
"(",
")",
";",
"$",
"this",
"->",
"name",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"\"name\"",
")",
";",
"$",
"this",
"->",
"baseClass",
"=",
"$",
"this",
"->",
... | Sets up the Database object based on the attributes that were passed to loadFromXML().
@see parent::loadFromXML() | [
"Sets",
"up",
"the",
"Database",
"object",
"based",
"on",
"the",
"attributes",
"that",
"were",
"passed",
"to",
"loadFromXML",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L102-L114 |
propelorm/Propel | generator/lib/model/Database.php | Database.countTables | public function countTables()
{
$count = 0;
foreach ($this->tableList as $table) {
if (!$table->isReadOnly()) {
$count++;
}
}
return $count;
} | php | public function countTables()
{
$count = 0;
foreach ($this->tableList as $table) {
if (!$table->isReadOnly()) {
$count++;
}
}
return $count;
} | [
"public",
"function",
"countTables",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"tableList",
"as",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"$",
"table",
"->",
"isReadOnly",
"(",
")",
")",
"{",
"$",
"count",
"++... | Return the number of tables in the database
@return integer | [
"Return",
"the",
"number",
"of",
"tables",
"in",
"the",
"database"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L322-L332 |
propelorm/Propel | generator/lib/model/Database.php | Database.getTable | public function getTable($name, $caseInsensitive = false)
{
if ($this->hasTable($name, $caseInsensitive)) {
if ($caseInsensitive) {
return $this->tablesByLowercaseName[strtolower($name)];
} else {
return $this->tablesByName[$name];
}
... | php | public function getTable($name, $caseInsensitive = false)
{
if ($this->hasTable($name, $caseInsensitive)) {
if ($caseInsensitive) {
return $this->tablesByLowercaseName[strtolower($name)];
} else {
return $this->tablesByName[$name];
}
... | [
"public",
"function",
"getTable",
"(",
"$",
"name",
",",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasTable",
"(",
"$",
"name",
",",
"$",
"caseInsensitive",
")",
")",
"{",
"if",
"(",
"$",
"caseInsensitive",
")",
"... | Return the table with the specified name.
@param string $name The name of the table (e.g. 'my_table')
@param boolean $caseInsensitive Whether the check is case insensitive. False by default.
@return Table a Table object or null if it doesn't exist | [
"Return",
"the",
"table",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L376-L387 |
propelorm/Propel | generator/lib/model/Database.php | Database.addDomain | public function addDomain($data)
{
if ($data instanceof Domain) {
$domain = $data; // alias
$domain->setDatabase($this);
$this->domainMap[$domain->getName()] = $domain;
return $domain;
} else {
$domain = new Domain();
$domain->... | php | public function addDomain($data)
{
if ($data instanceof Domain) {
$domain = $data; // alias
$domain->setDatabase($this);
$this->domainMap[$domain->getName()] = $domain;
return $domain;
} else {
$domain = new Domain();
$domain->... | [
"public",
"function",
"addDomain",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Domain",
")",
"{",
"$",
"domain",
"=",
"$",
"data",
";",
"// alias",
"$",
"domain",
"->",
"setDatabase",
"(",
"$",
"this",
")",
";",
"$",
"this",
... | Adds Domain object from <domain> tag.
@param Domain|string $data XML attributes (array) or Domain object.
@return Domain | [
"Adds",
"Domain",
"object",
"from",
"<domain",
">",
"tag",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L484-L499 |
propelorm/Propel | generator/lib/model/Database.php | Database.getDomain | public function getDomain($domainName)
{
if (isset($this->domainMap[$domainName])) {
return $this->domainMap[$domainName];
}
return null; // just to be explicit
} | php | public function getDomain($domainName)
{
if (isset($this->domainMap[$domainName])) {
return $this->domainMap[$domainName];
}
return null; // just to be explicit
} | [
"public",
"function",
"getDomain",
"(",
"$",
"domainName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"domainMap",
"[",
"$",
"domainName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"domainMap",
"[",
"$",
"domainName",
"]",
";",
"}",... | Get already configured Domain object by name.
@return Domain | [
"Get",
"already",
"configured",
"Domain",
"object",
"by",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L506-L513 |
propelorm/Propel | generator/lib/model/Database.php | Database.addBehavior | public function addBehavior($bdata)
{
if ($bdata instanceof Behavior) {
$behavior = $bdata;
$behavior->setDatabase($this);
$this->behaviors[$behavior->getName()] = $behavior;
return $behavior;
} else {
$class = $this->getConfiguredBehavior... | php | public function addBehavior($bdata)
{
if ($bdata instanceof Behavior) {
$behavior = $bdata;
$behavior->setDatabase($this);
$this->behaviors[$behavior->getName()] = $behavior;
return $behavior;
} else {
$class = $this->getConfiguredBehavior... | [
"public",
"function",
"addBehavior",
"(",
"$",
"bdata",
")",
"{",
"if",
"(",
"$",
"bdata",
"instanceof",
"Behavior",
")",
"{",
"$",
"behavior",
"=",
"$",
"bdata",
";",
"$",
"behavior",
"->",
"setDatabase",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->... | Adds a new Behavior to the database
@return Behavior A behavior instance | [
"Adds",
"a",
"new",
"Behavior",
"to",
"the",
"database"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L538-L553 |
propelorm/Propel | generator/lib/model/Database.php | Database.getNextTableBehavior | public function getNextTableBehavior()
{
// order the behaviors according to Behavior::$tableModificationOrder
$behaviors = array();
foreach ($this->getTables() as $table) {
foreach ($table->getBehaviors() as $behavior) {
if (!$behavior->isTableModified()) {
... | php | public function getNextTableBehavior()
{
// order the behaviors according to Behavior::$tableModificationOrder
$behaviors = array();
foreach ($this->getTables() as $table) {
foreach ($table->getBehaviors() as $behavior) {
if (!$behavior->isTableModified()) {
... | [
"public",
"function",
"getNextTableBehavior",
"(",
")",
"{",
"// order the behaviors according to Behavior::$tableModificationOrder",
"$",
"behaviors",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTables",
"(",
")",
"as",
"$",
"table",
")",
... | Get the next behavior on all tables, ordered by behavior priority,
and skipping the ones that were already executed,
@return Behavior | [
"Get",
"the",
"next",
"behavior",
"on",
"all",
"tables",
"ordered",
"by",
"behavior",
"priority",
"and",
"skipping",
"the",
"ones",
"that",
"were",
"already",
"executed"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Database.php#L605-L622 |
propelorm/Propel | generator/lib/behavior/sortable/SortableBehaviorObjectBuilderModifier.php | SortableBehaviorObjectBuilderModifier.addScopeAccessors | protected function addScopeAccessors(&$script)
{
$script .= "
/**
* Wrap the getter for scope value
*
* @param boolean \$returnNulls If true and all scope values are null, this will return null instead of a array full with nulls
*
* @return mixed A array or a native type
*/
public function getSco... | php | protected function addScopeAccessors(&$script)
{
$script .= "
/**
* Wrap the getter for scope value
*
* @param boolean \$returnNulls If true and all scope values are null, this will return null instead of a array full with nulls
*
* @return mixed A array or a native type
*/
public function getSco... | [
"protected",
"function",
"addScopeAccessors",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"script",
".=",
"\"\n\n/**\n * Wrap the getter for scope value\n *\n * @param boolean \\$returnNulls If true and all scope values are null, this will return null instead of a array full with nulls\n *\n * @... | Get the wraps for getter/setter, if the scope column has not the default name
@return string | [
"Get",
"the",
"wraps",
"for",
"getter",
"/",
"setter",
"if",
"the",
"scope",
"column",
"has",
"not",
"the",
"default",
"name"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/sortable/SortableBehaviorObjectBuilderModifier.php#L264-L334 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.getConfiguration | public function getConfiguration()
{
if (null === $this->configuration) {
$this->configuration = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT);
}
return $this->configuration;
} | php | public function getConfiguration()
{
if (null === $this->configuration) {
$this->configuration = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT);
}
return $this->configuration;
} | [
"public",
"function",
"getConfiguration",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"configuration",
")",
"{",
"$",
"this",
"->",
"configuration",
"=",
"Propel",
"::",
"getConfiguration",
"(",
"PropelConfiguration",
"::",
"TYPE_OBJECT",
")",
... | Get the runtime configuration
@return PropelConfiguration | [
"Get",
"the",
"runtime",
"configuration"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L176-L183 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.beginTransaction | public function beginTransaction()
{
$return = true;
if (!$this->nestedTransactionCount) {
$return = parent::beginTransaction();
if ($this->useDebug) {
$this->log('Begin transaction', null, __METHOD__);
}
$this->isUncommitable = false;
... | php | public function beginTransaction()
{
$return = true;
if (!$this->nestedTransactionCount) {
$return = parent::beginTransaction();
if ($this->useDebug) {
$this->log('Begin transaction', null, __METHOD__);
}
$this->isUncommitable = false;
... | [
"public",
"function",
"beginTransaction",
"(",
")",
"{",
"$",
"return",
"=",
"true",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"nestedTransactionCount",
")",
"{",
"$",
"return",
"=",
"parent",
"::",
"beginTransaction",
"(",
")",
";",
"if",
"(",
"$",
"thi... | Overrides PDO::beginTransaction() to prevent errors due to already-in-progress transaction.
@return boolean | [
"Overrides",
"PDO",
"::",
"beginTransaction",
"()",
"to",
"prevent",
"errors",
"due",
"to",
"already",
"-",
"in",
"-",
"progress",
"transaction",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L232-L245 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.commit | public function commit()
{
$return = true;
$opcount = $this->nestedTransactionCount;
if ($opcount > 0) {
if ($opcount === 1) {
if ($this->isUncommitable) {
throw new PropelException('Cannot commit because a nested transaction was rolled back')... | php | public function commit()
{
$return = true;
$opcount = $this->nestedTransactionCount;
if ($opcount > 0) {
if ($opcount === 1) {
if ($this->isUncommitable) {
throw new PropelException('Cannot commit because a nested transaction was rolled back')... | [
"public",
"function",
"commit",
"(",
")",
"{",
"$",
"return",
"=",
"true",
";",
"$",
"opcount",
"=",
"$",
"this",
"->",
"nestedTransactionCount",
";",
"if",
"(",
"$",
"opcount",
">",
"0",
")",
"{",
"if",
"(",
"$",
"opcount",
"===",
"1",
")",
"{",
... | Overrides PDO::commit() to only commit the transaction if we are in the outermost
transaction nesting level.
@return boolean
@throws PropelException | [
"Overrides",
"PDO",
"::",
"commit",
"()",
"to",
"only",
"commit",
"the",
"transaction",
"if",
"we",
"are",
"in",
"the",
"outermost",
"transaction",
"nesting",
"level",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L255-L276 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.rollBack | public function rollBack()
{
$return = true;
$opcount = $this->nestedTransactionCount;
if ($opcount > 0) {
if ($opcount === 1) {
$return = parent::rollBack();
if ($this->useDebug) {
$this->log('Rollback transaction', null, __ME... | php | public function rollBack()
{
$return = true;
$opcount = $this->nestedTransactionCount;
if ($opcount > 0) {
if ($opcount === 1) {
$return = parent::rollBack();
if ($this->useDebug) {
$this->log('Rollback transaction', null, __ME... | [
"public",
"function",
"rollBack",
"(",
")",
"{",
"$",
"return",
"=",
"true",
";",
"$",
"opcount",
"=",
"$",
"this",
"->",
"nestedTransactionCount",
";",
"if",
"(",
"$",
"opcount",
">",
"0",
")",
"{",
"if",
"(",
"$",
"opcount",
"===",
"1",
")",
"{",... | Overrides PDO::rollBack() to only rollback the transaction if we are in the outermost
transaction nesting level
@return boolean Whether operation was successful. | [
"Overrides",
"PDO",
"::",
"rollBack",
"()",
"to",
"only",
"rollback",
"the",
"transaction",
"if",
"we",
"are",
"in",
"the",
"outermost",
"transaction",
"nesting",
"level"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L284-L303 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.forceRollBack | public function forceRollBack()
{
$return = true;
if ($this->nestedTransactionCount) {
// If we're in a transaction, always roll it back
// regardless of nesting level.
$return = parent::rollBack();
// reset nested transaction count to 0 so that we d... | php | public function forceRollBack()
{
$return = true;
if ($this->nestedTransactionCount) {
// If we're in a transaction, always roll it back
// regardless of nesting level.
$return = parent::rollBack();
// reset nested transaction count to 0 so that we d... | [
"public",
"function",
"forceRollBack",
"(",
")",
"{",
"$",
"return",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"nestedTransactionCount",
")",
"{",
"// If we're in a transaction, always roll it back",
"// regardless of nesting level.",
"$",
"return",
"=",
"parent... | Rollback the whole transaction, even if this is a nested rollback
and reset the nested transaction count to 0.
@return boolean Whether operation was successful. | [
"Rollback",
"the",
"whole",
"transaction",
"even",
"if",
"this",
"is",
"a",
"nested",
"rollback",
"and",
"reset",
"the",
"nested",
"transaction",
"count",
"to",
"0",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L311-L330 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.setAttribute | public function setAttribute($attribute, $value)
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
$this->cachePreparedStatements = $value;
break;
case self::PROPEL_ATTR_CONNECTION_NAME:
$this->connectionName = $value;
... | php | public function setAttribute($attribute, $value)
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
$this->cachePreparedStatements = $value;
break;
case self::PROPEL_ATTR_CONNECTION_NAME:
$this->connectionName = $value;
... | [
"public",
"function",
"setAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"attribute",
")",
"{",
"case",
"self",
"::",
"PROPEL_ATTR_CACHE_PREPARES",
":",
"$",
"this",
"->",
"cachePreparedStatements",
"=",
"$",
"value",
";"... | Sets a connection attribute.
This is overridden here to provide support for setting Propel-specific attributes too.
@param integer $attribute The attribute to set (e.g. PropelPDO::PROPEL_ATTR_CACHE_PREPARES).
@param mixed $value The attribute value.
@return void | [
"Sets",
"a",
"connection",
"attribute",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L342-L354 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.getAttribute | public function getAttribute($attribute)
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
return $this->cachePreparedStatements;
break;
case self::PROPEL_ATTR_CONNECTION_NAME:
return $this->connectionName;
... | php | public function getAttribute($attribute)
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
return $this->cachePreparedStatements;
break;
case self::PROPEL_ATTR_CONNECTION_NAME:
return $this->connectionName;
... | [
"public",
"function",
"getAttribute",
"(",
"$",
"attribute",
")",
"{",
"switch",
"(",
"$",
"attribute",
")",
"{",
"case",
"self",
"::",
"PROPEL_ATTR_CACHE_PREPARES",
":",
"return",
"$",
"this",
"->",
"cachePreparedStatements",
";",
"break",
";",
"case",
"self"... | Gets a connection attribute.
This is overridden here to provide support for setting Propel-specific attributes too.
@param integer $attribute The attribute to get (e.g. PropelPDO::PROPEL_ATTR_CACHE_PREPARES).
@return mixed | [
"Gets",
"a",
"connection",
"attribute",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L365-L377 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.prepare | public function prepare($sql, $driver_options = array())
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
if ($this->cachePreparedStatements) {
if (!isset($this->preparedStatements[$sql])) {
$return = parent::prepare($sql, $driver_option... | php | public function prepare($sql, $driver_options = array())
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
if ($this->cachePreparedStatements) {
if (!isset($this->preparedStatements[$sql])) {
$return = parent::prepare($sql, $driver_option... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
",",
"$",
"driver_options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useDebug",
")",
"{",
"$",
"debug",
"=",
"$",
"this",
"->",
"getDebugSnapshot",
"(",
")",
";",
"}",
"if",
... | Prepares a statement for execution and returns a statement object.
Overrides PDO::prepare() in order to:
- Add logging and query counting if logging is true.
- Add query caching support if the PropelPDO::PROPEL_ATTR_CACHE_PREPARES was set to true.
@param string $sql This must be a valid SQL statement for t... | [
"Prepares",
"a",
"statement",
"for",
"execution",
"and",
"returns",
"a",
"statement",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L392-L414 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.exec | public function exec($sql)
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
$return = parent::exec($sql);
if ($this->useDebug) {
$this->log($sql, null, __METHOD__, $debug);
$this->setLastExecutedQuery($sql);
$this->incre... | php | public function exec($sql)
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
$return = parent::exec($sql);
if ($this->useDebug) {
$this->log($sql, null, __METHOD__, $debug);
$this->setLastExecutedQuery($sql);
$this->incre... | [
"public",
"function",
"exec",
"(",
"$",
"sql",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useDebug",
")",
"{",
"$",
"debug",
"=",
"$",
"this",
"->",
"getDebugSnapshot",
"(",
")",
";",
"}",
"$",
"return",
"=",
"parent",
"::",
"exec",
"(",
"$",
"sql"... | Execute an SQL statement and return the number of affected rows.
Overrides PDO::exec() to log queries when required
@param string $sql
@return integer | [
"Execute",
"an",
"SQL",
"statement",
"and",
"return",
"the",
"number",
"of",
"affected",
"rows",
".",
"Overrides",
"PDO",
"::",
"exec",
"()",
"to",
"log",
"queries",
"when",
"required"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L424-L439 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.query | public function query()
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
$args = func_get_args();
if (version_compare(PHP_VERSION, '5.3', '<')) {
$return = call_user_func_array(array($this, 'parent::query'), $args);
} else {
... | php | public function query()
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
}
$args = func_get_args();
if (version_compare(PHP_VERSION, '5.3', '<')) {
$return = call_user_func_array(array($this, 'parent::query'), $args);
} else {
... | [
"public",
"function",
"query",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useDebug",
")",
"{",
"$",
"debug",
"=",
"$",
"this",
"->",
"getDebugSnapshot",
"(",
")",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"version_co... | Executes an SQL statement, returning a result set as a PDOStatement object.
Despite its signature here, this method takes a variety of parameters.
Overrides PDO::query() to log queries when required
@see http://php.net/manual/en/pdo.query.php for a description of the possible parameters.
@return PDOStatement | [
"Executes",
"an",
"SQL",
"statement",
"returning",
"a",
"result",
"set",
"as",
"a",
"PDOStatement",
"object",
".",
"Despite",
"its",
"signature",
"here",
"this",
"method",
"takes",
"a",
"variety",
"of",
"parameters",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L451-L472 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.configureStatementClass | protected function configureStatementClass($class = 'PDOStatement', $suppressError = true)
{
// extending PDOStatement is only supported with non-persistent connections
if (!$this->getAttribute(PDO::ATTR_PERSISTENT)) {
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($class, array($t... | php | protected function configureStatementClass($class = 'PDOStatement', $suppressError = true)
{
// extending PDOStatement is only supported with non-persistent connections
if (!$this->getAttribute(PDO::ATTR_PERSISTENT)) {
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($class, array($t... | [
"protected",
"function",
"configureStatementClass",
"(",
"$",
"class",
"=",
"'PDOStatement'",
",",
"$",
"suppressError",
"=",
"true",
")",
"{",
"// extending PDOStatement is only supported with non-persistent connections",
"if",
"(",
"!",
"$",
"this",
"->",
"getAttribute"... | Configures the PDOStatement class for this connection.
@param string $class
@param boolean $suppressError Whether to suppress an exception if the statement class cannot be set.
@throws PropelException if the statement class cannot be set (and $suppressError is false). | [
"Configures",
"the",
"PDOStatement",
"class",
"for",
"this",
"connection",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L490-L498 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.useDebug | public function useDebug($value = true)
{
if ($value) {
$this->configureStatementClass('DebugPDOStatement', true);
} else {
// reset query logging
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement'));
$this->setLastExecutedQuery('');
... | php | public function useDebug($value = true)
{
if ($value) {
$this->configureStatementClass('DebugPDOStatement', true);
} else {
// reset query logging
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('PDOStatement'));
$this->setLastExecutedQuery('');
... | [
"public",
"function",
"useDebug",
"(",
"$",
"value",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"configureStatementClass",
"(",
"'DebugPDOStatement'",
",",
"true",
")",
";",
"}",
"else",
"{",
"// reset query logging",
"$",... | Enable or disable the query debug features
@param boolean $value True to enable debug (default), false to disable it | [
"Enable",
"or",
"disable",
"the",
"query",
"debug",
"features"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L556-L568 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.log | public function log($msg, $level = null, $methodName = null, array $debugSnapshot = null)
{
// If logging has been specifically disabled, this method won't do anything
if (!$this->getLoggingConfig('enabled', true)) {
return;
}
// If the method being logged isn't one of t... | php | public function log($msg, $level = null, $methodName = null, array $debugSnapshot = null)
{
// If logging has been specifically disabled, this method won't do anything
if (!$this->getLoggingConfig('enabled', true)) {
return;
}
// If the method being logged isn't one of t... | [
"public",
"function",
"log",
"(",
"$",
"msg",
",",
"$",
"level",
"=",
"null",
",",
"$",
"methodName",
"=",
"null",
",",
"array",
"$",
"debugSnapshot",
"=",
"null",
")",
"{",
"// If logging has been specifically disabled, this method won't do anything",
"if",
"(",
... | Logs the method call or SQL using the Propel::log() method or a registered logger class.
@uses self::getLogPrefix()
@see self::setLogger()
@param string $msg Message to log.
@param integer $level Log level to use; will use self::setLogLevel() specified level by default.
@param string $m... | [
"Logs",
"the",
"method",
"call",
"or",
"SQL",
"using",
"the",
"Propel",
"::",
"log",
"()",
"method",
"or",
"a",
"registered",
"logger",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L613-L654 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.getDebugSnapshot | public function getDebugSnapshot()
{
if ($this->useDebug) {
return array(
'microtime' => microtime(true),
'memory_get_usage' => memory_get_usage($this->getLoggingConfig('realmemoryusage', false)),
'memory_get_peak_usage' => memory_... | php | public function getDebugSnapshot()
{
if ($this->useDebug) {
return array(
'microtime' => microtime(true),
'memory_get_usage' => memory_get_usage($this->getLoggingConfig('realmemoryusage', false)),
'memory_get_peak_usage' => memory_... | [
"public",
"function",
"getDebugSnapshot",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useDebug",
")",
"{",
"return",
"array",
"(",
"'microtime'",
"=>",
"microtime",
"(",
"true",
")",
",",
"'memory_get_usage'",
"=>",
"memory_get_usage",
"(",
"$",
"this",
... | Returns a snapshot of the current values of some functions useful in debugging.
@return array
@throws PropelException | [
"Returns",
"a",
"snapshot",
"of",
"the",
"current",
"values",
"of",
"some",
"functions",
"useful",
"in",
"debugging",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L663-L674 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.getLogPrefix | protected function getLogPrefix($methodName, $debugSnapshot)
{
$config = $this->getConfiguration()->getParameters();
if (!isset($config['debugpdo']['logging']['details'])) {
return '';
}
$prefix = '';
$logDetails = $config['debugpdo']['logging']['details'];
... | php | protected function getLogPrefix($methodName, $debugSnapshot)
{
$config = $this->getConfiguration()->getParameters();
if (!isset($config['debugpdo']['logging']['details'])) {
return '';
}
$prefix = '';
$logDetails = $config['debugpdo']['logging']['details'];
... | [
"protected",
"function",
"getLogPrefix",
"(",
"$",
"methodName",
",",
"$",
"debugSnapshot",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"getParameters",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
... | Returns a prefix that may be prepended to a log line, containing debug information according
to the current configuration.
Uses a given $debugSnapshot to calculate how much time has passed since the call to self::getDebugSnapshot(),
how much the memory consumption by PHP has changed etc.
@see self::getDebugSnap... | [
"Returns",
"a",
"prefix",
"that",
"may",
"be",
"prepended",
"to",
"a",
"log",
"line",
"containing",
"debug",
"information",
"according",
"to",
"the",
"current",
"configuration",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L705-L772 |
propelorm/Propel | runtime/lib/connection/PropelPDO.php | PropelPDO.getReadableBytes | protected function getReadableBytes($bytes, $precision)
{
$suffix = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$total = count($suffix);
for ($i = 0; $bytes > 1024 && $i < $total; $i++) {
$bytes /= 1024;
}
return number_format($bytes, $precision)... | php | protected function getReadableBytes($bytes, $precision)
{
$suffix = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$total = count($suffix);
for ($i = 0; $bytes > 1024 && $i < $total; $i++) {
$bytes /= 1024;
}
return number_format($bytes, $precision)... | [
"protected",
"function",
"getReadableBytes",
"(",
"$",
"bytes",
",",
"$",
"precision",
")",
"{",
"$",
"suffix",
"=",
"array",
"(",
"'B'",
",",
"'kB'",
",",
"'MB'",
",",
"'GB'",
",",
"'TB'",
",",
"'PB'",
",",
"'EB'",
",",
"'ZB'",
",",
"'YB'",
")",
"... | Returns a human-readable representation of the given byte count.
@param integer $bytes Byte count to convert.
@param integer $precision How many decimals to include.
@return string | [
"Returns",
"a",
"human",
"-",
"readable",
"representation",
"of",
"the",
"given",
"byte",
"count",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/connection/PropelPDO.php#L782-L792 |
propelorm/Propel | generator/lib/task/PropelMigrationDownTask.php | PropelMigrationDownTask.main | public function main()
{
$manager = new PropelMigrationManager();
$manager->setConnections($this->getGeneratorConfig()->getBuildConnections());
$manager->setMigrationTable($this->getMigrationTable());
$manager->setMigrationDir($this->getOutputDirectory());
$previousTimestamp... | php | public function main()
{
$manager = new PropelMigrationManager();
$manager->setConnections($this->getGeneratorConfig()->getBuildConnections());
$manager->setMigrationTable($this->getMigrationTable());
$manager->setMigrationDir($this->getOutputDirectory());
$previousTimestamp... | [
"public",
"function",
"main",
"(",
")",
"{",
"$",
"manager",
"=",
"new",
"PropelMigrationManager",
"(",
")",
";",
"$",
"manager",
"->",
"setConnections",
"(",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getBuildConnections",
"(",
")",
")",
";... | Main method builds all the targets for a typical propel project. | [
"Main",
"method",
"builds",
"all",
"the",
"targets",
"for",
"a",
"typical",
"propel",
"project",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelMigrationDownTask.php#L26-L107 |
propelorm/Propel | generator/lib/builder/util/XmlToAppData.php | XmlToAppData.startElement | public function startElement($parser, $name, $attributes)
{
$parentTag = $this->peekCurrentSchemaTag();
if ($parentTag === false) {
switch ($name) {
case "database":
if ($this->isExternalSchema()) {
$this->currentPackage = @$a... | php | public function startElement($parser, $name, $attributes)
{
$parentTag = $this->peekCurrentSchemaTag();
if ($parentTag === false) {
switch ($name) {
case "database":
if ($this->isExternalSchema()) {
$this->currentPackage = @$a... | [
"public",
"function",
"startElement",
"(",
"$",
"parser",
",",
"$",
"name",
",",
"$",
"attributes",
")",
"{",
"$",
"parentTag",
"=",
"$",
"this",
"->",
"peekCurrentSchemaTag",
"(",
")",
";",
"if",
"(",
"$",
"parentTag",
"===",
"false",
")",
"{",
"switc... | Handles opening elements of the xml file.
@param string $uri
@param string $localName The local name (without prefix), or the empty string if
Namespace processing is not being performed.
@param string $rawName The qualified name (with prefix), or the empty string if
qualified names are not available.
@param string $at... | [
"Handles",
"opening",
"elements",
"of",
"the",
"xml",
"file",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/util/XmlToAppData.php#L150-L345 |
propelorm/Propel | runtime/lib/config/PropelConfiguration.php | PropelConfiguration.offsetSet | public function offsetSet($offset, $value)
{
$this->parameters[$offset] = $value;
$this->isFlattened = false;
} | php | public function offsetSet($offset, $value)
{
$this->parameters[$offset] = $value;
$this->isFlattened = false;
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"$",
"offset",
"]",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"isFlattened",
"=",
"false",
";",
"}"
] | @see http://www.php.net/ArrayAccess
@param integer $offset
@param mixed $value | [
"@see",
"http",
":",
"//",
"www",
".",
"php",
".",
"net",
"/",
"ArrayAccess"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/config/PropelConfiguration.php#L61-L65 |
propelorm/Propel | runtime/lib/config/PropelConfiguration.php | PropelConfiguration.getParameter | public function getParameter($name, $default = null)
{
$flattenedParameters = $this->getFlattenedParameters();
if (isset($flattenedParameters[$name])) {
return $flattenedParameters[$name];
}
return $default;
} | php | public function getParameter($name, $default = null)
{
$flattenedParameters = $this->getFlattenedParameters();
if (isset($flattenedParameters[$name])) {
return $flattenedParameters[$name];
}
return $default;
} | [
"public",
"function",
"getParameter",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"flattenedParameters",
"=",
"$",
"this",
"->",
"getFlattenedParameters",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"flattenedParameters",
"[",
"$",
... | Get a value from the container, using a namespaced key.
If the specified value is supposed to be an array, the actual return value will be null.
Examples:
<code>
$c['foo'] = 'bar';
echo $c->getParameter('foo'); => 'bar'
$c['foo1'] = array('foo2' => 'bar');
echo $c->getParameter('foo1'); => null
echo $c->getParameter('f... | [
"Get",
"a",
"value",
"from",
"the",
"container",
"using",
"a",
"namespaced",
"key",
".",
"If",
"the",
"specified",
"value",
"is",
"supposed",
"to",
"be",
"an",
"array",
"the",
"actual",
"return",
"value",
"will",
"be",
"null",
".",
"Examples",
":",
"<cod... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/config/PropelConfiguration.php#L107-L115 |
propelorm/Propel | runtime/lib/config/PropelConfiguration.php | PropelConfiguration.setParameter | public function setParameter($name, $value, $autoFlattenArrays = true)
{
$param = &$this->parameters;
$parts = explode('.', $name); //name.space.name
foreach ($parts as $part) {
$param = &$param[$part];
}
$param = $value;
if (is_array($value) && $autoFlatt... | php | public function setParameter($name, $value, $autoFlattenArrays = true)
{
$param = &$this->parameters;
$parts = explode('.', $name); //name.space.name
foreach ($parts as $part) {
$param = &$param[$part];
}
$param = $value;
if (is_array($value) && $autoFlatt... | [
"public",
"function",
"setParameter",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"autoFlattenArrays",
"=",
"true",
")",
"{",
"$",
"param",
"=",
"&",
"$",
"this",
"->",
"parameters",
";",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",... | Store a value to the container. Accept scalar and array values.
Examples:
<code>
$c->setParameter('foo', 'bar');
echo $c['foo']; => 'bar'
$c->setParameter('foo1.foo2', 'bar');
print_r($c['foo1']); => array('foo2' => 'bar')
</code>
@param string $name Configuration item name (name.space.name)
@param mixed... | [
"Store",
"a",
"value",
"to",
"the",
"container",
".",
"Accept",
"scalar",
"and",
"array",
"values",
".",
"Examples",
":",
"<code",
">",
"$c",
"-",
">",
"setParameter",
"(",
"foo",
"bar",
")",
";",
"echo",
"$c",
"[",
"foo",
"]",
";",
"=",
">",
"bar"... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/config/PropelConfiguration.php#L131-L145 |
propelorm/Propel | runtime/lib/config/PropelConfiguration.php | PropelConfiguration.getParameters | public function getParameters($type = PropelConfiguration::TYPE_ARRAY)
{
switch ($type) {
case PropelConfiguration::TYPE_ARRAY:
return $this->parameters;
case PropelConfiguration::TYPE_ARRAY_FLAT:
return $this->getFlattenedParameters();
cas... | php | public function getParameters($type = PropelConfiguration::TYPE_ARRAY)
{
switch ($type) {
case PropelConfiguration::TYPE_ARRAY:
return $this->parameters;
case PropelConfiguration::TYPE_ARRAY_FLAT:
return $this->getFlattenedParameters();
cas... | [
"public",
"function",
"getParameters",
"(",
"$",
"type",
"=",
"PropelConfiguration",
"::",
"TYPE_ARRAY",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"PropelConfiguration",
"::",
"TYPE_ARRAY",
":",
"return",
"$",
"this",
"->",
"parameters",
";",
"... | @throws PropelException
@param integer $type
@return mixed | [
"@throws",
"PropelException"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/config/PropelConfiguration.php#L154-L166 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverseTask.setAddValidators | public function setAddValidators($v)
{
$validKeys = array_keys(self::$validatorBitMap);
// lowercase input
$v = strtolower($v);
$bits = self::VALIDATORS_NONE;
$exprs = explode(',', $v);
foreach ($exprs as $expr) {
$expr = trim($expr);
if (!e... | php | public function setAddValidators($v)
{
$validKeys = array_keys(self::$validatorBitMap);
// lowercase input
$v = strtolower($v);
$bits = self::VALIDATORS_NONE;
$exprs = explode(',', $v);
foreach ($exprs as $expr) {
$expr = trim($expr);
if (!e... | [
"public",
"function",
"setAddValidators",
"(",
"$",
"v",
")",
"{",
"$",
"validKeys",
"=",
"array_keys",
"(",
"self",
"::",
"$",
"validatorBitMap",
")",
";",
"// lowercase input",
"$",
"v",
"=",
"strtolower",
"(",
"$",
"v",
")",
";",
"$",
"bits",
"=",
"... | Sets set validator bitfield from a comma-separated list of "validator bit" names.
@param string $v The comma-separated list of which validators to add.
@return void
@throws BuildException | [
"Sets",
"set",
"validator",
"bitfield",
"from",
"a",
"comma",
"-",
"separated",
"list",
"of",
"validator",
"bit",
"names",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L291-L312 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverseTask.buildModel | protected function buildModel()
{
$config = $this->getGeneratorConfig();
$con = $this->getConnection();
$this->log('Reading database structure...');
$database = new Database($this->getDatabaseName());
$database->setPlatform($config->getConfiguredPlatform($con));
$da... | php | protected function buildModel()
{
$config = $this->getGeneratorConfig();
$con = $this->getConnection();
$this->log('Reading database structure...');
$database = new Database($this->getDatabaseName());
$database->setPlatform($config->getConfiguredPlatform($con));
$da... | [
"protected",
"function",
"buildModel",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
";",
"$",
"con",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"this",
"->",
"log",
"(",
"'Reading database struct... | Builds the model classes from the database schema.
@return Database The built-out Database (with all tables, etc.) | [
"Builds",
"the",
"model",
"classes",
"from",
"the",
"database",
"schema",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L398-L414 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverseTask.addValidators | protected function addValidators(Database $database)
{
$platform = $this->getGeneratorConfig()->getConfiguredPlatform();
foreach ($database->getTables() as $table) {
$set = new PropelSchemaReverse_ValidatorSet();
foreach ($table->getColumns() as $col) {
i... | php | protected function addValidators(Database $database)
{
$platform = $this->getGeneratorConfig()->getConfiguredPlatform();
foreach ($database->getTables() as $table) {
$set = new PropelSchemaReverse_ValidatorSet();
foreach ($table->getColumns() as $col) {
i... | [
"protected",
"function",
"addValidators",
"(",
"Database",
"$",
"database",
")",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
"->",
"getConfiguredPlatform",
"(",
")",
";",
"foreach",
"(",
"$",
"database",
"->",
"getTables",
"... | Adds any requested validators to the data model.
We will add the following type specific validators:
for notNull columns: required validator
for unique indexes: unique validator
for varchar types: maxLength validators (CHAR, VARCHAR, LONGVARCHAR)
for numeric types: maxValue validators (BIGINT, SMALLINT, TINYINT, INTE... | [
"Adds",
"any",
"requested",
"validators",
"to",
"the",
"data",
"model",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L434-L481 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverseTask.getValidatorRule | protected function getValidatorRule(Column $column, $type, $value = null)
{
$rule = new Rule();
$rule->setName($type);
if ($value !== null) {
$rule->setValue($value);
}
$rule->setMessage($this->getRuleMessage($column, $type, $value));
return $rule;
} | php | protected function getValidatorRule(Column $column, $type, $value = null)
{
$rule = new Rule();
$rule->setName($type);
if ($value !== null) {
$rule->setValue($value);
}
$rule->setMessage($this->getRuleMessage($column, $type, $value));
return $rule;
} | [
"protected",
"function",
"getValidatorRule",
"(",
"Column",
"$",
"column",
",",
"$",
"type",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"rule",
"=",
"new",
"Rule",
"(",
")",
";",
"$",
"rule",
"->",
"setName",
"(",
"$",
"type",
")",
";",
"if",
... | Gets validator rule for specified type (string) .
@param Column $column The column that is being validated.
@param string $type The type (string) for validator (e.g. 'required').
@param mixed $value The value for the validator (if applicable)
@return Rule | [
"Gets",
"validator",
"rule",
"for",
"specified",
"type",
"(",
"string",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L492-L502 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverseTask.getRuleMessage | protected function getRuleMessage(Column $column, $type, $value)
{
// create message
$colName = $column->getName();
$tableName = $column->getTable()->getName();
$msg = self::$validatorMessages[strtolower($type)];
$tmp = compact($msg['var']);
array_unshift($tmp, $msg['... | php | protected function getRuleMessage(Column $column, $type, $value)
{
// create message
$colName = $column->getName();
$tableName = $column->getTable()->getName();
$msg = self::$validatorMessages[strtolower($type)];
$tmp = compact($msg['var']);
array_unshift($tmp, $msg['... | [
"protected",
"function",
"getRuleMessage",
"(",
"Column",
"$",
"column",
",",
"$",
"type",
",",
"$",
"value",
")",
"{",
"// create message",
"$",
"colName",
"=",
"$",
"column",
"->",
"getName",
"(",
")",
";",
"$",
"tableName",
"=",
"$",
"column",
"->",
... | Gets the message for a specified rule.
@param Column $column
@param string $type
@param mixed $value
@return string | [
"Gets",
"the",
"message",
"for",
"a",
"specified",
"rule",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L513-L524 |
propelorm/Propel | generator/lib/task/PropelSchemaReverseTask.php | PropelSchemaReverse_ValidatorSet.getValidator | public function getValidator(Column $column)
{
$key = $column->getName();
if (!isset($this->validators[$key])) {
$this->validators[$key] = new Validator();
$this->validators[$key]->setColumn($column);
}
return $this->validators[$key];
} | php | public function getValidator(Column $column)
{
$key = $column->getName();
if (!isset($this->validators[$key])) {
$this->validators[$key] = new Validator();
$this->validators[$key]->setColumn($column);
}
return $this->validators[$key];
} | [
"public",
"function",
"getValidator",
"(",
"Column",
"$",
"column",
")",
"{",
"$",
"key",
"=",
"$",
"column",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"validators",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",... | Gets a single validator for specified column name.
@param Column $column
@return Validator | [
"Gets",
"a",
"single",
"validator",
"for",
"specified",
"column",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSchemaReverseTask.php#L549-L558 |
propelorm/Propel | runtime/lib/map/DatabaseMap.php | DatabaseMap.addTableObject | public function addTableObject(TableMap $table)
{
$table->setDatabaseMap($this);
$this->tables[$table->getName()] = $table;
$this->tablesByPhpName[$table->getClassname()] = $table;
} | php | public function addTableObject(TableMap $table)
{
$table->setDatabaseMap($this);
$this->tables[$table->getName()] = $table;
$this->tablesByPhpName[$table->getClassname()] = $table;
} | [
"public",
"function",
"addTableObject",
"(",
"TableMap",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"setDatabaseMap",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"tables",
"[",
"$",
"table",
"->",
"getName",
"(",
")",
"]",
"=",
"$",
"table",
";",... | Add a new table object to the database.
@param TableMap $table The table to add | [
"Add",
"a",
"new",
"table",
"object",
"to",
"the",
"database",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/DatabaseMap.php#L77-L82 |
propelorm/Propel | runtime/lib/map/DatabaseMap.php | DatabaseMap.addTableFromMapClass | public function addTableFromMapClass($tableMapClass)
{
$table = new $tableMapClass();
if (!$this->hasTable($table->getName())) {
$this->addTableObject($table);
return $table;
} else {
return $this->getTable($table->getName());
}
} | php | public function addTableFromMapClass($tableMapClass)
{
$table = new $tableMapClass();
if (!$this->hasTable($table->getName())) {
$this->addTableObject($table);
return $table;
} else {
return $this->getTable($table->getName());
}
} | [
"public",
"function",
"addTableFromMapClass",
"(",
"$",
"tableMapClass",
")",
"{",
"$",
"table",
"=",
"new",
"$",
"tableMapClass",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTable",
"(",
"$",
"table",
"->",
"getName",
"(",
")",
")",
")",
"... | Add a new table to the database, using the tablemap class name.
@param string $tableMapClass The name of the table map to add
@return TableMap The TableMap object | [
"Add",
"a",
"new",
"table",
"to",
"the",
"database",
"using",
"the",
"tablemap",
"class",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/DatabaseMap.php#L91-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.