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/builder/om/QueryBuilder.php | QueryBuilder.addUseFkQuery | protected function addUseFkQuery(&$script, $fk)
{
$table = $this->getTable();
$fkTable = $this->getForeignTable($fk);
$fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable);
$queryClass = $fkQueryBuilder->getClassname();
if ($namespace = $fkQueryBuilder->getNamespace()) {
... | php | protected function addUseFkQuery(&$script, $fk)
{
$table = $this->getTable();
$fkTable = $this->getForeignTable($fk);
$fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable);
$queryClass = $fkQueryBuilder->getClassname();
if ($namespace = $fkQueryBuilder->getNamespace()) {
... | [
"protected",
"function",
"addUseFkQuery",
"(",
"&",
"$",
"script",
",",
"$",
"fk",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"fkTable",
"=",
"$",
"this",
"->",
"getForeignTable",
"(",
"$",
"fk",
")",
";",
"$",
... | Adds the useFkQuery method for this object.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"useFkQuery",
"method",
"for",
"this",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryBuilder.php#L1208-L1220 |
propelorm/Propel | generator/lib/builder/om/QueryBuilder.php | QueryBuilder.addUseRefFkQuery | protected function addUseRefFkQuery(&$script, $fk)
{
$table = $this->getTable();
$fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName());
$fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable);
$queryClass = $fkQueryBuilder->getClassname();
if ($namespac... | php | protected function addUseRefFkQuery(&$script, $fk)
{
$table = $this->getTable();
$fkTable = $this->getTable()->getDatabase()->getTable($fk->getTableName());
$fkQueryBuilder = $this->getNewStubQueryBuilder($fkTable);
$queryClass = $fkQueryBuilder->getClassname();
if ($namespac... | [
"protected",
"function",
"addUseRefFkQuery",
"(",
"&",
"$",
"script",
",",
"$",
"fk",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"fkTable",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getDatabase",
"(",
... | Adds the useFkQuery method for this object.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"useFkQuery",
"method",
"for",
"this",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryBuilder.php#L1227-L1239 |
propelorm/Propel | generator/lib/builder/om/QueryBuilder.php | QueryBuilder.addUseRelatedQuery | protected function addUseRelatedQuery(&$script, $fkTable, $queryClass, $relationName, $joinType)
{
$script .= "
/**
* Use the $relationName relation " . $fkTable->getPhpName() . " object
*
* @see useQuery()
*
* @param string \$relationAlias optional alias for the relat... | php | protected function addUseRelatedQuery(&$script, $fkTable, $queryClass, $relationName, $joinType)
{
$script .= "
/**
* Use the $relationName relation " . $fkTable->getPhpName() . " object
*
* @see useQuery()
*
* @param string \$relationAlias optional alias for the relat... | [
"protected",
"function",
"addUseRelatedQuery",
"(",
"&",
"$",
"script",
",",
"$",
"fkTable",
",",
"$",
"queryClass",
",",
"$",
"relationName",
",",
"$",
"joinType",
")",
"{",
"$",
"script",
".=",
"\"\n /**\n * Use the $relationName relation \"",
".",
"$",
... | Adds a useRelatedQuery method for this object.
@param string &$script The script will be modified in this method. | [
"Adds",
"a",
"useRelatedQuery",
"method",
"for",
"this",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryBuilder.php#L1246-L1267 |
propelorm/Propel | generator/lib/builder/om/QueryBuilder.php | QueryBuilder.addPrune | protected function addPrune(&$script)
{
$table = $this->getTable();
$class = $this->getStubObjectBuilder()->getClassname();
$objectName = '$' . $table->getStudlyPhpName();
$script .= "
/**
* Exclude object from result
*
* @param $class $objectName Object to remov... | php | protected function addPrune(&$script)
{
$table = $this->getTable();
$class = $this->getStubObjectBuilder()->getClassname();
$objectName = '$' . $table->getStudlyPhpName();
$script .= "
/**
* Exclude object from result
*
* @param $class $objectName Object to remov... | [
"protected",
"function",
"addPrune",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"getStubObjectBuilder",
"(",
")",
"->",
"getClassname",
"(",
")",
";",
"$",... | Adds the prune method for this object.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"prune",
"method",
"for",
"this",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryBuilder.php#L1305-L1348 |
propelorm/Propel | generator/lib/builder/util/PropelTemplate.php | PropelTemplate.render | public function render($vars = array())
{
if (null === $this->templateFile && null === $this->template) {
throw new InvalidArgumentException('You must set a template or a template file before rendering');
}
extract($vars);
ob_start();
ob_implicit_flush(0);
... | php | public function render($vars = array())
{
if (null === $this->templateFile && null === $this->template) {
throw new InvalidArgumentException('You must set a template or a template file before rendering');
}
extract($vars);
ob_start();
ob_implicit_flush(0);
... | [
"public",
"function",
"render",
"(",
"$",
"vars",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"templateFile",
"&&",
"null",
"===",
"$",
"this",
"->",
"template",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"... | Render the template using the variable provided as arguments.
<code>
$template = new PropelTemplate();
$template->setTemplate('This is <?php echo $name ?>');
echo $template->render(array('name' => 'Mike'));
// This is Mike
</code>
@param array $vars An associative array of arguments to be rendered
@return string The... | [
"Render",
"the",
"template",
"using",
"the",
"variable",
"provided",
"as",
"arguments",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/util/PropelTemplate.php#L68-L91 |
propelorm/Propel | generator/lib/behavior/i18n/I18nBehavior.php | I18nBehavior.moveI18nColumns | protected function moveI18nColumns()
{
$table = $this->getTable();
$i18nTable = $this->i18nTable;
foreach ($this->getI18nColumnNamesFromConfig() as $columnName) {
if (!$i18nTable->hasColumn($columnName)) {
if (!$table->hasColumn($columnName)) {
... | php | protected function moveI18nColumns()
{
$table = $this->getTable();
$i18nTable = $this->i18nTable;
foreach ($this->getI18nColumnNamesFromConfig() as $columnName) {
if (!$i18nTable->hasColumn($columnName)) {
if (!$table->hasColumn($columnName)) {
... | [
"protected",
"function",
"moveI18nColumns",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"i18nTable",
"=",
"$",
"this",
"->",
"i18nTable",
";",
"foreach",
"(",
"$",
"this",
"->",
"getI18nColumnNamesFromConfig",
"(",
... | Moves i18n columns from the main table to the i18n table | [
"Moves",
"i18n",
"columns",
"from",
"the",
"main",
"table",
"to",
"the",
"i18n",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/i18n/I18nBehavior.php#L141-L164 |
propelorm/Propel | generator/lib/builder/om/PHP5NestedSetPeerBuilder.php | PHP5NestedSetPeerBuilder.addClassBody | protected function addClassBody(&$script)
{
$table = $this->getTable();
// FIXME
// - Probably the build needs to be customized for supporting
// tables that are "aliases". -- definitely a fringe usecase, though.
$this->addConstants($script);
$this->addCreateRoot(... | php | protected function addClassBody(&$script)
{
$table = $this->getTable();
// FIXME
// - Probably the build needs to be customized for supporting
// tables that are "aliases". -- definitely a fringe usecase, though.
$this->addConstants($script);
$this->addCreateRoot(... | [
"protected",
"function",
"addClassBody",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"// FIXME",
"// - Probably the build needs to be customized for supporting",
"// tables that are \"aliases\". -- definitely a fringe... | Specifies the methods that are added as part of the basic OM class.
This can be overridden by subclasses that wish to add more methods.
@see ObjectBuilder::addClassBody() | [
"Specifies",
"the",
"methods",
"that",
"are",
"added",
"as",
"part",
"of",
"the",
"basic",
"OM",
"class",
".",
"This",
"can",
"be",
"overridden",
"by",
"subclasses",
"that",
"wish",
"to",
"add",
"more",
"methods",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php#L97-L170 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.isLob | public function isLob()
{
return ($this->type == PropelColumnTypes::BLOB || $this->type == PropelColumnTypes::VARBINARY || $this->type == PropelColumnTypes::LONGVARBINARY);
} | php | public function isLob()
{
return ($this->type == PropelColumnTypes::BLOB || $this->type == PropelColumnTypes::VARBINARY || $this->type == PropelColumnTypes::LONGVARBINARY);
} | [
"public",
"function",
"isLob",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"BLOB",
"||",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"VARBINARY",
"||",
"$",
"this",
"->",
"type",
"==",
"Propel... | Whether this is a BLOB, LONGVARBINARY, or VARBINARY.
@return boolean | [
"Whether",
"this",
"is",
"a",
"BLOB",
"LONGVARBINARY",
"or",
"VARBINARY",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L179-L182 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.isTemporal | public function isTemporal()
{
return ($this->type == PropelColumnTypes::TIMESTAMP || $this->type == PropelColumnTypes::DATE || $this->type == PropelColumnTypes::TIME || $this->type == PropelColumnTypes::BU_DATE || $this->type == PropelColumnTypes::BU_TIMESTAMP);
} | php | public function isTemporal()
{
return ($this->type == PropelColumnTypes::TIMESTAMP || $this->type == PropelColumnTypes::DATE || $this->type == PropelColumnTypes::TIME || $this->type == PropelColumnTypes::BU_DATE || $this->type == PropelColumnTypes::BU_TIMESTAMP);
} | [
"public",
"function",
"isTemporal",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"TIMESTAMP",
"||",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"DATE",
"||",
"$",
"this",
"->",
"type",
"==",
"P... | Whether this is a DATE/TIME/TIMESTAMP column.
@return boolean
@since 1.3 | [
"Whether",
"this",
"is",
"a",
"DATE",
"/",
"TIME",
"/",
"TIMESTAMP",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L190-L193 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.isEpochTemporal | public function isEpochTemporal()
{
return ($this->type == PropelColumnTypes::TIMESTAMP || $this->type == PropelColumnTypes::DATE || $this->type == PropelColumnTypes::TIME);
} | php | public function isEpochTemporal()
{
return ($this->type == PropelColumnTypes::TIMESTAMP || $this->type == PropelColumnTypes::DATE || $this->type == PropelColumnTypes::TIME);
} | [
"public",
"function",
"isEpochTemporal",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"TIMESTAMP",
"||",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"DATE",
"||",
"$",
"this",
"->",
"type",
"==",... | Whether this is a DATE/TIME/TIMESTAMP column that is post-epoch (1970).
PHP cannot handle pre-epoch timestamps well -- hence the need to differentiate
between epoch and pre-epoch timestamps.
@return boolean
@deprecated Propel supports non-epoch dates | [
"Whether",
"this",
"is",
"a",
"DATE",
"/",
"TIME",
"/",
"TIMESTAMP",
"column",
"that",
"is",
"post",
"-",
"epoch",
"(",
"1970",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L204-L207 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.isNumeric | public function isNumeric()
{
return ($this->type == PropelColumnTypes::NUMERIC || $this->type == PropelColumnTypes::DECIMAL || $this->type == PropelColumnTypes::TINYINT || $this->type == PropelColumnTypes::SMALLINT || $this->type == PropelColumnTypes::INTEGER || $this->type == PropelColumnTypes::BIGINT || ... | php | public function isNumeric()
{
return ($this->type == PropelColumnTypes::NUMERIC || $this->type == PropelColumnTypes::DECIMAL || $this->type == PropelColumnTypes::TINYINT || $this->type == PropelColumnTypes::SMALLINT || $this->type == PropelColumnTypes::INTEGER || $this->type == PropelColumnTypes::BIGINT || ... | [
"public",
"function",
"isNumeric",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"NUMERIC",
"||",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"DECIMAL",
"||",
"$",
"this",
"->",
"type",
"==",
"P... | Whether this column is numeric (int, decimal, bigint etc).
@return boolean | [
"Whether",
"this",
"column",
"is",
"numeric",
"(",
"int",
"decimal",
"bigint",
"etc",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L214-L217 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.isText | public function isText()
{
return ($this->type == PropelColumnTypes::VARCHAR || $this->type == PropelColumnTypes::LONGVARCHAR || $this->type == PropelColumnTypes::CHAR);
} | php | public function isText()
{
return ($this->type == PropelColumnTypes::VARCHAR || $this->type == PropelColumnTypes::LONGVARCHAR || $this->type == PropelColumnTypes::CHAR);
} | [
"public",
"function",
"isText",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"VARCHAR",
"||",
"$",
"this",
"->",
"type",
"==",
"PropelColumnTypes",
"::",
"LONGVARCHAR",
"||",
"$",
"this",
"->",
"type",
"==",
"... | Whether this column is a text column (varchar, char, longvarchar).
@return boolean | [
"Whether",
"this",
"column",
"is",
"a",
"text",
"column",
"(",
"varchar",
"char",
"longvarchar",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L234-L237 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.setForeignKey | public function setForeignKey($tableName, $columnName)
{
if ($tableName && $columnName) {
$this->relatedTableName = $tableName;
$this->relatedColumnName = $columnName;
} else {
$this->relatedTableName = "";
$this->relatedColumnName = "";
}
... | php | public function setForeignKey($tableName, $columnName)
{
if ($tableName && $columnName) {
$this->relatedTableName = $tableName;
$this->relatedColumnName = $columnName;
} else {
$this->relatedTableName = "";
$this->relatedColumnName = "";
}
... | [
"public",
"function",
"setForeignKey",
"(",
"$",
"tableName",
",",
"$",
"columnName",
")",
"{",
"if",
"(",
"$",
"tableName",
"&&",
"$",
"columnName",
")",
"{",
"$",
"this",
"->",
"relatedTableName",
"=",
"$",
"tableName",
";",
"$",
"this",
"->",
"related... | Set the foreign key for this column.
@param string tableName The name of the table that is foreign.
@param string columnName The name of the column that is foreign.
@return void | [
"Set",
"the",
"foreign",
"key",
"for",
"this",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L335-L344 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.getRelation | public function getRelation()
{
if (!$this->relatedTableName) {
return null;
}
foreach ($this->getTable()->getRelations() as $name => $relation) {
if ($relation->getType() == RelationMap::MANY_TO_ONE) {
if ($relation->getForeignTable()->getName() == $t... | php | public function getRelation()
{
if (!$this->relatedTableName) {
return null;
}
foreach ($this->getTable()->getRelations() as $name => $relation) {
if ($relation->getType() == RelationMap::MANY_TO_ONE) {
if ($relation->getForeignTable()->getName() == $t... | [
"public",
"function",
"getRelation",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"relatedTableName",
")",
"{",
"return",
"null",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getRelations",
"(",
")",
"as",
"$",
"name... | Get the RelationMap object for this foreign key
@return RelationMap|null | [
"Get",
"the",
"RelationMap",
"object",
"for",
"this",
"foreign",
"key"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L365-L377 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.getRelatedTable | public function getRelatedTable()
{
if ($this->relatedTableName) {
return $this->table->getDatabaseMap()->getTable($this->relatedTableName);
} else {
throw new PropelException("Cannot fetch RelatedTable for column with no foreign key: " . $this->columnName);
}
} | php | public function getRelatedTable()
{
if ($this->relatedTableName) {
return $this->table->getDatabaseMap()->getTable($this->relatedTableName);
} else {
throw new PropelException("Cannot fetch RelatedTable for column with no foreign key: " . $this->columnName);
}
} | [
"public",
"function",
"getRelatedTable",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"relatedTableName",
")",
"{",
"return",
"$",
"this",
"->",
"table",
"->",
"getDatabaseMap",
"(",
")",
"->",
"getTable",
"(",
"$",
"this",
"->",
"relatedTableName",
")",
... | Get the TableMap object that this column is related to.
@return TableMap The related TableMap object
@throws PropelException when called on a column with no foreign key | [
"Get",
"the",
"TableMap",
"object",
"that",
"this",
"column",
"is",
"related",
"to",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L415-L422 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.ignoreCase | public function ignoreCase($str, DBAdapter $db)
{
if ($this->isText()) {
return $db->ignoreCase($str);
} else {
return $str;
}
} | php | public function ignoreCase($str, DBAdapter $db)
{
if ($this->isText()) {
return $db->ignoreCase($str);
} else {
return $str;
}
} | [
"public",
"function",
"ignoreCase",
"(",
"$",
"str",
",",
"DBAdapter",
"$",
"db",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isText",
"(",
")",
")",
"{",
"return",
"$",
"db",
"->",
"ignoreCase",
"(",
"$",
"str",
")",
";",
"}",
"else",
"{",
"return"... | Performs DB-specific ignore case, but only if the column type necessitates it.
@param string $str The expression we want to apply the ignore case formatting to (e.g. the column name).
@param DBAdapter $db
@return string | [
"Performs",
"DB",
"-",
"specific",
"ignore",
"case",
"but",
"only",
"if",
"the",
"column",
"type",
"necessitates",
"it",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L488-L495 |
propelorm/Propel | runtime/lib/map/ColumnMap.php | ColumnMap.normalizeName | public static function normalizeName($name)
{
if (false !== ($pos = strrpos($name, '.'))) {
$name = substr($name, $pos + 1);
}
return $name;
} | php | public static function normalizeName($name)
{
if (false !== ($pos = strrpos($name, '.'))) {
$name = substr($name, $pos + 1);
}
return $name;
} | [
"public",
"static",
"function",
"normalizeName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"false",
"!==",
"(",
"$",
"pos",
"=",
"strrpos",
"(",
"$",
"name",
",",
"'.'",
")",
")",
")",
"{",
"$",
"name",
"=",
"substr",
"(",
"$",
"name",
",",
"$",
"... | Normalizes the column name, removing table prefix and uppercasing.
article.first_name becomes first_name
@param string $name
@return string Normalized column name. | [
"Normalizes",
"the",
"column",
"name",
"removing",
"table",
"prefix",
"and",
"uppercasing",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/ColumnMap.php#L506-L513 |
propelorm/Propel | generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php | PHP5MultiExtendObjectBuilder.getParentClasspath | protected function getParentClasspath()
{
if ($this->getChild()->getAncestor()) {
return $this->getChild()->getAncestor();
} else {
return $this->getObjectBuilder()->getClasspath();
}
} | php | protected function getParentClasspath()
{
if ($this->getChild()->getAncestor()) {
return $this->getChild()->getAncestor();
} else {
return $this->getObjectBuilder()->getClasspath();
}
} | [
"protected",
"function",
"getParentClasspath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getChild",
"(",
")",
"->",
"getAncestor",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getChild",
"(",
")",
"->",
"getAncestor",
"(",
")",
";",
"}",
"el... | Returns classpath to parent class.
@return string | [
"Returns",
"classpath",
"to",
"parent",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php#L80-L87 |
propelorm/Propel | generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php | PHP5MultiExtendObjectBuilder.addClassOpen | protected function addClassOpen(&$script)
{
if ($this->getChild()->getAncestor()) {
$ancestorClassName = $this->getChild()->getAncestor();
if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
$this->declareClassFromBuilder($this->getNewStubObjectBuilder(... | php | protected function addClassOpen(&$script)
{
if ($this->getChild()->getAncestor()) {
$ancestorClassName = $this->getChild()->getAncestor();
if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
$this->declareClassFromBuilder($this->getNewStubObjectBuilder(... | [
"protected",
"function",
"addClassOpen",
"(",
"&",
"$",
"script",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getChild",
"(",
")",
"->",
"getAncestor",
"(",
")",
")",
"{",
"$",
"ancestorClassName",
"=",
"$",
"this",
"->",
"getChild",
"(",
")",
"->",
"ge... | Adds class phpdoc comment and opening of class.
@param string &$script The script will be modified in this method. | [
"Adds",
"class",
"phpdoc",
"comment",
"and",
"opening",
"of",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php#L123-L165 |
propelorm/Propel | generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php | PHP5MultiExtendObjectBuilder.addClassBody | protected function addClassBody(&$script)
{
$this->declareClassFromBuilder($this->getStubPeerBuilder());
$child = $this->getChild();
$col = $child->getColumn();
$cfc = $col->getPhpName();
$const = "CLASSKEY_" . strtoupper($child->getKey());
$script .= "
/**
... | php | protected function addClassBody(&$script)
{
$this->declareClassFromBuilder($this->getStubPeerBuilder());
$child = $this->getChild();
$col = $child->getColumn();
$cfc = $col->getPhpName();
$const = "CLASSKEY_" . strtoupper($child->getKey());
$script .= "
/**
... | [
"protected",
"function",
"addClassBody",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"declareClassFromBuilder",
"(",
"$",
"this",
"->",
"getStubPeerBuilder",
"(",
")",
")",
";",
"$",
"child",
"=",
"$",
"this",
"->",
"getChild",
"(",
")",
";",
... | Specifies the methods that are added as part of the stub object class.
By default there are no methods for the empty stub classes; override this method
if you want to change that behavior.
@see ObjectBuilder::addClassBody() | [
"Specifies",
"the",
"methods",
"that",
"are",
"added",
"as",
"part",
"of",
"the",
"stub",
"object",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php#L175-L195 |
propelorm/Propel | runtime/lib/formatter/PropelObjectFormatter.php | PropelObjectFormatter.getAllObjectsFromRow | public function getAllObjectsFromRow($row)
{
// get the main object
list($obj, $col) = call_user_func(array($this->peer, 'populateObject'), $row);
if (null !== $this->mainObject) {
$obj = $this->mainObject;
}
// related objects added using with()
foreach... | php | public function getAllObjectsFromRow($row)
{
// get the main object
list($obj, $col) = call_user_func(array($this->peer, 'populateObject'), $row);
if (null !== $this->mainObject) {
$obj = $this->mainObject;
}
// related objects added using with()
foreach... | [
"public",
"function",
"getAllObjectsFromRow",
"(",
"$",
"row",
")",
"{",
"// get the main object",
"list",
"(",
"$",
"obj",
",",
"$",
"col",
")",
"=",
"call_user_func",
"(",
"array",
"(",
"$",
"this",
"->",
"peer",
",",
"'populateObject'",
")",
",",
"$",
... | Hydrates a series of objects from a result row
The first object to hydrate is the model of the Criteria
The following objects (the ones added by way of ModelCriteria::with()) are linked to the first one
@param array $row associative array indexed by column number,
as returned by PDOStatement::fetch(PDO::FETCH_NUM)
@r... | [
"Hydrates",
"a",
"series",
"of",
"objects",
"from",
"a",
"result",
"row",
"The",
"first",
"object",
"to",
"hydrate",
"is",
"the",
"model",
"of",
"the",
"Criteria",
"The",
"following",
"objects",
"(",
"the",
"ones",
"added",
"by",
"way",
"of",
"ModelCriteri... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/formatter/PropelObjectFormatter.php#L100-L152 |
propelorm/Propel | runtime/lib/parser/yaml/sfYamlDumper.php | sfYamlDumper.dump | public function dump($input, $inline = 0, $indent = 0)
{
$output = '';
$prefix = $indent ? str_repeat(' ', $indent) : '';
if ($inline <= 0 || !is_array($input) || empty($input)) {
$output .= $prefix.sfYamlInline::dump($input);
} else {
$isAHash = array_keys($input) !== range(0, count($inp... | php | public function dump($input, $inline = 0, $indent = 0)
{
$output = '';
$prefix = $indent ? str_repeat(' ', $indent) : '';
if ($inline <= 0 || !is_array($input) || empty($input)) {
$output .= $prefix.sfYamlInline::dump($input);
} else {
$isAHash = array_keys($input) !== range(0, count($inp... | [
"public",
"function",
"dump",
"(",
"$",
"input",
",",
"$",
"inline",
"=",
"0",
",",
"$",
"indent",
"=",
"0",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"prefix",
"=",
"$",
"indent",
"?",
"str_repeat",
"(",
"' '",
",",
"$",
"indent",
")",
":"... | Dumps a PHP value to YAML.
@param mixed $input The PHP value
@param integer $inline The level where you switch to inline YAML
@param integer $indent The level o indentation indentation (used internally)
@return string The YAML representation of the PHP value | [
"Dumps",
"a",
"PHP",
"value",
"to",
"YAML",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/parser/yaml/sfYamlDumper.php#L32-L55 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.addSelectMethods | protected function addSelectMethods(&$script)
{
$this->addAddSelectColumns($script);
$this->addDoCount($script);
// consider refactoring the doSelect stuff
// into a top-level method
$this->addDoSelectOne($script);
$this->addDoSelect($script);
$this->addDoSe... | php | protected function addSelectMethods(&$script)
{
$this->addAddSelectColumns($script);
$this->addDoCount($script);
// consider refactoring the doSelect stuff
// into a top-level method
$this->addDoSelectOne($script);
$this->addDoSelect($script);
$this->addDoSe... | [
"protected",
"function",
"addSelectMethods",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"addAddSelectColumns",
"(",
"$",
"script",
")",
";",
"$",
"this",
"->",
"addDoCount",
"(",
"$",
"script",
")",
";",
"// consider refactoring the doSelect stuff",
... | Adds the addSelectColumns(), doCount(), etc. methods.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"addSelectColumns",
"()",
"doCount",
"()",
"etc",
".",
"methods",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L48-L70 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.addUpdateMethods | protected function addUpdateMethods(&$script)
{
$this->addDoInsert($script);
$this->addDoUpdate($script);
$this->addDoDeleteAll($script);
$this->addDoDelete($script);
if ($this->isDeleteCascadeEmulationNeeded()) {
$this->addDoOnDeleteCascade($script);
}
... | php | protected function addUpdateMethods(&$script)
{
$this->addDoInsert($script);
$this->addDoUpdate($script);
$this->addDoDeleteAll($script);
$this->addDoDelete($script);
if ($this->isDeleteCascadeEmulationNeeded()) {
$this->addDoOnDeleteCascade($script);
}
... | [
"protected",
"function",
"addUpdateMethods",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"addDoInsert",
"(",
"$",
"script",
")",
";",
"$",
"this",
"->",
"addDoUpdate",
"(",
"$",
"script",
")",
";",
"$",
"this",
"->",
"addDoDeleteAll",
"(",
"$... | Adds the doInsert(), doUpdate(), doDeleteAll(), doValidate(), etc. methods.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"doInsert",
"()",
"doUpdate",
"()",
"doDeleteAll",
"()",
"doValidate",
"()",
"etc",
".",
"methods",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L96-L109 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.addRetrieveByPKMethods | protected function addRetrieveByPKMethods(&$script)
{
if (count($this->getTable()->getPrimaryKey()) === 1) {
$this->addRetrieveByPK_SinglePK($script);
$this->addRetrieveByPKs_SinglePK($script);
} else {
$this->addRetrieveByPK_MultiPK($script);
}
} | php | protected function addRetrieveByPKMethods(&$script)
{
if (count($this->getTable()->getPrimaryKey()) === 1) {
$this->addRetrieveByPK_SinglePK($script);
$this->addRetrieveByPKs_SinglePK($script);
} else {
$this->addRetrieveByPK_MultiPK($script);
}
} | [
"protected",
"function",
"addRetrieveByPKMethods",
"(",
"&",
"$",
"script",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
")",
"===",
"1",
")",
"{",
"$",
"this",
"->",
"addRetrieveByPK_Single... | Adds the retrieveByPK() (and possibly retrieveByPKs()) method(s) appropriate for this class.
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"retrieveByPK",
"()",
"(",
"and",
"possibly",
"retrieveByPKs",
"()",
")",
"method",
"(",
"s",
")",
"appropriate",
"for",
"this",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L116-L124 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.addClassBody | protected function addClassBody(&$script)
{
$table = $this->getTable();
if (!$table->isAlias()) {
$this->addConstantsAndAttributes($script);
}
$this->addTranslateFieldName($script);
$this->addGetFieldNames($script);
if ($table->hasEnumColumns()) {
... | php | protected function addClassBody(&$script)
{
$table = $this->getTable();
if (!$table->isAlias()) {
$this->addConstantsAndAttributes($script);
}
$this->addTranslateFieldName($script);
$this->addGetFieldNames($script);
if ($table->hasEnumColumns()) {
... | [
"protected",
"function",
"addClassBody",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"if",
"(",
"!",
"$",
"table",
"->",
"isAlias",
"(",
")",
")",
"{",
"$",
"this",
"->",
"addConstantsAndAttribu... | This method adds the contents of the generated class to the script.
This method contains the high-level logic that determines which methods
get generated.
Hint: Override this method in your subclass if you want to reorganize or
drastically change the contents of the generated peer class.
@param string &$script The s... | [
"This",
"method",
"adds",
"the",
"contents",
"of",
"the",
"generated",
"class",
"to",
"the",
"script",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L137-L173 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.getRetrieveMethodName | public function getRetrieveMethodName()
{
if ($this->getTable()->isAlias()) {
$retrieveMethod = "retrieve" . $this->getTable()->getPhpName() . "ByPK";
} else {
$retrieveMethod = "retrieveByPK";
}
return $retrieveMethod;
} | php | public function getRetrieveMethodName()
{
if ($this->getTable()->isAlias()) {
$retrieveMethod = "retrieve" . $this->getTable()->getPhpName() . "ByPK";
} else {
$retrieveMethod = "retrieveByPK";
}
return $retrieveMethod;
} | [
"public",
"function",
"getRetrieveMethodName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"isAlias",
"(",
")",
")",
"{",
"$",
"retrieveMethod",
"=",
"\"retrieve\"",
".",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getP... | Returns the retrieveByPK method name to use for this table.
If the table is an alias then the method name looks like "retrieveTablenameByPK"
otherwise simply "retrieveByPK".
@return string | [
"Returns",
"the",
"retrieveByPK",
"method",
"name",
"to",
"use",
"for",
"this",
"table",
".",
"If",
"the",
"table",
"is",
"an",
"alias",
"then",
"the",
"method",
"name",
"looks",
"like",
"retrieveTablenameByPK",
"otherwise",
"simply",
"retrieveByPK",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L248-L257 |
propelorm/Propel | generator/lib/builder/om/PeerBuilder.php | PeerBuilder.getColumnName | public static function getColumnName(Column $col, $phpName = null)
{
// was it overridden in schema.xml ?
if ($col->getPeerName()) {
$const = strtoupper($col->getPeerName());
} else {
$const = strtoupper($col->getName());
}
if ($phpName !== null) {
... | php | public static function getColumnName(Column $col, $phpName = null)
{
// was it overridden in schema.xml ?
if ($col->getPeerName()) {
$const = strtoupper($col->getPeerName());
} else {
$const = strtoupper($col->getName());
}
if ($phpName !== null) {
... | [
"public",
"static",
"function",
"getColumnName",
"(",
"Column",
"$",
"col",
",",
"$",
"phpName",
"=",
"null",
")",
"{",
"// was it overridden in schema.xml ?",
"if",
"(",
"$",
"col",
"->",
"getPeerName",
"(",
")",
")",
"{",
"$",
"const",
"=",
"strtoupper",
... | COMPATIBILITY: Get the column constant name (e.g. PeerName::COLUMN_NAME).
This method exists simply because it belonged to the 'PeerBuilder' that this
class is replacing (because of name conflict more than actual functionality overlap).
When the new builder model is finished this method will be removed.
@param Column... | [
"COMPATIBILITY",
":",
"Get",
"the",
"column",
"constant",
"name",
"(",
"e",
".",
"g",
".",
"PeerName",
"::",
"COLUMN_NAME",
")",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/PeerBuilder.php#L272-L285 |
propelorm/Propel | generator/lib/builder/om/ObjectBuilder.php | ObjectBuilder.addColumnAccessorMethods | protected function addColumnAccessorMethods(&$script)
{
$table = $this->getTable();
foreach ($table->getColumns() as $col) {
// if they're not using the DateTime class than we will generate "compatibility" accessor method
if ($col->getType() === PropelTypes::DATE || $col->g... | php | protected function addColumnAccessorMethods(&$script)
{
$table = $this->getTable();
foreach ($table->getColumns() as $col) {
// if they're not using the DateTime class than we will generate "compatibility" accessor method
if ($col->getType() === PropelTypes::DATE || $col->g... | [
"protected",
"function",
"addColumnAccessorMethods",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"foreach",
"(",
"$",
"table",
"->",
"getColumns",
"(",
")",
"as",
"$",
"col",
")",
"{",
"// if they... | Adds the getter methods for the column values.
This is here because it is probably generic enough to apply to templates being generated
in different languages (e.g. PHP4 and PHP5).
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"getter",
"methods",
"for",
"the",
"column",
"values",
".",
"This",
"is",
"here",
"because",
"it",
"is",
"probably",
"generic",
"enough",
"to",
"apply",
"to",
"templates",
"being",
"generated",
"in",
"different",
"languages",
"(",
"e",
".",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/ObjectBuilder.php#L54-L80 |
propelorm/Propel | generator/lib/builder/om/ObjectBuilder.php | ObjectBuilder.addColumnMutatorMethods | protected function addColumnMutatorMethods(&$script)
{
foreach ($this->getTable()->getColumns() as $col) {
if ($col->isLobType()) {
$this->addLobMutator($script, $col);
} elseif ($col->getType() === PropelTypes::DATE || $col->getType() === PropelTypes::TIME || $col->g... | php | protected function addColumnMutatorMethods(&$script)
{
foreach ($this->getTable()->getColumns() as $col) {
if ($col->isLobType()) {
$this->addLobMutator($script, $col);
} elseif ($col->getType() === PropelTypes::DATE || $col->getType() === PropelTypes::TIME || $col->g... | [
"protected",
"function",
"addColumnMutatorMethods",
"(",
"&",
"$",
"script",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getColumns",
"(",
")",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"->",
"isLobType",
"(",
"... | Adds the mutator (setter) methods for setting column values.
This is here because it is probably generic enough to apply to templates being generated
in different langauges (e.g. PHP4 and PHP5).
@param string &$script The script will be modified in this method. | [
"Adds",
"the",
"mutator",
"(",
"setter",
")",
"methods",
"for",
"setting",
"column",
"values",
".",
"This",
"is",
"here",
"because",
"it",
"is",
"probably",
"generic",
"enough",
"to",
"apply",
"to",
"templates",
"being",
"generated",
"in",
"different",
"lang... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/ObjectBuilder.php#L89-L112 |
propelorm/Propel | generator/lib/model/Index.php | Index.getName | public function getName()
{
if ($this->indexName === null) {
try {
// generate an index name if we don't have a supplied one
$this->createName();
} catch (EngineException $e) {
// still no name
}
}
if ($datab... | php | public function getName()
{
if ($this->indexName === null) {
try {
// generate an index name if we don't have a supplied one
$this->createName();
} catch (EngineException $e) {
// still no name
}
}
if ($datab... | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"indexName",
"===",
"null",
")",
"{",
"try",
"{",
"// generate an index name if we don't have a supplied one",
"$",
"this",
"->",
"createName",
"(",
")",
";",
"}",
"catch",
"(",
"E... | Gets the name of this index. | [
"Gets",
"the",
"name",
"of",
"this",
"index",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Index.php#L111-L126 |
propelorm/Propel | generator/lib/model/Index.php | Index.addColumn | public function addColumn($data)
{
if ($data instanceof Column) {
$column = $data;
$this->indexColumns[] = $column->getName();
if ($column->getSize()) {
$this->indexColumnSizes[$column->getName()] = $column->getSize();
}
} else {
... | php | public function addColumn($data)
{
if ($data instanceof Column) {
$column = $data;
$this->indexColumns[] = $column->getName();
if ($column->getSize()) {
$this->indexColumnSizes[$column->getName()] = $column->getSize();
}
} else {
... | [
"public",
"function",
"addColumn",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Column",
")",
"{",
"$",
"column",
"=",
"$",
"data",
";",
"$",
"this",
"->",
"indexColumns",
"[",
"]",
"=",
"$",
"column",
"->",
"getName",
"(",
")... | Adds a new column to an index.
@param mixed $data Column or attributes from XML. | [
"Adds",
"a",
"new",
"column",
"to",
"an",
"index",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Index.php#L174-L190 |
propelorm/Propel | generator/lib/model/Index.php | Index.setColumns | public function setColumns(array $indexColumns)
{
$this->indexColumns = array();
$this->indexColumnSizes = array();
foreach ($indexColumns as $col) {
$this->addColumn($col);
}
} | php | public function setColumns(array $indexColumns)
{
$this->indexColumns = array();
$this->indexColumnSizes = array();
foreach ($indexColumns as $col) {
$this->addColumn($col);
}
} | [
"public",
"function",
"setColumns",
"(",
"array",
"$",
"indexColumns",
")",
"{",
"$",
"this",
"->",
"indexColumns",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"indexColumnSizes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"indexColumns",
"as"... | Sets array of columns to use for index.
@param array $indexColumns Column[] | [
"Sets",
"array",
"of",
"columns",
"to",
"use",
"for",
"index",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Index.php#L197-L204 |
propelorm/Propel | generator/lib/model/Index.php | Index.getColumnSize | public function getColumnSize($name)
{
if (isset($this->indexColumnSizes[$name])) {
return $this->indexColumnSizes[$name];
}
return null; // just to be explicit
} | php | public function getColumnSize($name)
{
if (isset($this->indexColumnSizes[$name])) {
return $this->indexColumnSizes[$name];
}
return null; // just to be explicit
} | [
"public",
"function",
"getColumnSize",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"indexColumnSizes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"indexColumnSizes",
"[",
"$",
"name",
"]",
";",
"}",... | Returns the size for the specified column, if given.
@param string $name
@return numeric The size or NULL | [
"Returns",
"the",
"size",
"for",
"the",
"specified",
"column",
"if",
"given",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Index.php#L225-L232 |
propelorm/Propel | generator/lib/model/Index.php | Index.hasColumnAtPosition | public function hasColumnAtPosition($pos, $name, $size = null, $caseInsensitive = false)
{
if (!isset($this->indexColumns[$pos])) {
return false;
}
$test = $caseInsensitive ?
strtolower($this->indexColumns[$pos]) != strtolower($name) :
$this->indexColumns[... | php | public function hasColumnAtPosition($pos, $name, $size = null, $caseInsensitive = false)
{
if (!isset($this->indexColumns[$pos])) {
return false;
}
$test = $caseInsensitive ?
strtolower($this->indexColumns[$pos]) != strtolower($name) :
$this->indexColumns[... | [
"public",
"function",
"hasColumnAtPosition",
"(",
"$",
"pos",
",",
"$",
"name",
",",
"$",
"size",
"=",
"null",
",",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"indexColumns",
"[",
"$",
"pos",
"]",... | Check whether this index has a given column at a given position
@param integer $pos Position in the column list
@param string $name Column name
@param integer $size optional size check
@param boolean $caseInsensitive Whether the comparison is case insensitive.
False by default.
@ret... | [
"Check",
"whether",
"this",
"index",
"has",
"a",
"given",
"column",
"at",
"a",
"given",
"position"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Index.php#L281-L297 |
propelorm/Propel | runtime/lib/validator/MaxLengthValidator.php | MaxLengthValidator.isValid | public function isValid(ValidatorMap $map, $str)
{
$len = function_exists('mb_strlen') ? mb_strlen($str) : strlen($str);
return $len <= intval($map->getValue());
} | php | public function isValid(ValidatorMap $map, $str)
{
$len = function_exists('mb_strlen') ? mb_strlen($str) : strlen($str);
return $len <= intval($map->getValue());
} | [
"public",
"function",
"isValid",
"(",
"ValidatorMap",
"$",
"map",
",",
"$",
"str",
")",
"{",
"$",
"len",
"=",
"function_exists",
"(",
"'mb_strlen'",
")",
"?",
"mb_strlen",
"(",
"$",
"str",
")",
":",
"strlen",
"(",
"$",
"str",
")",
";",
"return",
"$",... | @param ValidatorMap $map
@param string $str
@return boolean | [
"@param",
"ValidatorMap",
"$map",
"@param",
"string",
"$str"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/validator/MaxLengthValidator.php#L40-L45 |
propelorm/Propel | generator/lib/model/Column.php | Column.makeList | public static function makeList($columns, PropelPlatformInterface $platform)
{
$list = array();
foreach ($columns as $col) {
if ($col instanceof Column) {
$col = $col->getName();
}
$list[] = $platform->quoteIdentifier($col);
}
retu... | php | public static function makeList($columns, PropelPlatformInterface $platform)
{
$list = array();
foreach ($columns as $col) {
if ($col instanceof Column) {
$col = $col->getName();
}
$list[] = $platform->quoteIdentifier($col);
}
retu... | [
"public",
"static",
"function",
"makeList",
"(",
"$",
"columns",
",",
"PropelPlatformInterface",
"$",
"platform",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"col",
")",
"{",
"if",
"(",
"$",
"col",
"... | Return a comma delimited string listing the specified columns.
@param Column[]|string[] $columns Either a list of <code>Column</code> objects, or a list of <code>string</code> with column names.
@deprecated Use the Platform::getColumnListDDL() method instead
@return string | [
"Return",
"a",
"comma",
"delimited",
"string",
"listing",
"the",
"specified",
"columns",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L125-L136 |
propelorm/Propel | generator/lib/model/Column.php | Column.setupObject | protected function setupObject()
{
try {
$dom = $this->getAttribute("domain");
if ($dom) {
$this->getDomain()->copy($this->getTable()->getDatabase()->getDomain($dom));
} else {
$type = strtoupper($this->getAttribute("type"));
... | php | protected function setupObject()
{
try {
$dom = $this->getAttribute("domain");
if ($dom) {
$this->getDomain()->copy($this->getTable()->getDatabase()->getDomain($dom));
} else {
$type = strtoupper($this->getAttribute("type"));
... | [
"protected",
"function",
"setupObject",
"(",
")",
"{",
"try",
"{",
"$",
"dom",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"\"domain\"",
")",
";",
"if",
"(",
"$",
"dom",
")",
"{",
"$",
"this",
"->",
"getDomain",
"(",
")",
"->",
"copy",
"(",
"$",
... | Sets up the Column object based on the attributes that were passed to loadFromXML().
@see parent::loadFromXML() | [
"Sets",
"up",
"the",
"Column",
"object",
"based",
"on",
"the",
"attributes",
"that",
"were",
"passed",
"to",
"loadFromXML",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L143-L271 |
propelorm/Propel | generator/lib/model/Column.php | Column.getStudlyPhpName | public function getStudlyPhpName()
{
$phpname = $this->getPhpName();
if (strlen($phpname) > 1) {
return strtolower(substr($phpname, 0, 1)) . substr($phpname, 1);
} else { // 0 or 1 chars (I suppose that's rare)
return strtolower($phpname);
}
} | php | public function getStudlyPhpName()
{
$phpname = $this->getPhpName();
if (strlen($phpname) > 1) {
return strtolower(substr($phpname, 0, 1)) . substr($phpname, 1);
} else { // 0 or 1 chars (I suppose that's rare)
return strtolower($phpname);
}
} | [
"public",
"function",
"getStudlyPhpName",
"(",
")",
"{",
"$",
"phpname",
"=",
"$",
"this",
"->",
"getPhpName",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"phpname",
")",
">",
"1",
")",
"{",
"return",
"strtolower",
"(",
"substr",
"(",
"$",
"phpname... | Get studly version of PHP name.
The studly name is the PHP name with the first character lowercase.
@return string | [
"Get",
"studly",
"version",
"of",
"PHP",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L395-L404 |
propelorm/Propel | generator/lib/model/Column.php | Column.setAccessorVisibility | public function setAccessorVisibility($newVisibility)
{
if (in_array($newVisibility, self::$valid_visibilities)) {
$this->accessorVisibility = $newVisibility;
} else {
$this->accessorVisibility = self::DEFAULT_VISIBILITY;
}
} | php | public function setAccessorVisibility($newVisibility)
{
if (in_array($newVisibility, self::$valid_visibilities)) {
$this->accessorVisibility = $newVisibility;
} else {
$this->accessorVisibility = self::DEFAULT_VISIBILITY;
}
} | [
"public",
"function",
"setAccessorVisibility",
"(",
"$",
"newVisibility",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"newVisibility",
",",
"self",
"::",
"$",
"valid_visibilities",
")",
")",
"{",
"$",
"this",
"->",
"accessorVisibility",
"=",
"$",
"newVisibility... | Set the visibility of the accessor methods for this column / attribute
@param $newVisibility string | [
"Set",
"the",
"visibility",
"of",
"the",
"accessor",
"methods",
"for",
"this",
"column",
"/",
"attribute"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L425-L432 |
propelorm/Propel | generator/lib/model/Column.php | Column.setMutatorVisibility | public function setMutatorVisibility($newVisibility)
{
if (in_array($newVisibility, self::$valid_visibilities)) {
$this->mutatorVisibility = $newVisibility;
} else {
$this->mutatorVisibility = self::DEFAULT_VISIBILITY;
}
} | php | public function setMutatorVisibility($newVisibility)
{
if (in_array($newVisibility, self::$valid_visibilities)) {
$this->mutatorVisibility = $newVisibility;
} else {
$this->mutatorVisibility = self::DEFAULT_VISIBILITY;
}
} | [
"public",
"function",
"setMutatorVisibility",
"(",
"$",
"newVisibility",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"newVisibility",
",",
"self",
"::",
"$",
"valid_visibilities",
")",
")",
"{",
"$",
"this",
"->",
"mutatorVisibility",
"=",
"$",
"newVisibility",... | Set the visibility of the mutator methods for this column / attribute
@param $newVisibility string | [
"Set",
"the",
"visibility",
"of",
"the",
"mutator",
"methods",
"for",
"this",
"column",
"/",
"attribute"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L453-L460 |
propelorm/Propel | generator/lib/model/Column.php | Column.addInheritance | public function addInheritance($inhdata)
{
if ($inhdata instanceof Inheritance) {
$inh = $inhdata;
$inh->setColumn($this);
if ($this->inheritanceList === null) {
$this->inheritanceList = array();
$this->isEnumeratedClasses = true;
... | php | public function addInheritance($inhdata)
{
if ($inhdata instanceof Inheritance) {
$inh = $inhdata;
$inh->setColumn($this);
if ($this->inheritanceList === null) {
$this->inheritanceList = array();
$this->isEnumeratedClasses = true;
... | [
"public",
"function",
"addInheritance",
"(",
"$",
"inhdata",
")",
"{",
"if",
"(",
"$",
"inhdata",
"instanceof",
"Inheritance",
")",
"{",
"$",
"inh",
"=",
"$",
"inhdata",
";",
"$",
"inh",
"->",
"setColumn",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
... | Adds a new inheritance definition to the inheritance list and set the
parent column of the inheritance to the current column
@param Inheritance|string $inhdata Inheritance or XML data.
@return Inheritance | [
"Adds",
"a",
"new",
"inheritance",
"definition",
"to",
"the",
"inheritance",
"list",
"and",
"set",
"the",
"parent",
"column",
"of",
"the",
"inheritance",
"to",
"the",
"current",
"column"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L574-L592 |
propelorm/Propel | generator/lib/model/Column.php | Column.addReferrer | public function addReferrer(ForeignKey $fk)
{
if ($this->referrers === null) {
$this->referrers = array();
}
$this->referrers[] = $fk;
} | php | public function addReferrer(ForeignKey $fk)
{
if ($this->referrers === null) {
$this->referrers = array();
}
$this->referrers[] = $fk;
} | [
"public",
"function",
"addReferrer",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"referrers",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"referrers",
"=",
"array",
"(",
")",
";",
"}",
"$",
"this",
"->",
"referrers",
"[",
... | Adds the foreign key from another table that refers to this column. | [
"Adds",
"the",
"foreign",
"key",
"from",
"another",
"table",
"that",
"refers",
"to",
"this",
"column",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L828-L834 |
propelorm/Propel | generator/lib/model/Column.php | Column.setType | public function setType($propelType)
{
$this->getDomain()->setType($propelType);
if ($propelType == PropelTypes::VARBINARY || $propelType == PropelTypes::LONGVARBINARY || $propelType == PropelTypes::BLOB) {
$this->needsTransactionInPostgres = true;
}
} | php | public function setType($propelType)
{
$this->getDomain()->setType($propelType);
if ($propelType == PropelTypes::VARBINARY || $propelType == PropelTypes::LONGVARBINARY || $propelType == PropelTypes::BLOB) {
$this->needsTransactionInPostgres = true;
}
} | [
"public",
"function",
"setType",
"(",
"$",
"propelType",
")",
"{",
"$",
"this",
"->",
"getDomain",
"(",
")",
"->",
"setType",
"(",
"$",
"propelType",
")",
";",
"if",
"(",
"$",
"propelType",
"==",
"PropelTypes",
"::",
"VARBINARY",
"||",
"$",
"propelType",... | Sets the propel colunm type.
@param string $propelType
@see Domain::setType() | [
"Sets",
"the",
"propel",
"colunm",
"type",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L888-L894 |
propelorm/Propel | generator/lib/model/Column.php | Column.setDefaultValue | public function setDefaultValue($def)
{
if (!$def instanceof ColumnDefaultValue) {
$def = new ColumnDefaultValue($def, ColumnDefaultValue::TYPE_VALUE);
}
$this->domain->setDefaultValue($def);
return $this;
} | php | public function setDefaultValue($def)
{
if (!$def instanceof ColumnDefaultValue) {
$def = new ColumnDefaultValue($def, ColumnDefaultValue::TYPE_VALUE);
}
$this->domain->setDefaultValue($def);
return $this;
} | [
"public",
"function",
"setDefaultValue",
"(",
"$",
"def",
")",
"{",
"if",
"(",
"!",
"$",
"def",
"instanceof",
"ColumnDefaultValue",
")",
"{",
"$",
"def",
"=",
"new",
"ColumnDefaultValue",
"(",
"$",
"def",
",",
"ColumnDefaultValue",
"::",
"TYPE_VALUE",
")",
... | Set a string that will give this column a default value.
@param ColumnDefaultValue|int|float|bool|string column default value
@return Column | [
"Set",
"a",
"string",
"that",
"will",
"give",
"this",
"column",
"a",
"default",
"value",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L1194-L1202 |
propelorm/Propel | generator/lib/model/Column.php | Column.getAutoIncrementString | public function getAutoIncrementString()
{
if ($this->isAutoIncrement() && IDMethod::NATIVE === $this->getTable()->getIdMethod()) {
return $this->getPlatform()->getAutoIncrement();
} elseif ($this->isAutoIncrement()) {
throw new EngineException(sprintf(
'You h... | php | public function getAutoIncrementString()
{
if ($this->isAutoIncrement() && IDMethod::NATIVE === $this->getTable()->getIdMethod()) {
return $this->getPlatform()->getAutoIncrement();
} elseif ($this->isAutoIncrement()) {
throw new EngineException(sprintf(
'You h... | [
"public",
"function",
"getAutoIncrementString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAutoIncrement",
"(",
")",
"&&",
"IDMethod",
"::",
"NATIVE",
"===",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getIdMethod",
"(",
")",
")",
"{",
"return",... | Gets the auto-increment string.
@return string
@throws EngineException | [
"Gets",
"the",
"auto",
"-",
"increment",
"string",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L1250-L1263 |
propelorm/Propel | generator/lib/model/Column.php | Column.setTypeFromString | public function setTypeFromString($typeName, $size)
{
$tn = strtoupper($typeName);
$this->setType($tn);
if ($size !== null) {
$this->size = $size;
}
if (strpos($tn, "CHAR") !== false) {
$this->domain->setType(PropelTypes::VARCHAR);
} elseif (... | php | public function setTypeFromString($typeName, $size)
{
$tn = strtoupper($typeName);
$this->setType($tn);
if ($size !== null) {
$this->size = $size;
}
if (strpos($tn, "CHAR") !== false) {
$this->domain->setType(PropelTypes::VARCHAR);
} elseif (... | [
"public",
"function",
"setTypeFromString",
"(",
"$",
"typeName",
",",
"$",
"size",
")",
"{",
"$",
"tn",
"=",
"strtoupper",
"(",
"$",
"typeName",
")",
";",
"$",
"this",
"->",
"setType",
"(",
"$",
"tn",
")",
";",
"if",
"(",
"$",
"size",
"!==",
"null"... | Set the column type from a string property
(normally a string from an sql input file)
@deprecated Do not use; this will be removed in next release. | [
"Set",
"the",
"column",
"type",
"from",
"a",
"string",
"property",
"(",
"normally",
"a",
"string",
"from",
"an",
"sql",
"input",
"file",
")"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/Column.php#L1280-L1304 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.resetModified | public function resetModified($col = null)
{
if ($col !== null) {
while (($offset = array_search($col, $this->modifiedColumns)) !== false) {
array_splice($this->modifiedColumns, $offset, 1);
}
} else {
$this->modifiedColumns = array();
}
... | php | public function resetModified($col = null)
{
if ($col !== null) {
while (($offset = array_search($col, $this->modifiedColumns)) !== false) {
array_splice($this->modifiedColumns, $offset, 1);
}
} else {
$this->modifiedColumns = array();
}
... | [
"public",
"function",
"resetModified",
"(",
"$",
"col",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"col",
"!==",
"null",
")",
"{",
"while",
"(",
"(",
"$",
"offset",
"=",
"array_search",
"(",
"$",
"col",
",",
"$",
"this",
"->",
"modifiedColumns",
")",
"... | Sets the modified state for the object to be false.
@param string $col If supplied, only the specified column is reset.
@return self | [
"Sets",
"the",
"modified",
"state",
"for",
"the",
"object",
"to",
"be",
"false",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L252-L263 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.equals | public function equals($obj)
{
$thisclass = get_class($this);
if (is_object($obj) && $obj instanceof $thisclass) {
if ($this === $obj) {
return true;
} elseif ($this->getPrimaryKey() === null || $obj->getPrimaryKey() === null) {
return false;
... | php | public function equals($obj)
{
$thisclass = get_class($this);
if (is_object($obj) && $obj instanceof $thisclass) {
if ($this === $obj) {
return true;
} elseif ($this->getPrimaryKey() === null || $obj->getPrimaryKey() === null) {
return false;
... | [
"public",
"function",
"equals",
"(",
"$",
"obj",
")",
"{",
"$",
"thisclass",
"=",
"get_class",
"(",
"$",
"this",
")",
";",
"if",
"(",
"is_object",
"(",
"$",
"obj",
")",
"&&",
"$",
"obj",
"instanceof",
"$",
"thisclass",
")",
"{",
"if",
"(",
"$",
"... | Compares this with another <code>BaseObject</code> instance. If
<code>obj</code> is an instance of <code>BaseObject</code>, delegates to
<code>equals(BaseObject)</code>. Otherwise, returns <code>false</code>.
@param obj The object to compare to.
@return Whether equal to the object specified. | [
"Compares",
"this",
"with",
"another",
"<code",
">",
"BaseObject<",
"/",
"code",
">",
"instance",
".",
"If",
"<code",
">",
"obj<",
"/",
"code",
">",
"is",
"an",
"instance",
"of",
"<code",
">",
"BaseObject<",
"/",
"code",
">",
"delegates",
"to",
"<code",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L274-L288 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.hashCode | public function hashCode()
{
if (null !== $this->getPrimaryKey()) {
return crc32(serialize($this->getPrimaryKey()));
}
return crc32(serialize(clone $this));
} | php | public function hashCode()
{
if (null !== $this->getPrimaryKey()) {
return crc32(serialize($this->getPrimaryKey()));
}
return crc32(serialize(clone $this));
} | [
"public",
"function",
"hashCode",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
")",
"{",
"return",
"crc32",
"(",
"serialize",
"(",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
")",
")",
";",
"}",
"return",
... | If the primary key is not null, return the hashcode of the
primary key. Otherwise, return the hash code of the object.
@return int Hashcode | [
"If",
"the",
"primary",
"key",
"is",
"not",
"null",
"return",
"the",
"hashcode",
"of",
"the",
"primary",
"key",
".",
"Otherwise",
"return",
"the",
"hash",
"code",
"of",
"the",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L296-L303 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.getVirtualColumn | public function getVirtualColumn($name)
{
if (!$this->hasVirtualColumn($name)) {
throw new PropelException('Cannot get value of inexistent virtual column ' . $name);
}
return $this->virtualColumns[$name];
} | php | public function getVirtualColumn($name)
{
if (!$this->hasVirtualColumn($name)) {
throw new PropelException('Cannot get value of inexistent virtual column ' . $name);
}
return $this->virtualColumns[$name];
} | [
"public",
"function",
"getVirtualColumn",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasVirtualColumn",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'Cannot get value of inexistent virtual column '",
".",
"$",
... | Get the value of a virtual column in this object
@return mixed
@throws PropelException | [
"Get",
"the",
"value",
"of",
"a",
"virtual",
"column",
"in",
"this",
"object"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L334-L341 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.log | protected function log($msg, $priority = Propel::LOG_INFO)
{
return Propel::log(get_class($this) . ': ' . $msg, $priority);
} | php | protected function log($msg, $priority = Propel::LOG_INFO)
{
return Propel::log(get_class($this) . ': ' . $msg, $priority);
} | [
"protected",
"function",
"log",
"(",
"$",
"msg",
",",
"$",
"priority",
"=",
"Propel",
"::",
"LOG_INFO",
")",
"{",
"return",
"Propel",
"::",
"log",
"(",
"get_class",
"(",
"$",
"this",
")",
".",
"': '",
".",
"$",
"msg",
",",
"$",
"priority",
")",
";"... | Logs a message using Propel::log().
@param string $msg
@param int $priority One of the Propel::LOG_* logging levels
@return boolean | [
"Logs",
"a",
"message",
"using",
"Propel",
"::",
"log",
"()",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L366-L369 |
propelorm/Propel | runtime/lib/om/BaseObject.php | BaseObject.exportTo | public function exportTo($parser, $includeLazyLoadColumns = true)
{
if (!$parser instanceof PropelParser) {
$parser = PropelParser::getParser($parser);
}
return $parser->fromArray($this->toArray(BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
} | php | public function exportTo($parser, $includeLazyLoadColumns = true)
{
if (!$parser instanceof PropelParser) {
$parser = PropelParser::getParser($parser);
}
return $parser->fromArray($this->toArray(BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns, array(), true));
} | [
"public",
"function",
"exportTo",
"(",
"$",
"parser",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"parser",
"instanceof",
"PropelParser",
")",
"{",
"$",
"parser",
"=",
"PropelParser",
"::",
"getParser",
"(",
"$",
"parser... | Export the current object properties to a string, using a given parser format
<code>
$book = BookQuery::create()->findPk(9012);
echo $book->exportTo('JSON');
=> {"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}');
</code>
@param mixed $parser A Propel... | [
"Export",
"the",
"current",
"object",
"properties",
"to",
"a",
"string",
"using",
"a",
"given",
"parser",
"format",
"<code",
">",
"$book",
"=",
"BookQuery",
"::",
"create",
"()",
"-",
">",
"findPk",
"(",
"9012",
")",
";",
"echo",
"$book",
"-",
">",
"ex... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/om/BaseObject.php#L406-L413 |
propelorm/Propel | runtime/lib/map/RelationMap.php | RelationMap.addColumnMapping | public function addColumnMapping(ColumnMap $local, ColumnMap $foreign)
{
$this->localColumns[] = $local;
$this->foreignColumns[] = $foreign;
} | php | public function addColumnMapping(ColumnMap $local, ColumnMap $foreign)
{
$this->localColumns[] = $local;
$this->foreignColumns[] = $foreign;
} | [
"public",
"function",
"addColumnMapping",
"(",
"ColumnMap",
"$",
"local",
",",
"ColumnMap",
"$",
"foreign",
")",
"{",
"$",
"this",
"->",
"localColumns",
"[",
"]",
"=",
"$",
"local",
";",
"$",
"this",
"->",
"foreignColumns",
"[",
"]",
"=",
"$",
"foreign",... | Add a column mapping
@param ColumnMap $local The local column
@param ColumnMap $foreign The foreign column | [
"Add",
"a",
"column",
"mapping"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/map/RelationMap.php#L174-L178 |
propelorm/Propel | runtime/lib/adapter/DBSQLSRV.php | DBSQLSRV.setCharset | public function setCharset(PDO $con, $charset)
{
switch (strtolower($charset)) {
case 'utf-8':
$con->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);
break;
case 'system':
$con->setAttribute(PDO::SQLSRV_ATTR_ENCODING,... | php | public function setCharset(PDO $con, $charset)
{
switch (strtolower($charset)) {
case 'utf-8':
$con->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);
break;
case 'system':
$con->setAttribute(PDO::SQLSRV_ATTR_ENCODING,... | [
"public",
"function",
"setCharset",
"(",
"PDO",
"$",
"con",
",",
"$",
"charset",
")",
"{",
"switch",
"(",
"strtolower",
"(",
"$",
"charset",
")",
")",
"{",
"case",
"'utf-8'",
":",
"$",
"con",
"->",
"setAttribute",
"(",
"PDO",
"::",
"SQLSRV_ATTR_ENCODING"... | @see parent::setCharset()
@param PDO $con
@param string $charset
@throws PropelException | [
"@see",
"parent",
"::",
"setCharset",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/adapter/DBSQLSRV.php#L42-L54 |
propelorm/Propel | runtime/lib/adapter/DBSQLSRV.php | DBSQLSRV.bindValue | public function bindValue(PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null)
{
if ($cMap->isTemporal()) {
$value = $this->formatTemporalValue($value, $cMap);
} elseif (is_resource($value) && $cMap->isLob()) {
// we always need to make sure that the str... | php | public function bindValue(PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null)
{
if ($cMap->isTemporal()) {
$value = $this->formatTemporalValue($value, $cMap);
} elseif (is_resource($value) && $cMap->isLob()) {
// we always need to make sure that the str... | [
"public",
"function",
"bindValue",
"(",
"PDOStatement",
"$",
"stmt",
",",
"$",
"parameter",
",",
"$",
"value",
",",
"ColumnMap",
"$",
"cMap",
",",
"$",
"position",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"cMap",
"->",
"isTemporal",
"(",
")",
")",
"{",... | @see DBAdapter::bindValue()
@param PDOStatement $stmt
@param string $parameter
@param mixed $value
@param ColumnMap $cMap
@param null|integer $position
@return boolean | [
"@see",
"DBAdapter",
"::",
"bindValue",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/adapter/DBSQLSRV.php#L95-L114 |
propelorm/Propel | generator/lib/builder/om/QueryInheritanceBuilder.php | QueryInheritanceBuilder.getParentClassName | protected function getParentClassName()
{
$ancestorClassName = ClassTools::classname($this->getChild()->getAncestor());
if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
return $this->getNewStubQueryBuilder($this->getDatabase()->getTableByPhpName($ancestorClassName))->ge... | php | protected function getParentClassName()
{
$ancestorClassName = ClassTools::classname($this->getChild()->getAncestor());
if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
return $this->getNewStubQueryBuilder($this->getDatabase()->getTableByPhpName($ancestorClassName))->ge... | [
"protected",
"function",
"getParentClassName",
"(",
")",
"{",
"$",
"ancestorClassName",
"=",
"ClassTools",
"::",
"classname",
"(",
"$",
"this",
"->",
"getChild",
"(",
")",
"->",
"getAncestor",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getDatabase"... | Returns classpath to parent class.
@return string | [
"Returns",
"classpath",
"to",
"parent",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryInheritanceBuilder.php#L93-L106 |
propelorm/Propel | generator/lib/builder/om/QueryInheritanceBuilder.php | QueryInheritanceBuilder.addClassOpen | protected function addClassOpen(&$script)
{
$table = $this->getTable();
$tableName = $table->getName();
$tableDesc = $table->getDescription();
$baseBuilder = $this->getStubQueryBuilder();
$this->declareClassFromBuilder($baseBuilder);
$baseClassname = $this->getParent... | php | protected function addClassOpen(&$script)
{
$table = $this->getTable();
$tableName = $table->getName();
$tableDesc = $table->getDescription();
$baseBuilder = $this->getStubQueryBuilder();
$this->declareClassFromBuilder($baseBuilder);
$baseClassname = $this->getParent... | [
"protected",
"function",
"addClassOpen",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"$",
"tableName",
"=",
"$",
"table",
"->",
"getName",
"(",
")",
";",
"$",
"tableDesc",
"=",
"$",
"table",
"... | Adds class phpdoc comment and opening of class.
@param string &$script The script will be modified in this method. | [
"Adds",
"class",
"phpdoc",
"comment",
"and",
"opening",
"of",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryInheritanceBuilder.php#L127-L160 |
propelorm/Propel | generator/lib/builder/om/QueryInheritanceBuilder.php | QueryInheritanceBuilder.addClassBody | protected function addClassBody(&$script)
{
$this->declareClassFromBuilder($this->getStubPeerBuilder());
$this->declareClasses('PropelPDO', 'Criteria', 'BasePeer', 'PropelException');
$this->addFactory($script);
$this->addPreSelect($script);
$this->addPreUpdate($script);
... | php | protected function addClassBody(&$script)
{
$this->declareClassFromBuilder($this->getStubPeerBuilder());
$this->declareClasses('PropelPDO', 'Criteria', 'BasePeer', 'PropelException');
$this->addFactory($script);
$this->addPreSelect($script);
$this->addPreUpdate($script);
... | [
"protected",
"function",
"addClassBody",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"this",
"->",
"declareClassFromBuilder",
"(",
"$",
"this",
"->",
"getStubPeerBuilder",
"(",
")",
")",
";",
"$",
"this",
"->",
"declareClasses",
"(",
"'PropelPDO'",
",",
"'Criter... | Specifies the methods that are added as part of the stub object class.
By default there are no methods for the empty stub classes; override this method
if you want to change that behavior.
@see ObjectBuilder::addClassBody() | [
"Specifies",
"the",
"methods",
"that",
"are",
"added",
"as",
"part",
"of",
"the",
"stub",
"object",
"class",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryInheritanceBuilder.php#L170-L180 |
propelorm/Propel | generator/lib/builder/om/QueryInheritanceBuilder.php | QueryInheritanceBuilder.addFindOneOrCreate | protected function addFindOneOrCreate(&$script)
{
$child = $this->getChild();
$col = $child->getColumn();
$script .= "
/**
* Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
* and format the result with the current formatter
* By default, returns a mode... | php | protected function addFindOneOrCreate(&$script)
{
$child = $this->getChild();
$col = $child->getColumn();
$script .= "
/**
* Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
* and format the result with the current formatter
* By default, returns a mode... | [
"protected",
"function",
"addFindOneOrCreate",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"child",
"=",
"$",
"this",
"->",
"getChild",
"(",
")",
";",
"$",
"col",
"=",
"$",
"child",
"->",
"getColumn",
"(",
")",
";",
"$",
"script",
".=",
"\"\n\n /**\n ... | Adds findOneOrCreate function for this object.
@param unknown $script | [
"Adds",
"findOneOrCreate",
"function",
"for",
"this",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/builder/om/QueryInheritanceBuilder.php#L314-L348 |
propelorm/Propel | generator/lib/behavior/AlternativeCodingStandardsBehavior.php | AlternativeCodingStandardsBehavior.filter | protected function filter(&$script)
{
$filter = array();
if ($this->getParameter('brackets_newline') == 'true') {
$filter['#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m'] = "$1}
$1$2$3
$1{";
$filter['#^(\t*)(\w.*)\h\{$#m'] = "$1$2
$1{";
}
if ($this->getParameter('... | php | protected function filter(&$script)
{
$filter = array();
if ($this->getParameter('brackets_newline') == 'true') {
$filter['#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m'] = "$1}
$1$2$3
$1{";
$filter['#^(\t*)(\w.*)\h\{$#m'] = "$1$2
$1{";
}
if ($this->getParameter('... | [
"protected",
"function",
"filter",
"(",
"&",
"$",
"script",
")",
"{",
"$",
"filter",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getParameter",
"(",
"'brackets_newline'",
")",
"==",
"'true'",
")",
"{",
"$",
"filter",
"[",
"'#^(\\t*)\\}\... | Transform the coding standards of a PHP sourcecode string
@param string $script A script string to be filtered, passed as reference | [
"Transform",
"the",
"coding",
"standards",
"of",
"a",
"PHP",
"sourcecode",
"string"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/AlternativeCodingStandardsBehavior.php#L90-L112 |
propelorm/Propel | generator/lib/behavior/AlternativeCodingStandardsBehavior.php | AlternativeCodingStandardsBehavior.stripComments | public static function stripComments($code)
{
$output = '';
$commentTokens = array(T_COMMENT, T_DOC_COMMENT);
foreach (token_get_all($code) as $token) {
if (is_array($token)) {
if (in_array($token[0], $commentTokens)) {
continue;
... | php | public static function stripComments($code)
{
$output = '';
$commentTokens = array(T_COMMENT, T_DOC_COMMENT);
foreach (token_get_all($code) as $token) {
if (is_array($token)) {
if (in_array($token[0], $commentTokens)) {
continue;
... | [
"public",
"static",
"function",
"stripComments",
"(",
"$",
"code",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"commentTokens",
"=",
"array",
"(",
"T_COMMENT",
",",
"T_DOC_COMMENT",
")",
";",
"foreach",
"(",
"token_get_all",
"(",
"$",
"code",
")",
"as"... | Remove inline and codeblock comments from a PHP code string
@param string $code The input code
@return string The input code, without comments | [
"Remove",
"inline",
"and",
"codeblock",
"comments",
"from",
"a",
"PHP",
"code",
"string"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/behavior/AlternativeCodingStandardsBehavior.php#L121-L136 |
propelorm/Propel | generator/lib/task/PropelSQLExec.php | PropelSQLExec.getBuildConnection | public function getBuildConnection($database)
{
if (!isset($this->buildConnections[$database])) {
// fallback to default connection settings from build.properties
return array(
'dsn' => $this->url,
'user' => $this->userId,
'pas... | php | public function getBuildConnection($database)
{
if (!isset($this->buildConnections[$database])) {
// fallback to default connection settings from build.properties
return array(
'dsn' => $this->url,
'user' => $this->userId,
'pas... | [
"public",
"function",
"getBuildConnection",
"(",
"$",
"database",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"buildConnections",
"[",
"$",
"database",
"]",
")",
")",
"{",
"// fallback to default connection settings from build.properties",
"return",
... | Get the buildtime connection settings for a given database name.
@param string $database
@return array $buildConnections | [
"Get",
"the",
"buildtime",
"connection",
"settings",
"for",
"a",
"given",
"database",
"name",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLExec.php#L116-L128 |
propelorm/Propel | generator/lib/task/PropelSQLExec.php | PropelSQLExec.main | public function main()
{
$conf = new GeneratorConfig();
$conf->setBuildProperties($this->getProject()->getProperties());
$this->setBuildConnections($conf->getBuildConnections());
if ($this->sqldbmap === null || $this->getSqlDbMap()->exists() === false) {
throw new BuildE... | php | public function main()
{
$conf = new GeneratorConfig();
$conf->setBuildProperties($this->getProject()->getProperties());
$this->setBuildConnections($conf->getBuildConnections());
if ($this->sqldbmap === null || $this->getSqlDbMap()->exists() === false) {
throw new BuildE... | [
"public",
"function",
"main",
"(",
")",
"{",
"$",
"conf",
"=",
"new",
"GeneratorConfig",
"(",
")",
";",
"$",
"conf",
"->",
"setBuildProperties",
"(",
"$",
"this",
"->",
"getProject",
"(",
")",
"->",
"getProperties",
"(",
")",
")",
";",
"$",
"this",
"... | Load the sql file and then execute it
@throws BuildException | [
"Load",
"the",
"sql",
"file",
"and",
"then",
"execute",
"it"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLExec.php#L209-L249 |
propelorm/Propel | generator/lib/task/PropelSQLExec.php | PropelSQLExec.insertDatabaseSqlFiles | protected function insertDatabaseSqlFiles($database, $statements)
{
$buildConnection = $this->getBuildConnection($database);
$dsn = str_replace("@DB@", $database, $buildConnection['dsn']);
$this->log(sprintf(' Connecting to database "%s" using DSN "%s"', $database, $dsn));
try {
... | php | protected function insertDatabaseSqlFiles($database, $statements)
{
$buildConnection = $this->getBuildConnection($database);
$dsn = str_replace("@DB@", $database, $buildConnection['dsn']);
$this->log(sprintf(' Connecting to database "%s" using DSN "%s"', $database, $dsn));
try {
... | [
"protected",
"function",
"insertDatabaseSqlFiles",
"(",
"$",
"database",
",",
"$",
"statements",
")",
"{",
"$",
"buildConnection",
"=",
"$",
"this",
"->",
"getBuildConnection",
"(",
"$",
"database",
")",
";",
"$",
"dsn",
"=",
"str_replace",
"(",
"\"@DB@\"",
... | Executes a set of SQL statements into the target database.
@param string $database The name of the database, as defined in the build connections
@param array $statements list of SQL statements (strings) to be executed
@return integer the number of successful statements
@throws BuildException | [
"Executes",
"a",
"set",
"of",
"SQL",
"statements",
"into",
"the",
"target",
"database",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLExec.php#L290-L338 |
propelorm/Propel | generator/lib/task/PropelSQLExec.php | PropelSQLExec.execSQL | protected function execSQL($sql)
{
// Check and ignore empty statements
if (trim($sql) == "") {
return;
}
try {
$this->totalSql++;
if (!$this->autocommit) {
$this->conn->beginTransaction();
}
$stmt = $this... | php | protected function execSQL($sql)
{
// Check and ignore empty statements
if (trim($sql) == "") {
return;
}
try {
$this->totalSql++;
if (!$this->autocommit) {
$this->conn->beginTransaction();
}
$stmt = $this... | [
"protected",
"function",
"execSQL",
"(",
"$",
"sql",
")",
"{",
"// Check and ignore empty statements",
"if",
"(",
"trim",
"(",
"$",
"sql",
")",
"==",
"\"\"",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"totalSql",
"++",
";",
"if",
"(",... | Execute a SQL statement using the current connection property.
@param string $sql SQL statement to execute
@throws PDOException | [
"Execute",
"a",
"SQL",
"statement",
"using",
"the",
"current",
"connection",
"property",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelSQLExec.php#L347-L378 |
propelorm/Propel | generator/lib/reverse/sqlite/SqliteSchemaParser.php | SqliteSchemaParser.addColumns | protected function addColumns(Table $table)
{
$stmt = $this->dbh->query("PRAGMA table_info('" . $table->getName() . "')");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$name = $row['name'];
$fulltype = $row['type'];
$size = null;
$precision = nul... | php | protected function addColumns(Table $table)
{
$stmt = $this->dbh->query("PRAGMA table_info('" . $table->getName() . "')");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$name = $row['name'];
$fulltype = $row['type'];
$size = null;
$precision = nul... | [
"protected",
"function",
"addColumns",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"dbh",
"->",
"query",
"(",
"\"PRAGMA table_info('\"",
".",
"$",
"table",
"->",
"getName",
"(",
")",
".",
"\"')\"",
")",
";",
"while",
"(",... | Adds Columns to the specified table.
@param Table $table The Table model class to add columns to.
@param string $version The database version. | [
"Adds",
"Columns",
"to",
"the",
"specified",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/reverse/sqlite/SqliteSchemaParser.php#L112-L166 |
propelorm/Propel | generator/lib/reverse/sqlite/SqliteSchemaParser.php | SqliteSchemaParser.addIndexes | protected function addIndexes(Table $table)
{
$stmt = $this->dbh->query("PRAGMA index_list('" . $table->getName() . "')");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$name = $row['name'];
$index = new Index($name);
$stmt2 = $this->dbh->query("PRAGMA index_... | php | protected function addIndexes(Table $table)
{
$stmt = $this->dbh->query("PRAGMA index_list('" . $table->getName() . "')");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$name = $row['name'];
$index = new Index($name);
$stmt2 = $this->dbh->query("PRAGMA index_... | [
"protected",
"function",
"addIndexes",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"dbh",
"->",
"query",
"(",
"\"PRAGMA index_list('\"",
".",
"$",
"table",
"->",
"getName",
"(",
")",
".",
"\"')\"",
")",
";",
"while",
"(",... | Load indexes for this table | [
"Load",
"indexes",
"for",
"this",
"table"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/reverse/sqlite/SqliteSchemaParser.php#L171-L188 |
propelorm/Propel | runtime/lib/validator/MaxValueValidator.php | MaxValueValidator.isValid | public function isValid(ValidatorMap $map, $value)
{
if (is_null($value) == false && is_numeric($value) == true) {
return intval($value) <= intval($map->getValue());
}
return false;
} | php | public function isValid(ValidatorMap $map, $value)
{
if (is_null($value) == false && is_numeric($value) == true) {
return intval($value) <= intval($map->getValue());
}
return false;
} | [
"public",
"function",
"isValid",
"(",
"ValidatorMap",
"$",
"map",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"==",
"false",
"&&",
"is_numeric",
"(",
"$",
"value",
")",
"==",
"true",
")",
"{",
"return",
"intval",
"(",
... | @see BasicValidator::isValid()
@param ValidatorMap $map
@param mixed $value
@return boolean | [
"@see",
"BasicValidator",
"::",
"isValid",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/validator/MaxValueValidator.php#L39-L46 |
propelorm/Propel | generator/lib/util/PropelSQLParser.php | PropelSQLParser.executeStatements | protected static function executeStatements($statements, $connection)
{
foreach ($statements as $statement) {
$stmt = $connection->prepare($statement);
if ($stmt instanceof PDOStatement) {
// only execute if has no error
$stmt->execute();
}... | php | protected static function executeStatements($statements, $connection)
{
foreach ($statements as $statement) {
$stmt = $connection->prepare($statement);
if ($stmt instanceof PDOStatement) {
// only execute if has no error
$stmt->execute();
}... | [
"protected",
"static",
"function",
"executeStatements",
"(",
"$",
"statements",
",",
"$",
"connection",
")",
"{",
"foreach",
"(",
"$",
"statements",
"as",
"$",
"statement",
")",
"{",
"$",
"stmt",
"=",
"$",
"connection",
"->",
"prepare",
"(",
"$",
"statemen... | Execute a list of DDL statements based on an array
Does not use transactions since they are not supported in DDL statements
@param array $statements a list of SQL statements
@param PDO $connection a connection object
@return integer the number of executed statements | [
"Execute",
"a",
"list",
"of",
"DDL",
"statements",
"based",
"on",
"an",
"array",
"Does",
"not",
"use",
"transactions",
"since",
"they",
"are",
"not",
"supported",
"in",
"DDL",
"statements"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/util/PropelSQLParser.php#L87-L98 |
propelorm/Propel | generator/lib/model/diff/PropelDatabaseDiff.php | PropelDatabaseDiff.getReverseDiff | public function getReverseDiff()
{
$diff = new self();
$diff->setAddedTables($this->getRemovedTables());
// idMethod is not set for tables build from reverse engineering
// FIXME: this should be handled by reverse classes
foreach ($diff->getAddedTables() as $name => $table) {... | php | public function getReverseDiff()
{
$diff = new self();
$diff->setAddedTables($this->getRemovedTables());
// idMethod is not set for tables build from reverse engineering
// FIXME: this should be handled by reverse classes
foreach ($diff->getAddedTables() as $name => $table) {... | [
"public",
"function",
"getReverseDiff",
"(",
")",
"{",
"$",
"diff",
"=",
"new",
"self",
"(",
")",
";",
"$",
"diff",
"->",
"setAddedTables",
"(",
"$",
"this",
"->",
"getRemovedTables",
"(",
")",
")",
";",
"// idMethod is not set for tables build from reverse engi... | Get the reverse diff for this diff
@return PropelDatabaseDiff | [
"Get",
"the",
"reverse",
"diff",
"for",
"this",
"diff"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/diff/PropelDatabaseDiff.php#L241-L261 |
propelorm/Propel | generator/lib/model/diff/PropelDatabaseDiff.php | PropelDatabaseDiff.getDescription | public function getDescription()
{
$changes = array();
if ($count = $this->countAddedTables()) {
$changes[] = sprintf('%d added tables', $count);
}
if ($count = $this->countRemovedTables()) {
$changes[] = sprintf('%d removed tables', $count);
}
... | php | public function getDescription()
{
$changes = array();
if ($count = $this->countAddedTables()) {
$changes[] = sprintf('%d added tables', $count);
}
if ($count = $this->countRemovedTables()) {
$changes[] = sprintf('%d removed tables', $count);
}
... | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"$",
"changes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"count",
"=",
"$",
"this",
"->",
"countAddedTables",
"(",
")",
")",
"{",
"$",
"changes",
"[",
"]",
"=",
"sprintf",
"(",
"'%d added tab... | Get a description of the database modifications
@return string | [
"Get",
"a",
"description",
"of",
"the",
"database",
"modifications"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/diff/PropelDatabaseDiff.php#L268-L285 |
propelorm/Propel | generator/lib/task/PropelConvertConfTask.php | PropelConvertConfTask.main | public function main()
{
// Check to make sure the input and output files were specified and that the input file exists.
if (!$this->xmlConfFile || !$this->xmlConfFile->exists()) {
throw new BuildException("No valid xmlConfFile specified.", $this->getLocation());
}
if (... | php | public function main()
{
// Check to make sure the input and output files were specified and that the input file exists.
if (!$this->xmlConfFile || !$this->xmlConfFile->exists()) {
throw new BuildException("No valid xmlConfFile specified.", $this->getLocation());
}
if (... | [
"public",
"function",
"main",
"(",
")",
"{",
"// Check to make sure the input and output files were specified and that the input file exists.",
"if",
"(",
"!",
"$",
"this",
"->",
"xmlConfFile",
"||",
"!",
"$",
"this",
"->",
"xmlConfFile",
"->",
"exists",
"(",
")",
")"... | The main method does the work of the task. | [
"The",
"main",
"method",
"does",
"the",
"work",
"of",
"the",
"task",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelConvertConfTask.php#L81-L189 |
propelorm/Propel | generator/lib/task/PropelConvertConfTask.php | PropelConvertConfTask.logClassMap | protected function logClassMap($classMap)
{
foreach ($classMap as $className => $classPath) {
$this->log(sprintf(' %-15s => %s', $className, $classPath), Project::MSG_VERBOSE);
}
} | php | protected function logClassMap($classMap)
{
foreach ($classMap as $className => $classPath) {
$this->log(sprintf(' %-15s => %s', $className, $classPath), Project::MSG_VERBOSE);
}
} | [
"protected",
"function",
"logClassMap",
"(",
"$",
"classMap",
")",
"{",
"foreach",
"(",
"$",
"classMap",
"as",
"$",
"className",
"=>",
"$",
"classPath",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"sprintf",
"(",
"' %-15s => %s'",
",",
"$",
"className",
",... | main() | [
"main",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelConvertConfTask.php#L191-L196 |
propelorm/Propel | generator/lib/task/PropelConvertConfTask.php | PropelConvertConfTask.getConvertedXmlValue | private static function getConvertedXmlValue($value)
{
$value = (string) $value; // convert from simplexml to string
// handle booleans specially
$lwr = strtolower($value);
if ($lwr === "false") {
$value = false;
} elseif ($lwr === "true") {
$value = t... | php | private static function getConvertedXmlValue($value)
{
$value = (string) $value; // convert from simplexml to string
// handle booleans specially
$lwr = strtolower($value);
if ($lwr === "false") {
$value = false;
} elseif ($lwr === "true") {
$value = t... | [
"private",
"static",
"function",
"getConvertedXmlValue",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"(",
"string",
")",
"$",
"value",
";",
"// convert from simplexml to string",
"// handle booleans specially",
"$",
"lwr",
"=",
"strtolower",
"(",
"$",
"value",... | Process XML value, handling boolean, if appropriate.
@param object The simplexml value object.
@return mixed | [
"Process",
"XML",
"value",
"handling",
"boolean",
"if",
"appropriate",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelConvertConfTask.php#L270-L282 |
propelorm/Propel | generator/lib/task/PropelConvertConfTask.php | PropelConvertConfTask.getClassMap | protected function getClassMap()
{
$phpconfClassmap = array();
$generatorConfig = $this->getGeneratorConfig();
foreach ($this->getDataModels() as $dataModel) {
foreach ($dataModel->getDatabases() as $database) {
$classMap = array();
foreach ($... | php | protected function getClassMap()
{
$phpconfClassmap = array();
$generatorConfig = $this->getGeneratorConfig();
foreach ($this->getDataModels() as $dataModel) {
foreach ($dataModel->getDatabases() as $database) {
$classMap = array();
foreach ($... | [
"protected",
"function",
"getClassMap",
"(",
")",
"{",
"$",
"phpconfClassmap",
"=",
"array",
"(",
")",
";",
"$",
"generatorConfig",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDataModels",
"(",
")",
... | Lists data model classes and builds an associative array className => classPath
To be used for autoloading
@return array | [
"Lists",
"data",
"model",
"classes",
"and",
"builds",
"an",
"associative",
"array",
"className",
"=",
">",
"classPath",
"To",
"be",
"used",
"for",
"autoloading"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelConvertConfTask.php#L290-L405 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.doDelete | public static function doDelete(Criteria $criteria, PropelPDO $con)
{
$db = Propel::getDB($criteria->getDbName());
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
//join are not supported with DELETE statement
if (count($criteria->getJoins())) {
throw new Propel... | php | public static function doDelete(Criteria $criteria, PropelPDO $con)
{
$db = Propel::getDB($criteria->getDbName());
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
//join are not supported with DELETE statement
if (count($criteria->getJoins())) {
throw new Propel... | [
"public",
"static",
"function",
"doDelete",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
")",
"{",
"$",
"db",
"=",
"Propel",
"::",
"getDB",
"(",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
")",
";",
"$",
"dbMap",
"=",
"Propel",
"... | Method to perform deletes based on values and keys in a
Criteria.
@param Criteria $criteria The criteria to use.
@param PropelPDO $con A PropelPDO connection object.
@return int The number of rows affected by last statement execution. For most
uses there is only one delete statement executed, so this number
wi... | [
"Method",
"to",
"perform",
"deletes",
"based",
"on",
"values",
"and",
"keys",
"in",
"a",
"Criteria",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L110-L155 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.doDeleteAll | public static function doDeleteAll($tableName, PropelPDO $con, $databaseName = null)
{
try {
$db = Propel::getDB($databaseName);
if ($db->useQuoteIdentifier()) {
$tableName = $db->quoteIdentifierTable($tableName);
}
$sql = "DELETE FROM " . $tab... | php | public static function doDeleteAll($tableName, PropelPDO $con, $databaseName = null)
{
try {
$db = Propel::getDB($databaseName);
if ($db->useQuoteIdentifier()) {
$tableName = $db->quoteIdentifierTable($tableName);
}
$sql = "DELETE FROM " . $tab... | [
"public",
"static",
"function",
"doDeleteAll",
"(",
"$",
"tableName",
",",
"PropelPDO",
"$",
"con",
",",
"$",
"databaseName",
"=",
"null",
")",
"{",
"try",
"{",
"$",
"db",
"=",
"Propel",
"::",
"getDB",
"(",
"$",
"databaseName",
")",
";",
"if",
"(",
"... | Method to deletes all contents of specified table.
This method is invoked from generated Peer classes like this:
<code>
public static function doDeleteAll($con = null)
{
if ($con === null) $con = Propel::getConnection(self::DATABASE_NAME);
BasePeer::doDeleteAll(self::TABLE_NAME, $con, self::DATABASE_NAME);
}
</code>
... | [
"Method",
"to",
"deletes",
"all",
"contents",
"of",
"specified",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L178-L194 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.doSelect | public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$db = Propel::getDB($criteria->getDbName());
$stmt = null;
if ($con === null) {
$con = Propel::getConnection($criteria->getDbName(), Prop... | php | public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$db = Propel::getDB($criteria->getDbName());
$stmt = null;
if ($con === null) {
$con = Propel::getConnection($criteria->getDbName(), Prop... | [
"public",
"static",
"function",
"doSelect",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
")",
";",
"$",
"d... | Executes query build by createSelectSql() and returns the resultset statement.
@param Criteria $criteria A Criteria.
@param PropelPDO $con A PropelPDO connection to use.
@return PDOStatement The resultset.
@throws PropelException
@see createSelectSql() | [
"Executes",
"query",
"build",
"by",
"createSelectSql",
"()",
"and",
"returns",
"the",
"resultset",
"statement",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L467-L496 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.doCount | public static function doCount(Criteria $criteria, PropelPDO $con = null)
{
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$db = Propel::getDB($criteria->getDbName());
if ($con === null) {
$con = Propel::getConnection($criteria->getDbName(), Propel::CONNECTION_READ);
... | php | public static function doCount(Criteria $criteria, PropelPDO $con = null)
{
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$db = Propel::getDB($criteria->getDbName());
if ($con === null) {
$con = Propel::getConnection($criteria->getDbName(), Propel::CONNECTION_READ);
... | [
"public",
"static",
"function",
"doCount",
"(",
"Criteria",
"$",
"criteria",
",",
"PropelPDO",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
")",
";",
"$",
"db... | Executes a COUNT query using either a simple SQL rewrite or, for more complex queries, a
sub-select of the SQL created by createSelectSql() and returns the statement.
@param Criteria $criteria A Criteria.
@param PropelPDO $con A PropelPDO connection to use.
@return PDOStatement The resultset statement.
@thro... | [
"Executes",
"a",
"COUNT",
"query",
"using",
"either",
"a",
"simple",
"SQL",
"rewrite",
"or",
"for",
"more",
"complex",
"queries",
"a",
"sub",
"-",
"select",
"of",
"the",
"SQL",
"created",
"by",
"createSelectSql",
"()",
"and",
"returns",
"the",
"statement",
... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L509-L557 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.doValidate | public static function doValidate($dbName, $tableName, $columns)
{
$dbMap = Propel::getDatabaseMap($dbName);
$tableMap = $dbMap->getTable($tableName);
$failureMap = array(); // map of ValidationFailed objects
foreach ($columns as $colName => $colValue) {
if ($tableMap->ha... | php | public static function doValidate($dbName, $tableName, $columns)
{
$dbMap = Propel::getDatabaseMap($dbName);
$tableMap = $dbMap->getTable($tableName);
$failureMap = array(); // map of ValidationFailed objects
foreach ($columns as $colName => $colValue) {
if ($tableMap->ha... | [
"public",
"static",
"function",
"doValidate",
"(",
"$",
"dbName",
",",
"$",
"tableName",
",",
"$",
"columns",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"$",
"dbName",
")",
";",
"$",
"tableMap",
"=",
"$",
"dbMap",
"->",
"getTab... | Applies any validators that were defined in the schema to the specified columns.
@param string $dbName The name of the database
@param string $tableName The name of the table
@param array $columns Array of column names as key and column values as value.
@return ValidationFailed[]|bool A list of validation failu... | [
"Applies",
"any",
"validators",
"that",
"were",
"defined",
"in",
"the",
"schema",
"to",
"the",
"specified",
"columns",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L568-L590 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.getPrimaryKey | private static function getPrimaryKey(Criteria $criteria)
{
// Assume all the keys are for the same table.
$keys = $criteria->keys();
$key = $keys[0];
$table = $criteria->getTableName($key);
$pk = null;
if (!empty($table)) {
$dbMap = Propel::getDatabase... | php | private static function getPrimaryKey(Criteria $criteria)
{
// Assume all the keys are for the same table.
$keys = $criteria->keys();
$key = $keys[0];
$table = $criteria->getTableName($key);
$pk = null;
if (!empty($table)) {
$dbMap = Propel::getDatabase... | [
"private",
"static",
"function",
"getPrimaryKey",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"// Assume all the keys are for the same table.",
"$",
"keys",
"=",
"$",
"criteria",
"->",
"keys",
"(",
")",
";",
"$",
"key",
"=",
"$",
"keys",
"[",
"0",
"]",
";",
... | Helper method which returns the primary key contained
in the given Criteria object.
@param Criteria $criteria A Criteria.
@return ColumnMap If the Criteria object contains a primary key, or null if it doesn't.
@throws PropelException | [
"Helper",
"method",
"which",
"returns",
"the",
"primary",
"key",
"contained",
"in",
"the",
"given",
"Criteria",
"object",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L601-L621 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.needsSelectAliases | public static function needsSelectAliases(Criteria $criteria)
{
$columnNames = array();
foreach ($criteria->getSelectColumns() as $fullyQualifiedColumnName) {
if ($pos = strrpos($fullyQualifiedColumnName, '.')) {
$columnName = substr($fullyQualifiedColumnName, $pos);
... | php | public static function needsSelectAliases(Criteria $criteria)
{
$columnNames = array();
foreach ($criteria->getSelectColumns() as $fullyQualifiedColumnName) {
if ($pos = strrpos($fullyQualifiedColumnName, '.')) {
$columnName = substr($fullyQualifiedColumnName, $pos);
... | [
"public",
"static",
"function",
"needsSelectAliases",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"$",
"columnNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"criteria",
"->",
"getSelectColumns",
"(",
")",
"as",
"$",
"fullyQualifiedColumnName",
")",
... | Checks whether the Criteria needs to use column aliasing
This is implemented in a service class rather than in Criteria itself
in order to avoid doing the tests when it's not necessary (e.g. for SELECTs) | [
"Checks",
"whether",
"the",
"Criteria",
"needs",
"to",
"use",
"column",
"aliasing",
"This",
"is",
"implemented",
"in",
"a",
"service",
"class",
"rather",
"than",
"in",
"Criteria",
"itself",
"in",
"order",
"to",
"avoid",
"doing",
"the",
"tests",
"when",
"it",... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L628-L643 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.createSelectSql | public static function createSelectSql(Criteria $criteria, &$params)
{
$db = Propel::getDB($criteria->getDbName());
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$fromClause = array();
$joinClause = array();
$joinTables = array();
$whereClause = array();
... | php | public static function createSelectSql(Criteria $criteria, &$params)
{
$db = Propel::getDB($criteria->getDbName());
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
$fromClause = array();
$joinClause = array();
$joinTables = array();
$whereClause = array();
... | [
"public",
"static",
"function",
"createSelectSql",
"(",
"Criteria",
"$",
"criteria",
",",
"&",
"$",
"params",
")",
"{",
"$",
"db",
"=",
"Propel",
"::",
"getDB",
"(",
"$",
"criteria",
"->",
"getDbName",
"(",
")",
")",
";",
"$",
"dbMap",
"=",
"Propel",
... | Method to create an SQL query based on values in a Criteria.
This method creates only prepared statement SQL (using ? where values
will go). The second parameter ($params) stores the values that need
to be set before the statement is executed. The reason we do it this way
is to let the PDO layer handle all escaping ... | [
"Method",
"to",
"create",
"an",
"SQL",
"query",
"based",
"on",
"values",
"in",
"a",
"Criteria",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L659-L854 |
propelorm/Propel | runtime/lib/util/BasePeer.php | BasePeer.getValidator | public static function getValidator($classname)
{
try {
$v = isset(self::$validatorMap[$classname]) ? self::$validatorMap[$classname] : null;
if ($v === null) {
$cls = Propel::importClass($classname);
$v = new $cls();
self::$validatorMa... | php | public static function getValidator($classname)
{
try {
$v = isset(self::$validatorMap[$classname]) ? self::$validatorMap[$classname] : null;
if ($v === null) {
$cls = Propel::importClass($classname);
$v = new $cls();
self::$validatorMa... | [
"public",
"static",
"function",
"getValidator",
"(",
"$",
"classname",
")",
"{",
"try",
"{",
"$",
"v",
"=",
"isset",
"(",
"self",
"::",
"$",
"validatorMap",
"[",
"$",
"classname",
"]",
")",
"?",
"self",
"::",
"$",
"validatorMap",
"[",
"$",
"classname",... | This function searches for the given validator $name under propel/validator/$name.php,
imports and caches it.
@param string $classname The dot-path name of class (e.g. myapp.propel.MyValidator)
@return Validator|null object or null if not able to instantiate validator class (and error will be logged in this case) | [
"This",
"function",
"searches",
"for",
"the",
"given",
"validator",
"$name",
"under",
"propel",
"/",
"validator",
"/",
"$name",
".",
"php",
"imports",
"and",
"caches",
"it",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/util/BasePeer.php#L886-L902 |
propelorm/Propel | generator/lib/model/ColumnDefaultValue.php | ColumnDefaultValue.equals | public function equals(ColumnDefaultValue $other)
{
if ($this->getType() != $other->getType()) {
return false;
}
if ($this == $other) {
return true;
}
// special case for current timestamp
$equivalents = array('CURRENT_TIMESTAMP', 'NOW()');
... | php | public function equals(ColumnDefaultValue $other)
{
if ($this->getType() != $other->getType()) {
return false;
}
if ($this == $other) {
return true;
}
// special case for current timestamp
$equivalents = array('CURRENT_TIMESTAMP', 'NOW()');
... | [
"public",
"function",
"equals",
"(",
"ColumnDefaultValue",
"$",
"other",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"!=",
"$",
"other",
"->",
"getType",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"=="... | A method to compare if two Default values match
@param ColumnDefaultValue $other The value to compare to
@return boolean Whether this object represents same default value as $other
@author Niklas Närhinen <niklas@narhinen.net> | [
"A",
"method",
"to",
"compare",
"if",
"two",
"Default",
"values",
"match"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/model/ColumnDefaultValue.php#L98-L113 |
propelorm/Propel | generator/lib/task/PropelDataDumpTask.php | PropelDataDumpTask.createDataDbMap | private function createDataDbMap()
{
if ($this->getDataDbMap() === null) {
return;
}
// Produce the sql -> database map
$datadbmap = new Properties();
// Check to see if the sqldbmap has already been created.
if ($this->getDataDbMap()->exists()) {
... | php | private function createDataDbMap()
{
if ($this->getDataDbMap() === null) {
return;
}
// Produce the sql -> database map
$datadbmap = new Properties();
// Check to see if the sqldbmap has already been created.
if ($this->getDataDbMap()->exists()) {
... | [
"private",
"function",
"createDataDbMap",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getDataDbMap",
"(",
")",
"===",
"null",
")",
"{",
"return",
";",
"}",
"// Produce the sql -> database map",
"$",
"datadbmap",
"=",
"new",
"Properties",
"(",
")",
";",
"... | Create the data XML -> database map.
This is necessary because there is currently no other method of knowing which
data XML files correspond to which database. This map allows us to convert multiple
data XML files into SQL.
@throws IOException - if unable to store properties | [
"Create",
"the",
"data",
"XML",
"-",
">",
"database",
"map",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelDataDumpTask.php#L218-L248 |
propelorm/Propel | generator/lib/task/PropelDataDumpTask.php | PropelDataDumpTask.main | public function main()
{
$this->validate();
$buf = "Database settings:\n"
. " driver: " . ($this->databaseDriver ? $this->databaseDriver : "(default)" ). "\n"
. " URL: " . $this->databaseUrl . "\n"
. ($this->databaseUser ? " user: " . $this->databaseUser . "\n" :... | php | public function main()
{
$this->validate();
$buf = "Database settings:\n"
. " driver: " . ($this->databaseDriver ? $this->databaseDriver : "(default)" ). "\n"
. " URL: " . $this->databaseUrl . "\n"
. ($this->databaseUser ? " user: " . $this->databaseUser . "\n" :... | [
"public",
"function",
"main",
"(",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"$",
"buf",
"=",
"\"Database settings:\\n\"",
".",
"\" driver: \"",
".",
"(",
"$",
"this",
"->",
"databaseDriver",
"?",
"$",
"this",
"->",
"databaseDriver",
":",
"... | Iterates through each datamodel/database, dumps the contents of all tables and creates a DOM XML doc.
@return void
@throws BuildException | [
"Iterates",
"through",
"each",
"datamodel",
"/",
"database",
"dumps",
"the",
"contents",
"of",
"all",
"tables",
"and",
"creates",
"a",
"DOM",
"XML",
"doc",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelDataDumpTask.php#L256-L295 |
propelorm/Propel | generator/lib/task/PropelDataDumpTask.php | PropelDataDumpTask.getTableDataStmt | private function getTableDataStmt($tableName, PropelPlatformInterface $platform)
{
return $this->conn->query("SELECT * FROM " . $platform->quoteIdentifier($tableName));
} | php | private function getTableDataStmt($tableName, PropelPlatformInterface $platform)
{
return $this->conn->query("SELECT * FROM " . $platform->quoteIdentifier($tableName));
} | [
"private",
"function",
"getTableDataStmt",
"(",
"$",
"tableName",
",",
"PropelPlatformInterface",
"$",
"platform",
")",
"{",
"return",
"$",
"this",
"->",
"conn",
"->",
"query",
"(",
"\"SELECT * FROM \"",
".",
"$",
"platform",
"->",
"quoteIdentifier",
"(",
"$",
... | Gets PDOStatement of query to fetch all data from a table.
@param string $tableName
@param PropelPlatformInterface $platform
@return PDOStatement | [
"Gets",
"PDOStatement",
"of",
"query",
"to",
"fetch",
"all",
"data",
"from",
"a",
"table",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelDataDumpTask.php#L305-L308 |
propelorm/Propel | generator/lib/task/PropelDataDumpTask.php | PropelDataDumpTask.createXMLDoc | private function createXMLDoc(Database $database)
{
$doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true; // pretty printing
$doc->appendChild($doc->createComment("Created by PropelDataDumpTask."));
$dsNode = $doc->createElement("dataset");
$dsNode->setAttribute... | php | private function createXMLDoc(Database $database)
{
$doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true; // pretty printing
$doc->appendChild($doc->createComment("Created by PropelDataDumpTask."));
$dsNode = $doc->createElement("dataset");
$dsNode->setAttribute... | [
"private",
"function",
"createXMLDoc",
"(",
"Database",
"$",
"database",
")",
"{",
"$",
"doc",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"doc",
"->",
"formatOutput",
"=",
"true",
";",
"// pretty printing",
"$",
"doc",
"->",
... | Creates a DOM document containing data for specified database.
@param Database $database
@return DOMDocument | [
"Creates",
"a",
"DOM",
"document",
"containing",
"data",
"for",
"specified",
"database",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelDataDumpTask.php#L317-L349 |
propelorm/Propel | runtime/lib/adapter/DBMSSQL.php | DBMSSQL.applyLimit | public function applyLimit(&$sql, $offset, $limit)
{
// make sure offset and limit are numeric
if (!is_numeric($offset) || !is_numeric($limit)) {
throw new PropelException('DBMSSQL::applyLimit() expects a number for argument 2 and 3');
}
//split the select and from claus... | php | public function applyLimit(&$sql, $offset, $limit)
{
// make sure offset and limit are numeric
if (!is_numeric($offset) || !is_numeric($limit)) {
throw new PropelException('DBMSSQL::applyLimit() expects a number for argument 2 and 3');
}
//split the select and from claus... | [
"public",
"function",
"applyLimit",
"(",
"&",
"$",
"sql",
",",
"$",
"offset",
",",
"$",
"limit",
")",
"{",
"// make sure offset and limit are numeric",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"offset",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"limit",
")",
... | Simulated Limit/Offset
This rewrites the $sql query to apply the offset and limit.
some of the ORDER BY logic borrowed from Doctrine MsSqlPlatform
@see DBAdapter::applyLimit()
@author Benjamin Runnels <kraven@kraven.org>
@param string $sql
@param integer $offset
@param integer $limit
@return void
@throws... | [
"Simulated",
"Limit",
"/",
"Offset"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/adapter/DBMSSQL.php#L150-L287 |
propelorm/Propel | runtime/lib/adapter/DBMSSQL.php | DBMSSQL.cleanupSQL | public function cleanupSQL(&$sql, array &$params, Criteria $values, DatabaseMap $dbMap)
{
$i = 1;
$paramCols = array();
foreach ($params as $param) {
if (null !== $param['table']) {
$column = $dbMap->getTable($param['table'])->getColumn($param['column']);
... | php | public function cleanupSQL(&$sql, array &$params, Criteria $values, DatabaseMap $dbMap)
{
$i = 1;
$paramCols = array();
foreach ($params as $param) {
if (null !== $param['table']) {
$column = $dbMap->getTable($param['table'])->getColumn($param['column']);
... | [
"public",
"function",
"cleanupSQL",
"(",
"&",
"$",
"sql",
",",
"array",
"&",
"$",
"params",
",",
"Criteria",
"$",
"values",
",",
"DatabaseMap",
"$",
"dbMap",
")",
"{",
"$",
"i",
"=",
"1",
";",
"$",
"paramCols",
"=",
"array",
"(",
")",
";",
"foreach... | @see parent::cleanupSQL()
@param string $sql
@param array $params
@param Criteria $values
@param DatabaseMap $dbMap | [
"@see",
"parent",
"::",
"cleanupSQL",
"()"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/adapter/DBMSSQL.php#L297-L332 |
propelorm/Propel | generator/lib/task/PropelOMTask.php | PropelOMTask.ensureDirExists | protected function ensureDirExists($path)
{
$f = new PhingFile($this->getOutputDirectory(), $path);
if (!$f->exists()) {
if (!$f->mkdirs()) {
throw new BuildException("Error creating directories: " . $f->getPath());
}
}
} | php | protected function ensureDirExists($path)
{
$f = new PhingFile($this->getOutputDirectory(), $path);
if (!$f->exists()) {
if (!$f->mkdirs()) {
throw new BuildException("Error creating directories: " . $f->getPath());
}
}
} | [
"protected",
"function",
"ensureDirExists",
"(",
"$",
"path",
")",
"{",
"$",
"f",
"=",
"new",
"PhingFile",
"(",
"$",
"this",
"->",
"getOutputDirectory",
"(",
")",
",",
"$",
"path",
")",
";",
"if",
"(",
"!",
"$",
"f",
"->",
"exists",
"(",
")",
")",
... | Utility method to create directory for package if it doesn't already exist.
@param string $path The [relative] package path.
@throws BuildException - if there is an error creating directories | [
"Utility",
"method",
"to",
"create",
"directory",
"for",
"package",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelOMTask.php#L58-L66 |
propelorm/Propel | generator/lib/task/PropelOMTask.php | PropelOMTask.build | protected function build(OMBuilder $builder, $overwrite = true)
{
$path = $builder->getClassFilePath();
$this->ensureDirExists(dirname($path));
$_f = new PhingFile($this->getOutputDirectory(), $path);
// skip files already created once
if ($_f->exists() && !$overwrite) {
... | php | protected function build(OMBuilder $builder, $overwrite = true)
{
$path = $builder->getClassFilePath();
$this->ensureDirExists(dirname($path));
$_f = new PhingFile($this->getOutputDirectory(), $path);
// skip files already created once
if ($_f->exists() && !$overwrite) {
... | [
"protected",
"function",
"build",
"(",
"OMBuilder",
"$",
"builder",
",",
"$",
"overwrite",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"$",
"builder",
"->",
"getClassFilePath",
"(",
")",
";",
"$",
"this",
"->",
"ensureDirExists",
"(",
"dirname",
"(",
"$",
... | Uses a builder class to create the output class.
This method assumes that the DataModelBuilder class has been initialized with the build properties.
@param OMBuilder $builder
@param boolean $overwrite Whether to overwrite existing files with te new ones (default is YES).
@todo -cPropelOMTask Consider refactor... | [
"Uses",
"a",
"builder",
"class",
"to",
"create",
"the",
"output",
"class",
".",
"This",
"method",
"assumes",
"that",
"the",
"DataModelBuilder",
"class",
"has",
"been",
"initialized",
"with",
"the",
"build",
"properties",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/task/PropelOMTask.php#L78-L110 |
propelorm/Propel | generator/lib/task/PropelOMTask.php | PropelOMTask.main | public function main()
{
// check to make sure task received all correct params
$this->validate();
$generatorConfig = $this->getGeneratorConfig();
$totalNbFiles = 0;
$dataModels = $this->getDataModels();
$this->log('Generating PHP files...');
foreach ($data... | php | public function main()
{
// check to make sure task received all correct params
$this->validate();
$generatorConfig = $this->getGeneratorConfig();
$totalNbFiles = 0;
$dataModels = $this->getDataModels();
$this->log('Generating PHP files...');
foreach ($data... | [
"public",
"function",
"main",
"(",
")",
"{",
"// check to make sure task received all correct params",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"$",
"generatorConfig",
"=",
"$",
"this",
"->",
"getGeneratorConfig",
"(",
")",
";",
"$",
"totalNbFiles",
"=",
"0... | 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/PropelOMTask.php#L115-L260 |
propelorm/Propel | generator/lib/platform/OraclePlatform.php | OraclePlatform.initialize | protected function initialize()
{
parent::initialize();
$this->schemaDomainMap[PropelTypes::BOOLEAN] = new Domain(PropelTypes::BOOLEAN_EMU, "NUMBER", "1", "0");
$this->schemaDomainMap[PropelTypes::CLOB] = new Domain(PropelTypes::CLOB_EMU, "CLOB");
$this->schemaDomainMap[PropelTypes::... | php | protected function initialize()
{
parent::initialize();
$this->schemaDomainMap[PropelTypes::BOOLEAN] = new Domain(PropelTypes::BOOLEAN_EMU, "NUMBER", "1", "0");
$this->schemaDomainMap[PropelTypes::CLOB] = new Domain(PropelTypes::CLOB_EMU, "CLOB");
$this->schemaDomainMap[PropelTypes::... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"$",
"this",
"->",
"schemaDomainMap",
"[",
"PropelTypes",
"::",
"BOOLEAN",
"]",
"=",
"new",
"Domain",
"(",
"PropelTypes",
"::",
"BOOLEAN_EMU",
",",
"\"NUMBER\"... | Initializes db specific domain mapping. | [
"Initializes",
"db",
"specific",
"domain",
"mapping",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/OraclePlatform.php#L28-L53 |
propelorm/Propel | generator/lib/platform/OraclePlatform.php | OraclePlatform.generateBlockStorage | public function generateBlockStorage($object, $isPrimaryKey = false)
{
$vendorSpecific = $object->getVendorInfoForType('oracle');
if ($vendorSpecific->isEmpty()) {
return '';
}
if ($isPrimaryKey) {
$physicalParameters = "
USING INDEX
";
$prefix = ... | php | public function generateBlockStorage($object, $isPrimaryKey = false)
{
$vendorSpecific = $object->getVendorInfoForType('oracle');
if ($vendorSpecific->isEmpty()) {
return '';
}
if ($isPrimaryKey) {
$physicalParameters = "
USING INDEX
";
$prefix = ... | [
"public",
"function",
"generateBlockStorage",
"(",
"$",
"object",
",",
"$",
"isPrimaryKey",
"=",
"false",
")",
"{",
"$",
"vendorSpecific",
"=",
"$",
"object",
"->",
"getVendorInfoForType",
"(",
"'oracle'",
")",
";",
"if",
"(",
"$",
"vendorSpecific",
"->",
"i... | Generate oracle block storage
@param Table|Index $object object with vendor parameters
@param bool $isPrimaryKey is a primary key vendor part
@return string oracle vendor sql part | [
"Generate",
"oracle",
"block",
"storage"
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/OraclePlatform.php#L265-L314 |
propelorm/Propel | generator/lib/platform/OraclePlatform.php | OraclePlatform.getAddIndexDDL | public function getAddIndexDDL(Index $index)
{
// don't create index form primary key
if ($this->getPrimaryKeyName($index->getTable()) == $this->quoteIdentifier($index->getName())) {
return "";
}
$pattern = "
CREATE %sINDEX %s ON %s (%s)%s;
";
return sprintf($pa... | php | public function getAddIndexDDL(Index $index)
{
// don't create index form primary key
if ($this->getPrimaryKeyName($index->getTable()) == $this->quoteIdentifier($index->getName())) {
return "";
}
$pattern = "
CREATE %sINDEX %s ON %s (%s)%s;
";
return sprintf($pa... | [
"public",
"function",
"getAddIndexDDL",
"(",
"Index",
"$",
"index",
")",
"{",
"// don't create index form primary key",
"if",
"(",
"$",
"this",
"->",
"getPrimaryKeyName",
"(",
"$",
"index",
"->",
"getTable",
"(",
")",
")",
"==",
"$",
"this",
"->",
"quoteIdenti... | 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/OraclePlatform.php#L323-L341 |
propelorm/Propel | generator/lib/platform/OraclePlatform.php | OraclePlatform.getColumnBindingPHP | public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = " ")
{
if ($column->getPDOType() == PropelTypes::CLOB_EMU) {
return sprintf(
"%s\$stmt->bindParam(%s, %s, %s, strlen(%s));
",
$tab,
$identifier,
... | php | public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = " ")
{
if ($column->getPDOType() == PropelTypes::CLOB_EMU) {
return sprintf(
"%s\$stmt->bindParam(%s, %s, %s, strlen(%s));
",
$tab,
$identifier,
... | [
"public",
"function",
"getColumnBindingPHP",
"(",
"$",
"column",
",",
"$",
"identifier",
",",
"$",
"columnValueAccessor",
",",
"$",
"tab",
"=",
"\"\t\t\t\"",
")",
"{",
"if",
"(",
"$",
"column",
"->",
"getPDOType",
"(",
")",
"==",
"PropelTypes",
"::",
"CLOB... | Get the PHP snippet for binding a value to a column.
Warning: duplicates logic from DBOracle::bindValue().
Any code modification here must be ported there. | [
"Get",
"the",
"PHP",
"snippet",
"for",
"binding",
"a",
"value",
"to",
"a",
"column",
".",
"Warning",
":",
"duplicates",
"logic",
"from",
"DBOracle",
"::",
"bindValue",
"()",
".",
"Any",
"code",
"modification",
"here",
"must",
"be",
"ported",
"there",
"."
] | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/generator/lib/platform/OraclePlatform.php#L348-L363 |
propelorm/Propel | runtime/lib/query/Criteria.php | Criteria.clear | public function clear()
{
$this->map = array();
$this->namedCriterions = array();
$this->ignoreCase = false;
$this->singleRecord = false;
$this->selectModifiers = array();
$this->selectColumns = array();
$this->orderByColumns = array();
$this->groupByC... | php | public function clear()
{
$this->map = array();
$this->namedCriterions = array();
$this->ignoreCase = false;
$this->singleRecord = false;
$this->selectModifiers = array();
$this->selectColumns = array();
$this->orderByColumns = array();
$this->groupByC... | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"map",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"namedCriterions",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"ignoreCase",
"=",
"false",
";",
"$",
"this",
"->",
"singleRe... | Brings this criteria back to its initial state, so that it
can be reused as if it was new. Except if the criteria has grown in
capacity, it is left at the current capacity.
@return void | [
"Brings",
"this",
"criteria",
"back",
"to",
"its",
"initial",
"state",
"so",
"that",
"it",
"can",
"be",
"reused",
"as",
"if",
"it",
"was",
"new",
".",
"Except",
"if",
"the",
"criteria",
"has",
"grown",
"in",
"capacity",
"it",
"is",
"left",
"at",
"the",... | train | https://github.com/propelorm/Propel/blob/3f7a284906ce3e402bcb101938270842fdad71fa/runtime/lib/query/Criteria.php#L304-L329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.