repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
propelorm/Propel2 | src/Propel/Common/Config/Loader/FileLoader.php | FileLoader.resolveString | private function resolveString($value, array $resolving = [])
{
if (preg_match('/^%([^%\s]+)%$/', $value, $match)) {
if (null !== $ret = $this->parseEnvironmentParams($match[1])) {
return $ret;
}
$key = $match[1];
if (isset($resolving[$key]))... | php | private function resolveString($value, array $resolving = [])
{
if (preg_match('/^%([^%\s]+)%$/', $value, $match)) {
if (null !== $ret = $this->parseEnvironmentParams($match[1])) {
return $ret;
}
$key = $match[1];
if (isset($resolving[$key]))... | [
"private",
"function",
"resolveString",
"(",
"$",
"value",
",",
"array",
"$",
"resolving",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^%([^%\\s]+)%$/'",
",",
"$",
"value",
",",
"$",
"match",
")",
")",
"{",
"if",
"(",
"null",
"!==",
"$"... | Resolves parameters inside a string
@param string $value The string to resolve
@param array $resolving An array of keys that are being resolved (used internally to detect circular references)
@return string The resolved string
@throws \Propel\Common\Config\Except... | [
"Resolves",
"parameters",
"inside",
"a",
"string"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/FileLoader.php#L185-L231 |
propelorm/Propel2 | src/Propel/Common/Config/Loader/FileLoader.php | FileLoader.get | private function get($property_key)
{
$found = false;
$ret = $this->getValue($property_key, null, $found);
if (false === $found) {
throw new InvalidArgumentException("Parameter '$property_key' not found in configuration file.");
}
return $ret;
} | php | private function get($property_key)
{
$found = false;
$ret = $this->getValue($property_key, null, $found);
if (false === $found) {
throw new InvalidArgumentException("Parameter '$property_key' not found in configuration file.");
}
return $ret;
} | [
"private",
"function",
"get",
"(",
"$",
"property_key",
")",
"{",
"$",
"found",
"=",
"false",
";",
"$",
"ret",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"property_key",
",",
"null",
",",
"$",
"found",
")",
";",
"if",
"(",
"false",
"===",
"$",
... | Return the value correspondent to a given key.
@param mixed $property_key The key, in the configuration values array, to return the respective value
@return mixed
@throws \Propel\Common\Config\Exception\InvalidArgumentException when non-existent key in configuration array | [
"Return",
"the",
"value",
"correspondent",
"to",
"a",
"given",
"key",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/FileLoader.php#L265-L276 |
propelorm/Propel2 | src/Propel/Common/Config/Loader/FileLoader.php | FileLoader.getValue | private function getValue($property_key, $config = null, &$found)
{
if (null === $config) {
$config = $this->config;
}
foreach ($config as $key => $value) {
if ($key === $property_key) {
$found = true;
return $value;
}
... | php | private function getValue($property_key, $config = null, &$found)
{
if (null === $config) {
$config = $this->config;
}
foreach ($config as $key => $value) {
if ($key === $property_key) {
$found = true;
return $value;
}
... | [
"private",
"function",
"getValue",
"(",
"$",
"property_key",
",",
"$",
"config",
"=",
"null",
",",
"&",
"$",
"found",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"config",
";",
"}",
"foreach",... | Scan recursively an array to find a value of a given key.
@param string $property_key The array key
@param array $config The array to scan
@param boolean $found if the key was found
@return mixed The value or null if not found | [
"Scan",
"recursively",
"an",
"array",
"to",
"find",
"a",
"value",
"of",
"a",
"given",
"key",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/FileLoader.php#L287-L307 |
propelorm/Propel2 | src/Propel/Common/Config/Loader/FileLoader.php | FileLoader.parseEnvironmentParams | private function parseEnvironmentParams($value)
{
// env.variable is an environment variable
$env = explode('.', $value);
if ('env' === $env[0]) {
$envParam = getenv($env[1]);
if (false === $envParam) {
throw new InvalidArgumentException("Environment v... | php | private function parseEnvironmentParams($value)
{
// env.variable is an environment variable
$env = explode('.', $value);
if ('env' === $env[0]) {
$envParam = getenv($env[1]);
if (false === $envParam) {
throw new InvalidArgumentException("Environment v... | [
"private",
"function",
"parseEnvironmentParams",
"(",
"$",
"value",
")",
"{",
"// env.variable is an environment variable",
"$",
"env",
"=",
"explode",
"(",
"'.'",
",",
"$",
"value",
")",
";",
"if",
"(",
"'env'",
"===",
"$",
"env",
"[",
"0",
"]",
")",
"{",... | Check if the parameter contains an environment variable and parse it
@param string $value The value to parse
@return string|null
@throws \Propel\Common\Config\Exception\InvalidArgumentException if the environment variable is not set | [
"Check",
"if",
"the",
"parameter",
"contains",
"an",
"environment",
"variable",
"and",
"parse",
"it"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/Loader/FileLoader.php#L317-L331 |
propelorm/Propel2 | src/Propel/Generator/Command/SqlInsertCommand.php | SqlInsertCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$manager = new SqlManager();
$configOptions = [];
if ($sqlDir = $input->getOption('sql-dir')) {
$configOptions['propel']['paths']['sqlDir'] = $sqlDir;
}
$generatorConfig = $this->getGen... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$manager = new SqlManager();
$configOptions = [];
if ($sqlDir = $input->getOption('sql-dir')) {
$configOptions['propel']['paths']['sqlDir'] = $sqlDir;
}
$generatorConfig = $this->getGen... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"manager",
"=",
"new",
"SqlManager",
"(",
")",
";",
"$",
"configOptions",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"sqlDir",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/SqlInsertCommand.php#L42-L73 |
propelorm/Propel2 | src/Propel/Runtime/Util/PropelModelPager.php | PropelModelPager.getResults | public function getResults()
{
if (null === $this->results) {
$queryKey = method_exists($this->getQuery(), 'getQueryKey') ? $this->getQuery()->getQueryKey() : null;
if ($queryKey) {
$newQueryKey = sprintf('%s offset %s limit %s', $queryKey, $this->getQuery()->getOffse... | php | public function getResults()
{
if (null === $this->results) {
$queryKey = method_exists($this->getQuery(), 'getQueryKey') ? $this->getQuery()->getQueryKey() : null;
if ($queryKey) {
$newQueryKey = sprintf('%s offset %s limit %s', $queryKey, $this->getQuery()->getOffse... | [
"public",
"function",
"getResults",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"results",
")",
"{",
"$",
"queryKey",
"=",
"method_exists",
"(",
"$",
"this",
"->",
"getQuery",
"(",
")",
",",
"'getQueryKey'",
")",
"?",
"$",
"this",
"->... | Get the collection of results in the page
@return Collection A collection of results | [
"Get",
"the",
"collection",
"of",
"results",
"in",
"the",
"page"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Util/PropelModelPager.php#L140-L155 |
propelorm/Propel2 | src/Propel/Runtime/Util/PropelModelPager.php | PropelModelPager.setMaxPerPage | public function setMaxPerPage($max)
{
if ($max > 0) {
$this->maxPerPage = $max;
if (0 === $this->page) {
$this->page = 1;
}
} elseif (0 === $max) {
$this->maxPerPage = 0;
$this->page = 0;
} else {
$this->... | php | public function setMaxPerPage($max)
{
if ($max > 0) {
$this->maxPerPage = $max;
if (0 === $this->page) {
$this->page = 1;
}
} elseif (0 === $max) {
$this->maxPerPage = 0;
$this->page = 0;
} else {
$this->... | [
"public",
"function",
"setMaxPerPage",
"(",
"$",
"max",
")",
"{",
"if",
"(",
"$",
"max",
">",
"0",
")",
"{",
"$",
"this",
"->",
"maxPerPage",
"=",
"$",
"max",
";",
"if",
"(",
"0",
"===",
"$",
"this",
"->",
"page",
")",
"{",
"$",
"this",
"->",
... | Set the maximum number results per page
@param int $max | [
"Set",
"the",
"maximum",
"number",
"results",
"per",
"page"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Util/PropelModelPager.php#L367-L383 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/SeveralModelCriterion.php | SeveralModelCriterion.appendPsForUniqueClauseTo | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if (!is_array($this->value)) {
throw new InvalidValueException('Only array values are supported by this Criterion');
}
$clause = $this->clause;
foreach ($this->value as $value) {
if (null ===... | php | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if (!is_array($this->value)) {
throw new InvalidValueException('Only array values are supported by this Criterion');
}
$clause = $this->clause;
foreach ($this->value as $value) {
if (null ===... | [
"protected",
"function",
"appendPsForUniqueClauseTo",
"(",
"&",
"$",
"sb",
",",
"array",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"throw",
"new",
"InvalidValueException",
"(",
"'Only array va... | Appends a Prepared Statement representation of the ModelCriterion onto the buffer
@param string &$sb The string that will receive the Prepared Statement
@param array $params A list to which Prepared Statement parameters will be appended | [
"Appends",
"a",
"Prepared",
"Statement",
"representation",
"of",
"the",
"ModelCriterion",
"onto",
"the",
"buffer"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/SeveralModelCriterion.php#L26-L47 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/SeveralModelCriterion.php | SeveralModelCriterion.strReplaceOnce | protected static function strReplaceOnce($search, $replace, $subject)
{
$firstChar = strpos($subject, $search);
if (false !== $firstChar) {
$beforeStr = substr($subject, 0, $firstChar);
$afterStr = substr($subject, $firstChar + strlen($search));
return $beforeStr... | php | protected static function strReplaceOnce($search, $replace, $subject)
{
$firstChar = strpos($subject, $search);
if (false !== $firstChar) {
$beforeStr = substr($subject, 0, $firstChar);
$afterStr = substr($subject, $firstChar + strlen($search));
return $beforeStr... | [
"protected",
"static",
"function",
"strReplaceOnce",
"(",
"$",
"search",
",",
"$",
"replace",
",",
"$",
"subject",
")",
"{",
"$",
"firstChar",
"=",
"strpos",
"(",
"$",
"subject",
",",
"$",
"search",
")",
";",
"if",
"(",
"false",
"!==",
"$",
"firstChar"... | Replace only once
taken from http://www.php.net/manual/en/function.str-replace.php | [
"Replace",
"only",
"once",
"taken",
"from",
"http",
":",
"//",
"www",
".",
"php",
".",
"net",
"/",
"manual",
"/",
"en",
"/",
"function",
".",
"str",
"-",
"replace",
".",
"php"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/SeveralModelCriterion.php#L53-L64 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.initialize | protected function initialize()
{
parent::initialize();
$version = \SQLite3::version();
$version = $version['versionString'];
$this->foreignKeySupport = version_compare($version, '3.6.19') >= 0;
$this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, 'DECIMAL'));
... | php | protected function initialize()
{
parent::initialize();
$version = \SQLite3::version();
$version = $version['versionString'];
$this->foreignKeySupport = version_compare($version, '3.6.19') >= 0;
$this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, 'DECIMAL'));
... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"$",
"version",
"=",
"\\",
"SQLite3",
"::",
"version",
"(",
")",
";",
"$",
"version",
"=",
"$",
"version",
"[",
"'versionString'",
"]",
";",
"$",
"this",... | Initializes db specific domain mapping. | [
"Initializes",
"db",
"specific",
"domain",
"mapping",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L51-L72 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.setGeneratorConfig | public function setGeneratorConfig(GeneratorConfigInterface $generatorConfig)
{
parent::setGeneratorConfig($generatorConfig);
if (null !== ($foreignKeySupport = $generatorConfig->getConfigProperty('database.adapter.sqlite.foreignKey'))) {
$this->foreignKeySupport = filter_var($foreignKe... | php | public function setGeneratorConfig(GeneratorConfigInterface $generatorConfig)
{
parent::setGeneratorConfig($generatorConfig);
if (null !== ($foreignKeySupport = $generatorConfig->getConfigProperty('database.adapter.sqlite.foreignKey'))) {
$this->foreignKeySupport = filter_var($foreignKe... | [
"public",
"function",
"setGeneratorConfig",
"(",
"GeneratorConfigInterface",
"$",
"generatorConfig",
")",
"{",
"parent",
"::",
"setGeneratorConfig",
"(",
"$",
"generatorConfig",
")",
";",
"if",
"(",
"null",
"!==",
"(",
"$",
"foreignKeySupport",
"=",
"$",
"generato... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L94-L104 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.getAddColumnsDDL | public function getAddColumnsDDL($columns)
{
$ret = '';
$pattern = "
ALTER TABLE %s ADD %s;
";
foreach ($columns as $column) {
$tableName = $column->getTable()->getName();
$ret .= sprintf($pattern,
$this->quoteIdentifier($tableName),
$t... | php | public function getAddColumnsDDL($columns)
{
$ret = '';
$pattern = "
ALTER TABLE %s ADD %s;
";
foreach ($columns as $column) {
$tableName = $column->getTable()->getName();
$ret .= sprintf($pattern,
$this->quoteIdentifier($tableName),
$t... | [
"public",
"function",
"getAddColumnsDDL",
"(",
"$",
"columns",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"pattern",
"=",
"\"\nALTER TABLE %s ADD %s;\n\"",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"$",
"tableName",
"=",
"$",
"c... | Builds the DDL SQL to remove a list of columns
@param Column[] $columns
@return string | [
"Builds",
"the",
"DDL",
"SQL",
"to",
"remove",
"a",
"list",
"of",
"columns"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L112-L127 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.getModifyTableDDL | public function getModifyTableDDL(TableDiff $tableDiff)
{
$changedNotEditableThroughDirectDDL = $this->tableAlteringWorkaround && (false
|| $tableDiff->hasModifiedFks()
|| $tableDiff->hasModifiedIndices()
|| $tableDiff->hasModifiedColumns()
|| $tableDiff->hasR... | php | public function getModifyTableDDL(TableDiff $tableDiff)
{
$changedNotEditableThroughDirectDDL = $this->tableAlteringWorkaround && (false
|| $tableDiff->hasModifiedFks()
|| $tableDiff->hasModifiedIndices()
|| $tableDiff->hasModifiedColumns()
|| $tableDiff->hasR... | [
"public",
"function",
"getModifyTableDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"changedNotEditableThroughDirectDDL",
"=",
"$",
"this",
"->",
"tableAlteringWorkaround",
"&&",
"(",
"false",
"||",
"$",
"tableDiff",
"->",
"hasModifiedFks",
"(",
")",
"||... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L132-L183 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.getMigrationTableDDL | public function getMigrationTableDDL(TableDiff $tableDiff)
{
$pattern = "
CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s;
DROP TABLE %s;
%s
INSERT INTO %s (%s) SELECT %s FROM %s;
DROP TABLE %s;
";
$originTable = clone $tableDiff->getFromTable();
$newTable = clone $tableDiff->getT... | php | public function getMigrationTableDDL(TableDiff $tableDiff)
{
$pattern = "
CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s;
DROP TABLE %s;
%s
INSERT INTO %s (%s) SELECT %s FROM %s;
DROP TABLE %s;
";
$originTable = clone $tableDiff->getFromTable();
$newTable = clone $tableDiff->getT... | [
"public",
"function",
"getMigrationTableDDL",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"pattern",
"=",
"\"\nCREATE TEMPORARY TABLE %s AS SELECT %s FROM %s;\nDROP TABLE %s;\n%s\nINSERT INTO %s (%s) SELECT %s FROM %s;\nDROP TABLE %s;\n\"",
";",
"$",
"originTable",
"=",
"clo... | Creates a temporarily created table with the new schema,
moves all items into it and drops the origin as well as renames the temp table to the origin then.
@param TableDiff $tableDiff
@return string | [
"Creates",
"a",
"temporarily",
"created",
"table",
"with",
"the",
"new",
"schema",
"moves",
"all",
"items",
"into",
"it",
"and",
"drops",
"the",
"origin",
"as",
"well",
"as",
"renames",
"the",
"temp",
"table",
"to",
"the",
"origin",
"then",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L192-L247 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.normalizeTable | public function normalizeTable(Table $table)
{
if ($table->getPrimaryKey()) {
//search if there is already a UNIQUE constraint over the primary keys
$pkUniqueExist = false;
foreach ($table->getUnices() as $unique) {
$coversAllPrimaryKeys = true;
... | php | public function normalizeTable(Table $table)
{
if ($table->getPrimaryKey()) {
//search if there is already a UNIQUE constraint over the primary keys
$pkUniqueExist = false;
foreach ($table->getUnices() as $unique) {
$coversAllPrimaryKeys = true;
... | [
"public",
"function",
"normalizeTable",
"(",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"->",
"getPrimaryKey",
"(",
")",
")",
"{",
"//search if there is already a UNIQUE constraint over the primary keys",
"$",
"pkUniqueExist",
"=",
"false",
";",
"fore... | Unfortunately, SQLite does not support composite pks where one is AUTOINCREMENT,
so we have to flag both as NOT NULL and create in either way a UNIQUE constraint over pks since
those UNIQUE is otherwise automatically created by the sqlite engine.
@param Table $table | [
"Unfortunately",
"SQLite",
"does",
"not",
"support",
"composite",
"pks",
"where",
"one",
"is",
"AUTOINCREMENT",
"so",
"we",
"have",
"to",
"flag",
"both",
"as",
"NOT",
"NULL",
"and",
"create",
"in",
"either",
"way",
"a",
"UNIQUE",
"constraint",
"over",
"pks",... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L289-L332 |
propelorm/Propel2 | src/Propel/Generator/Platform/SqlitePlatform.php | SqlitePlatform.getPrimaryKeyDDL | public function getPrimaryKeyDDL(Table $table)
{
if ($table->hasPrimaryKey() && !$table->hasAutoIncrementPrimaryKey()) {
return 'PRIMARY KEY (' . $this->getColumnListDDL($table->getPrimaryKey()) . ')';
}
return '';
} | php | public function getPrimaryKeyDDL(Table $table)
{
if ($table->hasPrimaryKey() && !$table->hasAutoIncrementPrimaryKey()) {
return 'PRIMARY KEY (' . $this->getColumnListDDL($table->getPrimaryKey()) . ')';
}
return '';
} | [
"public",
"function",
"getPrimaryKeyDDL",
"(",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"->",
"hasPrimaryKey",
"(",
")",
"&&",
"!",
"$",
"table",
"->",
"hasAutoIncrementPrimaryKey",
"(",
")",
")",
"{",
"return",
"'PRIMARY KEY ('",
".",
"$"... | Returns the SQL for the primary key of a Table object
@return string | [
"Returns",
"the",
"SQL",
"for",
"the",
"primary",
"key",
"of",
"a",
"Table",
"object"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Platform/SqlitePlatform.php#L338-L345 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/Criterion/BinaryModelCriterion.php | BinaryModelCriterion.appendPsForUniqueClauseTo | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if ($this->value !== null) {
$params[] = ['table' => $this->realtable, 'column' => $this->column, 'value' => $this->value];
$bindParam = ':p' . count($params);
$sb .= str_replace('?', $bindParam, $this->... | php | protected function appendPsForUniqueClauseTo(&$sb, array &$params)
{
if ($this->value !== null) {
$params[] = ['table' => $this->realtable, 'column' => $this->column, 'value' => $this->value];
$bindParam = ':p' . count($params);
$sb .= str_replace('?', $bindParam, $this->... | [
"protected",
"function",
"appendPsForUniqueClauseTo",
"(",
"&",
"$",
"sb",
",",
"array",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"value",
"!==",
"null",
")",
"{",
"$",
"params",
"[",
"]",
"=",
"[",
"'table'",
"=>",
"$",
"this",
... | Appends a Prepared Statement representation of the ModelCriterion onto the buffer
@param string &$sb The string that will receive the Prepared Statement
@param array $params A list to which Prepared Statement parameters will be appended | [
"Appends",
"a",
"Prepared",
"Statement",
"representation",
"of",
"the",
"ModelCriterion",
"onto",
"the",
"buffer"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/Criterion/BinaryModelCriterion.php#L24-L33 |
propelorm/Propel2 | src/Propel/Generator/Model/PhpNameGenerator.php | PhpNameGenerator.generateName | public function generateName($inputs)
{
$schemaName = $inputs[0];
$method = $inputs[1];
if (count($inputs) > 2) {
$prefix = $inputs[2];
if (!empty($prefix) && substr($schemaName, 0, strlen($prefix)) === $prefix) {
$schemaName = substr($schemaName, str... | php | public function generateName($inputs)
{
$schemaName = $inputs[0];
$method = $inputs[1];
if (count($inputs) > 2) {
$prefix = $inputs[2];
if (!empty($prefix) && substr($schemaName, 0, strlen($prefix)) === $prefix) {
$schemaName = substr($schemaName, str... | [
"public",
"function",
"generateName",
"(",
"$",
"inputs",
")",
"{",
"$",
"schemaName",
"=",
"$",
"inputs",
"[",
"0",
"]",
";",
"$",
"method",
"=",
"$",
"inputs",
"[",
"1",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"inputs",
")",
">",
"2",
")",
"{... | <code>inputs</code> should consist of two (three) elements, the
original name of the database element and the method for
generating the name.
The optional third element may contain a prefix that will be
script from name prior to generate the resulting name.
There are currently three methods:
<code>CONV_METHOD_NOCHANGE<... | [
"<code",
">",
"inputs<",
"/",
"code",
">",
"should",
"consist",
"of",
"two",
"(",
"three",
")",
"elements",
"the",
"original",
"name",
"of",
"the",
"database",
"element",
"and",
"the",
"method",
"for",
"generating",
"the",
"name",
".",
"The",
"optional",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PhpNameGenerator.php#L45-L75 |
propelorm/Propel2 | src/Propel/Generator/Model/PhpNameGenerator.php | PhpNameGenerator.underscoreMethod | protected function underscoreMethod($schemaName)
{
$name = '';
$tok = strtok($schemaName, self::STD_SEPARATOR_CHAR);
while (false !== $tok) {
$name .= ucfirst(strtolower($tok));
$tok = strtok(self::STD_SEPARATOR_CHAR);
}
return $name;
} | php | protected function underscoreMethod($schemaName)
{
$name = '';
$tok = strtok($schemaName, self::STD_SEPARATOR_CHAR);
while (false !== $tok) {
$name .= ucfirst(strtolower($tok));
$tok = strtok(self::STD_SEPARATOR_CHAR);
}
return $name;
} | [
"protected",
"function",
"underscoreMethod",
"(",
"$",
"schemaName",
")",
"{",
"$",
"name",
"=",
"''",
";",
"$",
"tok",
"=",
"strtok",
"(",
"$",
"schemaName",
",",
"self",
"::",
"STD_SEPARATOR_CHAR",
")",
";",
"while",
"(",
"false",
"!==",
"$",
"tok",
... | Converts a database schema name to php object name by Camelization.
Removes <code>STD_SEPARATOR_CHAR</code>, capitalizes first letter
of name and each letter after the <code>STD_SEPERATOR</code>,
converts the rest of the letters to lowercase.
This method should be named camelizeMethod() for clarity
my_CLASS_name -> M... | [
"Converts",
"a",
"database",
"schema",
"name",
"to",
"php",
"object",
"name",
"by",
"Camelization",
".",
"Removes",
"<code",
">",
"STD_SEPARATOR_CHAR<",
"/",
"code",
">",
"capitalizes",
"first",
"letter",
"of",
"name",
"and",
"each",
"letter",
"after",
"the",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PhpNameGenerator.php#L92-L102 |
propelorm/Propel2 | src/Propel/Generator/Model/PhpNameGenerator.php | PhpNameGenerator.cleanMethod | protected function cleanMethod($schemaName)
{
$name = '';
$regexp = '/([a-z0-9]+)/i';
$matches = [];
if (!preg_match_all($regexp, $schemaName, $matches)) {
return $schemaName;
}
foreach ($matches[1] as $tok) {
$name .= ucfirst(strtolower($tok)... | php | protected function cleanMethod($schemaName)
{
$name = '';
$regexp = '/([a-z0-9]+)/i';
$matches = [];
if (!preg_match_all($regexp, $schemaName, $matches)) {
return $schemaName;
}
foreach ($matches[1] as $tok) {
$name .= ucfirst(strtolower($tok)... | [
"protected",
"function",
"cleanMethod",
"(",
"$",
"schemaName",
")",
"{",
"$",
"name",
"=",
"''",
";",
"$",
"regexp",
"=",
"'/([a-z0-9]+)/i'",
";",
"$",
"matches",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"preg_match_all",
"(",
"$",
"regexp",
",",
"$",
"s... | Converts a database schema name to php object name. Removes
any character that is not a letter or a number and capitalizes
first letter of the name, the first letter of each alphanumeric
block and converts the rest of the letters to lowercase.
T$NAMA$RFO_max => TNamaRfoMax
@param string $schemaName name to be conve... | [
"Converts",
"a",
"database",
"schema",
"name",
"to",
"php",
"object",
"name",
".",
"Removes",
"any",
"character",
"that",
"is",
"not",
"a",
"letter",
"or",
"a",
"number",
"and",
"capitalizes",
"first",
"letter",
"of",
"the",
"name",
"the",
"first",
"letter... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PhpNameGenerator.php#L117-L131 |
propelorm/Propel2 | src/Propel/Generator/Model/PhpNameGenerator.php | PhpNameGenerator.phpnameMethod | protected function phpnameMethod($schemaName)
{
$name = '';
$tok = strtok($schemaName, self::STD_SEPARATOR_CHAR);
while (false !== $tok) {
$name .= ucfirst($tok);
$tok = strtok(self::STD_SEPARATOR_CHAR);
}
return $name;
} | php | protected function phpnameMethod($schemaName)
{
$name = '';
$tok = strtok($schemaName, self::STD_SEPARATOR_CHAR);
while (false !== $tok) {
$name .= ucfirst($tok);
$tok = strtok(self::STD_SEPARATOR_CHAR);
}
return $name;
} | [
"protected",
"function",
"phpnameMethod",
"(",
"$",
"schemaName",
")",
"{",
"$",
"name",
"=",
"''",
";",
"$",
"tok",
"=",
"strtok",
"(",
"$",
"schemaName",
",",
"self",
"::",
"STD_SEPARATOR_CHAR",
")",
";",
"while",
"(",
"false",
"!==",
"$",
"tok",
")"... | Converts a database schema name to php object name. Operates
same as underscoreMethod but does not convert anything to
lowercase.
my_CLASS_name -> MyCLASSName
@param string $schemaName name to be converted.
@return string Converted name.
@see NameGenerator
@see #underscoreMethod(String) | [
"Converts",
"a",
"database",
"schema",
"name",
"to",
"php",
"object",
"name",
".",
"Operates",
"same",
"as",
"underscoreMethod",
"but",
"does",
"not",
"convert",
"anything",
"to",
"lowercase",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/PhpNameGenerator.php#L145-L155 |
propelorm/Propel2 | src/Propel/Generator/Model/Inheritance.php | Inheritance.getConstantSuffix | public function getConstantSuffix()
{
$separator = PhpNameGenerator::STD_SEPARATOR_CHAR;
return strtoupper(rtrim(preg_replace('/(\W|_)+/', $separator, $this->key), $separator));
} | php | public function getConstantSuffix()
{
$separator = PhpNameGenerator::STD_SEPARATOR_CHAR;
return strtoupper(rtrim(preg_replace('/(\W|_)+/', $separator, $this->key), $separator));
} | [
"public",
"function",
"getConstantSuffix",
"(",
")",
"{",
"$",
"separator",
"=",
"PhpNameGenerator",
"::",
"STD_SEPARATOR_CHAR",
";",
"return",
"strtoupper",
"(",
"rtrim",
"(",
"preg_replace",
"(",
"'/(\\W|_)+/'",
",",
"$",
"separator",
",",
"$",
"this",
"->",
... | Get constant names' safe value of the key name.
@return string | [
"Get",
"constant",
"names",
"safe",
"value",
"of",
"the",
"key",
"name",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Inheritance.php#L43-L47 |
propelorm/Propel2 | src/Propel/Generator/Model/CrossForeignKeys.php | CrossForeignKeys.isAtLeastOneLocalPrimaryKeyNotCovered | public function isAtLeastOneLocalPrimaryKeyNotCovered(ForeignKey $fk)
{
$primaryKeys = $fk->getLocalPrimaryKeys();
foreach ($primaryKeys as $primaryKey) {
$covered = false;
foreach ($this->getCrossForeignKeys() as $crossFK) {
if ($crossFK->hasLocalColumn($prim... | php | public function isAtLeastOneLocalPrimaryKeyNotCovered(ForeignKey $fk)
{
$primaryKeys = $fk->getLocalPrimaryKeys();
foreach ($primaryKeys as $primaryKey) {
$covered = false;
foreach ($this->getCrossForeignKeys() as $crossFK) {
if ($crossFK->hasLocalColumn($prim... | [
"public",
"function",
"isAtLeastOneLocalPrimaryKeyNotCovered",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"$",
"primaryKeys",
"=",
"$",
"fk",
"->",
"getLocalPrimaryKeys",
"(",
")",
";",
"foreach",
"(",
"$",
"primaryKeys",
"as",
"$",
"primaryKey",
")",
"{",
"$",
... | Returns true if at least one of the local columns of $fk is not already covered by another
foreignKey in our collection (getCrossForeignKeys)
E.g.
table (local primary keys -> foreignKey):
pk1 -> FK1
pk2
\
-> FK2
/
pk3 -> FK3
\
-> FK4
/
pk4
=> FK1(pk1), FK2(pk2, pk3), FK3(pk3), FK4(pk3, pk4).
isAtLeastOneLocalPr... | [
"Returns",
"true",
"if",
"at",
"least",
"one",
"of",
"the",
"local",
"columns",
"of",
"$fk",
"is",
"not",
"already",
"covered",
"by",
"another",
"foreignKey",
"in",
"our",
"collection",
"(",
"getCrossForeignKeys",
")"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/CrossForeignKeys.php#L133-L151 |
propelorm/Propel2 | src/Propel/Generator/Model/CrossForeignKeys.php | CrossForeignKeys.getUnclassifiedPrimaryKeys | public function getUnclassifiedPrimaryKeys()
{
$pks = [];
foreach ($this->getMiddleTable()->getPrimaryKey() as $pk) {
//required
$unclassified = true;
if ($this->getIncomingForeignKey()->hasLocalColumn($pk)) {
$unclassified = false;
}
... | php | public function getUnclassifiedPrimaryKeys()
{
$pks = [];
foreach ($this->getMiddleTable()->getPrimaryKey() as $pk) {
//required
$unclassified = true;
if ($this->getIncomingForeignKey()->hasLocalColumn($pk)) {
$unclassified = false;
}
... | [
"public",
"function",
"getUnclassifiedPrimaryKeys",
"(",
")",
"{",
"$",
"pks",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getMiddleTable",
"(",
")",
"->",
"getPrimaryKey",
"(",
")",
"as",
"$",
"pk",
")",
"{",
"//required",
"$",
"unclassified... | Returns all primary keys of middle-table which are not already covered by at least on of our cross foreignKey collection.
@return Column[] | [
"Returns",
"all",
"primary",
"keys",
"of",
"middle",
"-",
"table",
"which",
"are",
"not",
"already",
"covered",
"by",
"at",
"least",
"on",
"of",
"our",
"cross",
"foreignKey",
"collection",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/CrossForeignKeys.php#L158-L181 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getConfiguredPlatform | public function getConfiguredPlatform(ConnectionInterface $con = null, $database = null)
{
$platform = $this->get()['generator']['platformClass'];
if (null === $platform) {
if ($database) {
$platform = $this->getBuildConnection($database)['adapter'];
}
... | php | public function getConfiguredPlatform(ConnectionInterface $con = null, $database = null)
{
$platform = $this->get()['generator']['platformClass'];
if (null === $platform) {
if ($database) {
$platform = $this->getBuildConnection($database)['adapter'];
}
... | [
"public",
"function",
"getConfiguredPlatform",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"database",
"=",
"null",
")",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
"get",
"(",
")",
"[",
"'generator'",
"]",
"[",
"'platformClass'",
"]",... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L52-L92 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getConfiguredSchemaParser | public function getConfiguredSchemaParser(ConnectionInterface $con = null, $database = null)
{
$reverse = $this->get()['migrations']['parserClass'];
if (null === $reverse) {
if ($database) {
$reverse = $this->getBuildConnection($database)['adapter'];
} else {... | php | public function getConfiguredSchemaParser(ConnectionInterface $con = null, $database = null)
{
$reverse = $this->get()['migrations']['parserClass'];
if (null === $reverse) {
if ($database) {
$reverse = $this->getBuildConnection($database)['adapter'];
} else {... | [
"public",
"function",
"getConfiguredSchemaParser",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"database",
"=",
"null",
")",
"{",
"$",
"reverse",
"=",
"$",
"this",
"->",
"get",
"(",
")",
"[",
"'migrations'",
"]",
"[",
"'parserClass'",
"]... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L97-L143 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getConfiguredBuilder | public function getConfiguredBuilder(Table $table, $type)
{
$classname = $this->getConfigProperty('generator.objectModel.builders.' . $type);
$builder = $this->getInstance($classname, $table);
$builder->setGeneratorConfig($this);
return $builder;
} | php | public function getConfiguredBuilder(Table $table, $type)
{
$classname = $this->getConfigProperty('generator.objectModel.builders.' . $type);
$builder = $this->getInstance($classname, $table);
$builder->setGeneratorConfig($this);
return $builder;
} | [
"public",
"function",
"getConfiguredBuilder",
"(",
"Table",
"$",
"table",
",",
"$",
"type",
")",
"{",
"$",
"classname",
"=",
"$",
"this",
"->",
"getConfigProperty",
"(",
"'generator.objectModel.builders.'",
".",
"$",
"type",
")",
";",
"$",
"builder",
"=",
"$... | Returns a configured data model builder class for specified table and
based on type ('object', 'query', 'tableMap' etc.).
@param Table $table
@param string $type
@return DataModelBuilder
@throws \Propel\Generator\Exception\ClassNotFoundException if the type of builder is wrong and the builder c... | [
"Returns",
"a",
"configured",
"data",
"model",
"builder",
"class",
"for",
"specified",
"table",
"and",
"based",
"on",
"type",
"(",
"object",
"query",
"tableMap",
"etc",
".",
")",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L155-L163 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getBuildConnections | public function getBuildConnections()
{
if (null === $this->buildConnections) {
$connectionNames = $this->get()['generator']['connections'];
$reverseConnection = $this->getConfigProperty('reverse.connection');
if (null !== $reverseConnection && !in_array($reverseConnecti... | php | public function getBuildConnections()
{
if (null === $this->buildConnections) {
$connectionNames = $this->get()['generator']['connections'];
$reverseConnection = $this->getConfigProperty('reverse.connection');
if (null !== $reverseConnection && !in_array($reverseConnecti... | [
"public",
"function",
"getBuildConnections",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"buildConnections",
")",
"{",
"$",
"connectionNames",
"=",
"$",
"this",
"->",
"get",
"(",
")",
"[",
"'generator'",
"]",
"[",
"'connections'",
"]",
";... | Return an array of all configured connection properties, from `generator` and `reverse`
sections of the configuration.
@return array | [
"Return",
"an",
"array",
"of",
"all",
"configured",
"connection",
"properties",
"from",
"generator",
"and",
"reverse",
"sections",
"of",
"the",
"configuration",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L183-L201 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getBuildConnection | public function getBuildConnection($databaseName = null)
{
if (null === $databaseName) {
$databaseName = $this->get()['generator']['defaultConnection'];
}
if (!array_key_exists($databaseName, $this->getBuildConnections())) {
throw new InvalidArgumentException("Invali... | php | public function getBuildConnection($databaseName = null)
{
if (null === $databaseName) {
$databaseName = $this->get()['generator']['defaultConnection'];
}
if (!array_key_exists($databaseName, $this->getBuildConnections())) {
throw new InvalidArgumentException("Invali... | [
"public",
"function",
"getBuildConnection",
"(",
"$",
"databaseName",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"databaseName",
")",
"{",
"$",
"databaseName",
"=",
"$",
"this",
"->",
"get",
"(",
")",
"[",
"'generator'",
"]",
"[",
"'defaultCon... | Return the connection properties array, of a given database name.
If the database name is null, it returns the default connection properties
@param string $databaseName
@return array
@throws \Propel\Generator\Exception\InvalidArgumentException if wrong database name | [
"Return",
"the",
"connection",
"properties",
"array",
"of",
"a",
"given",
"database",
"name",
".",
"If",
"the",
"database",
"name",
"is",
"null",
"it",
"returns",
"the",
"default",
"connection",
"properties"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L212-L223 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getConnection | public function getConnection($database = null)
{
$buildConnection = $this->getBuildConnection($database);
//Still useful ?
//$dsn = str_replace("@DB@", $database, $buildConnection['dsn']);
$dsn = $buildConnection['dsn'];
// Set user + password to null if they are empty str... | php | public function getConnection($database = null)
{
$buildConnection = $this->getBuildConnection($database);
//Still useful ?
//$dsn = str_replace("@DB@", $database, $buildConnection['dsn']);
$dsn = $buildConnection['dsn'];
// Set user + password to null if they are empty str... | [
"public",
"function",
"getConnection",
"(",
"$",
"database",
"=",
"null",
")",
"{",
"$",
"buildConnection",
"=",
"$",
"this",
"->",
"getBuildConnection",
"(",
"$",
"database",
")",
";",
"//Still useful ?",
"//$dsn = str_replace(\"@DB@\", $database, $buildConnection['dsn... | Return a connection object of a given database name
@param string $database
@return ConnectionInterface | [
"Return",
"a",
"connection",
"object",
"of",
"a",
"given",
"database",
"name"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L231-L249 |
propelorm/Propel2 | src/Propel/Generator/Config/GeneratorConfig.php | GeneratorConfig.getInstance | private function getInstance($className, $arguments = null, $interfaceName = null)
{
if (!class_exists($className)) {
throw new ClassNotFoundException("Class $className not found.");
}
$object = new $className($arguments);
if (null !== $interfaceName) {
if (... | php | private function getInstance($className, $arguments = null, $interfaceName = null)
{
if (!class_exists($className)) {
throw new ClassNotFoundException("Class $className not found.");
}
$object = new $className($arguments);
if (null !== $interfaceName) {
if (... | [
"private",
"function",
"getInstance",
"(",
"$",
"className",
",",
"$",
"arguments",
"=",
"null",
",",
"$",
"interfaceName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"ClassNotFoundException... | Return an instance of $className
@param string $className The name of the class to return an instance
@param string $interfaceName The name of the interface to be implemented by the returned class
@throws \Propel\Generator\Exception\ClassNotFoundException if the class doesn't exists
@throws \Propel\Generator\Except... | [
"Return",
"an",
"instance",
"of",
"$className"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Config/GeneratorConfig.php#L270-L289 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.getSection | public function getSection($section)
{
if (!array_key_exists($section, $this->config)) {
return null;
}
return $this->config[$section];
} | php | public function getSection($section)
{
if (!array_key_exists($section, $this->config)) {
return null;
}
return $this->config[$section];
} | [
"public",
"function",
"getSection",
"(",
"$",
"section",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"config",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"config",
"[",
"$",
... | Return a specific section of the configuration array.
It ca be useful to get, in example, only 'generator' values.
@param string $section the section to be returned
@return array | [
"Return",
"a",
"specific",
"section",
"of",
"the",
"configuration",
"array",
".",
"It",
"ca",
"be",
"useful",
"to",
"get",
"in",
"example",
"only",
"generator",
"values",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L67-L74 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.getConfigProperty | public function getConfigProperty($name)
{
if (!is_string($name)) {
throw new InvalidArgumentException("Invalid configuration property name '$name'.");
}
$keys = explode('.', $name);
$output = $this->get();
foreach ($keys as $key) {
if (!array_key_exi... | php | public function getConfigProperty($name)
{
if (!is_string($name)) {
throw new InvalidArgumentException("Invalid configuration property name '$name'.");
}
$keys = explode('.', $name);
$output = $this->get();
foreach ($keys as $key) {
if (!array_key_exi... | [
"public",
"function",
"getConfigProperty",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Invalid configuration property name '$name'.\"",
")",
";",
"}",
"$",
"keys",
... | Return a specific configuration property.
The name of the requested property must be given as a string, representing its hierarchy in the configuration
array, with each level separated by a dot. I.e.:
<code> $config['database']['adapter']['mysql']['tableType']</code>
is expressed by:
<code>'database.adapter.mysql.table... | [
"Return",
"a",
"specific",
"configuration",
"property",
".",
"The",
"name",
"of",
"the",
"requested",
"property",
"must",
"be",
"given",
"as",
"a",
"string",
"representing",
"its",
"hierarchy",
"in",
"the",
"configuration",
"array",
"with",
"each",
"level",
"s... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L88-L104 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.getConnectionParametersArray | public function getConnectionParametersArray($section = 'runtime')
{
if (!in_array($section, ['runtime', 'generator'])) {
return null;
}
$output = [];
foreach ($this->config[$section]['connections'] as $connection) {
$output[$connection] = $this->config['data... | php | public function getConnectionParametersArray($section = 'runtime')
{
if (!in_array($section, ['runtime', 'generator'])) {
return null;
}
$output = [];
foreach ($this->config[$section]['connections'] as $connection) {
$output[$connection] = $this->config['data... | [
"public",
"function",
"getConnectionParametersArray",
"(",
"$",
"section",
"=",
"'runtime'",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"section",
",",
"[",
"'runtime'",
",",
"'generator'",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"outpu... | Return an array of parameters relative to configured connections, for `runtime` or `generator` section.
It's useful for \Propel\Generator\Command\ConfigConvertCommand class
@param string $section `runtime` or `generator` section
@return array|null | [
"Return",
"an",
"array",
"of",
"parameters",
"relative",
"to",
"configured",
"connections",
"for",
"runtime",
"or",
"generator",
"section",
".",
"It",
"s",
"useful",
"for",
"\\",
"Propel",
"\\",
"Generator",
"\\",
"Command",
"\\",
"ConfigConvertCommand",
"class"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L113-L125 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.load | protected function load($fileName, $extraConf)
{
$dirs = $this->getDirs($fileName);
if ((null === $fileName) || (is_dir($fileName))) {
$fileName = self::CONFIG_FILE_NAME;
}
if (null === $extraConf) {
$extraConf = [];
}
if (self::CONFIG_FILE_... | php | protected function load($fileName, $extraConf)
{
$dirs = $this->getDirs($fileName);
if ((null === $fileName) || (is_dir($fileName))) {
$fileName = self::CONFIG_FILE_NAME;
}
if (null === $extraConf) {
$extraConf = [];
}
if (self::CONFIG_FILE_... | [
"protected",
"function",
"load",
"(",
"$",
"fileName",
",",
"$",
"extraConf",
")",
"{",
"$",
"dirs",
"=",
"$",
"this",
"->",
"getDirs",
"(",
"$",
"fileName",
")",
";",
"if",
"(",
"(",
"null",
"===",
"$",
"fileName",
")",
"||",
"(",
"is_dir",
"(",
... | Find a configuration file and loads it.
Default configuration file is named 'propel' and is expected to be found in the current directory
or a subdirectory named '/conf' or '/config'. It can have one of the supported extensions (.ini, .properties,
.json, .yaml, .yml, .xml, .php, .inc).
Only one configuration file is su... | [
"Find",
"a",
"configuration",
"file",
"and",
"loads",
"it",
".",
"Default",
"configuration",
"file",
"is",
"named",
"propel",
"and",
"is",
"expected",
"to",
"be",
"found",
"in",
"the",
"current",
"directory",
"or",
"a",
"subdirectory",
"named",
"/",
"conf",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L138-L174 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.process | protected function process($extraConf = null)
{
if (null === $extraConf && count($this->config) <= 0) {
return null;
}
$processor = new Processor();
$configuration = new PropelConfiguration();
if (is_array($extraConf)) {
$this->config = array_replace... | php | protected function process($extraConf = null)
{
if (null === $extraConf && count($this->config) <= 0) {
return null;
}
$processor = new Processor();
$configuration = new PropelConfiguration();
if (is_array($extraConf)) {
$this->config = array_replace... | [
"protected",
"function",
"process",
"(",
"$",
"extraConf",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"extraConf",
"&&",
"count",
"(",
"$",
"this",
"->",
"config",
")",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"processor",
"... | Validate the configuration array via Propel\Common\Config\PropelConfiguration class
and add default values.
@param array $extraConf Extra configuration to merge before processing. It's useful when a child class overwrite
the constructor to pass a built-in array of configuration, without load it from file. I.e.
Propel\... | [
"Validate",
"the",
"configuration",
"array",
"via",
"Propel",
"\\",
"Common",
"\\",
"Config",
"\\",
"PropelConfiguration",
"class",
"and",
"add",
"default",
"values",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L184-L201 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.getFiles | private function getFiles($dirs, $fileName, $dist = false)
{
$finder = new Finder();
$fileName .= '.{php,inc,ini,properties,yaml,yml,xml,json}';
if (true === $dist) {
$fileName .= '.dist';
}
$finder->in($dirs)->depth(0)->files()->name($fileName);
$files ... | php | private function getFiles($dirs, $fileName, $dist = false)
{
$finder = new Finder();
$fileName .= '.{php,inc,ini,properties,yaml,yml,xml,json}';
if (true === $dist) {
$fileName .= '.dist';
}
$finder->in($dirs)->depth(0)->files()->name($fileName);
$files ... | [
"private",
"function",
"getFiles",
"(",
"$",
"dirs",
",",
"$",
"fileName",
",",
"$",
"dist",
"=",
"false",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"fileName",
".=",
"'.{php,inc,ini,properties,yaml,yml,xml,json}'",
";",
"if",
"(",... | Return an array of configuration files in the $dirs directories
@param array $dirs The directories where to find the configuration files
@param string $fileName The name of the file
@param bool $dist If search .dist files
@return array | [
"Return",
"an",
"array",
"of",
"configuration",
"files",
"in",
"the",
"$dirs",
"directories"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L212-L229 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.getDirs | private function getDirs($fileName)
{
if (is_file($fileName)) {
return [];
}
$currentDir = getcwd();
if (is_dir($fileName)) {
$currentDir = $fileName;
}
$dirs[] = $currentDir;
if (is_dir($currentDir.'/conf')) {
$dirs[] = ... | php | private function getDirs($fileName)
{
if (is_file($fileName)) {
return [];
}
$currentDir = getcwd();
if (is_dir($fileName)) {
$currentDir = $fileName;
}
$dirs[] = $currentDir;
if (is_dir($currentDir.'/conf')) {
$dirs[] = ... | [
"private",
"function",
"getDirs",
"(",
"$",
"fileName",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"fileName",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"currentDir",
"=",
"getcwd",
"(",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"fileName",
... | Return the directories where to find the configuration file.
@param string $fileName
@return array | [
"Return",
"the",
"directories",
"where",
"to",
"find",
"the",
"configuration",
"file",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L256-L277 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.cleanupSlaveConnections | private function cleanupSlaveConnections()
{
foreach ($this->config['database']['connections'] as $name => $connection) {
if (count($connection['slaves']) <= 0) {
unset($this->config['database']['connections'][$name]['slaves']);
}
}
} | php | private function cleanupSlaveConnections()
{
foreach ($this->config['database']['connections'] as $name => $connection) {
if (count($connection['slaves']) <= 0) {
unset($this->config['database']['connections'][$name]['slaves']);
}
}
} | [
"private",
"function",
"cleanupSlaveConnections",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'database'",
"]",
"[",
"'connections'",
"]",
"as",
"$",
"name",
"=>",
"$",
"connection",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"connecti... | Remove empty `slaves` array from configured connections. | [
"Remove",
"empty",
"slaves",
"array",
"from",
"configured",
"connections",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L282-L289 |
propelorm/Propel2 | src/Propel/Common/Config/ConfigurationManager.php | ConfigurationManager.cleanupConnections | private function cleanupConnections()
{
foreach (['runtime', 'generator'] as $section) {
if (!isset($this->config[$section]['connections']) || count($this->config[$section]['connections']) === 0) {
$this->config[$section]['connections'] = array_keys($this->config['database']['con... | php | private function cleanupConnections()
{
foreach (['runtime', 'generator'] as $section) {
if (!isset($this->config[$section]['connections']) || count($this->config[$section]['connections']) === 0) {
$this->config[$section]['connections'] = array_keys($this->config['database']['con... | [
"private",
"function",
"cleanupConnections",
"(",
")",
"{",
"foreach",
"(",
"[",
"'runtime'",
",",
"'generator'",
"]",
"as",
"$",
"section",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"config",
"[",
"$",
"section",
"]",
"[",
"'connectio... | If not defined, set `runtime` and `generator` connections, based on `database.connections` property.
Check if runtime and generator connections are correctly defined. | [
"If",
"not",
"defined",
"set",
"runtime",
"and",
"generator",
"connections",
"based",
"on",
"database",
".",
"connections",
"property",
".",
"Check",
"if",
"runtime",
"and",
"generator",
"connections",
"are",
"correctly",
"defined",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Common/Config/ConfigurationManager.php#L295-L321 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php | AbstractObjectBuilder.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 (PropelTypes::DATE === $col->getType()
... | 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 (PropelTypes::DATE === $col->getType()
... | [
"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/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php#L32-L71 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php | AbstractObjectBuilder.isAddGenericMutators | protected function isAddGenericMutators()
{
$table = $this->getTable();
return (!$table->isAlias() && $this->getBuildProperty('generator.objectModel.addGenericMutators') && !$table->isReadOnly());
} | php | protected function isAddGenericMutators()
{
$table = $this->getTable();
return (!$table->isAlias() && $this->getBuildProperty('generator.objectModel.addGenericMutators') && !$table->isReadOnly());
} | [
"protected",
"function",
"isAddGenericMutators",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
";",
"return",
"(",
"!",
"$",
"table",
"->",
"isAlias",
"(",
")",
"&&",
"$",
"this",
"->",
"getBuildProperty",
"(",
"'generator.ob... | Whether to add the generic mutator methods (setByName(), setByPosition(), fromArray()).
This is based on the build property propel.addGenericMutators, and also whether the
table is read-only or an alias. | [
"Whether",
"to",
"add",
"the",
"generic",
"mutator",
"methods",
"(",
"setByName",
"()",
"setByPosition",
"()",
"fromArray",
"()",
")",
".",
"This",
"is",
"based",
"on",
"the",
"build",
"property",
"propel",
".",
"addGenericMutators",
"and",
"also",
"whether",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php#L142-L147 |
propelorm/Propel2 | src/Propel/Generator/Model/Diff/DatabaseComparator.php | DatabaseComparator.computeDiff | public static function computeDiff(Database $fromDatabase, Database $toDatabase, $caseInsensitive = false, $withRenaming = false, $removeTable = true, $excludedTables = [])
{
$databaseComparator = new self();
$databaseComparator->setFromDatabase($fromDatabase);
$databaseComparator->setToData... | php | public static function computeDiff(Database $fromDatabase, Database $toDatabase, $caseInsensitive = false, $withRenaming = false, $removeTable = true, $excludedTables = [])
{
$databaseComparator = new self();
$databaseComparator->setFromDatabase($fromDatabase);
$databaseComparator->setToData... | [
"public",
"static",
"function",
"computeDiff",
"(",
"Database",
"$",
"fromDatabase",
",",
"Database",
"$",
"toDatabase",
",",
"$",
"caseInsensitive",
"=",
"false",
",",
"$",
"withRenaming",
"=",
"false",
",",
"$",
"removeTable",
"=",
"true",
",",
"$",
"exclu... | Returns the computed difference between two database objects.
@param Database $fromDatabase
@param Database $toDatabase
@param boolean $caseInsensitive
@return DatabaseDiff|Boolean | [
"Returns",
"the",
"computed",
"difference",
"between",
"two",
"database",
"objects",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Diff/DatabaseComparator.php#L152-L176 |
propelorm/Propel2 | src/Propel/Generator/Model/Diff/DatabaseComparator.php | DatabaseComparator.compareTables | public function compareTables($caseInsensitive = false)
{
$fromDatabaseTables = $this->fromDatabase->getTables();
$toDatabaseTables = $this->toDatabase->getTables();
$databaseDifferences = 0;
// check for new tables in $toDatabase
foreach ($toDatabaseTables as $table) {
... | php | public function compareTables($caseInsensitive = false)
{
$fromDatabaseTables = $this->fromDatabase->getTables();
$toDatabaseTables = $this->toDatabase->getTables();
$databaseDifferences = 0;
// check for new tables in $toDatabase
foreach ($toDatabaseTables as $table) {
... | [
"public",
"function",
"compareTables",
"(",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"$",
"fromDatabaseTables",
"=",
"$",
"this",
"->",
"fromDatabase",
"->",
"getTables",
"(",
")",
";",
"$",
"toDatabaseTables",
"=",
"$",
"this",
"->",
"toDatabase",
"-... | Returns the number of differences.
Compares the tables of the fromDatabase and the toDatabase, and modifies
the inner databaseDiff if necessary.
@param boolean $caseInsensitive
@return integer | [
"Returns",
"the",
"number",
"of",
"differences",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/Diff/DatabaseComparator.php#L203-L268 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.build | public function build()
{
$this->validateModel();
$this->declareClass($this->getFullyQualifiedClassName());
$script = '';
$this->addClassOpen($script);
$this->addClassBody($script);
$this->addClassClose($script);
$ignoredNamespace = ltrim($this->getNamespace... | php | public function build()
{
$this->validateModel();
$this->declareClass($this->getFullyQualifiedClassName());
$script = '';
$this->addClassOpen($script);
$this->addClassBody($script);
$this->addClassClose($script);
$ignoredNamespace = ltrim($this->getNamespace... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"this",
"->",
"validateModel",
"(",
")",
";",
"$",
"this",
"->",
"declareClass",
"(",
"$",
"this",
"->",
"getFullyQualifiedClassName",
"(",
")",
")",
";",
"$",
"script",
"=",
"''",
";",
"$",
"this",
... | Builds the PHP source for current class and returns it as a string.
This is the main entry point and defines a basic structure that classes should follow.
In most cases this method will not need to be overridden by subclasses. This method
does assume that the output language is PHP code, so it will need to be overrid... | [
"Builds",
"the",
"PHP",
"source",
"for",
"current",
"class",
"and",
"returns",
"it",
"as",
"a",
"string",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L66-L91 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getPackage | public function getPackage()
{
$pkg = ($this->getTable()->getPackage() ? $this->getTable()->getPackage() : $this->getDatabase()->getPackage());
if (!$pkg) {
$pkg = $this->getBuildProperty('generator.targetPackage');
}
return $pkg;
} | php | public function getPackage()
{
$pkg = ($this->getTable()->getPackage() ? $this->getTable()->getPackage() : $this->getDatabase()->getPackage());
if (!$pkg) {
$pkg = $this->getBuildProperty('generator.targetPackage');
}
return $pkg;
} | [
"public",
"function",
"getPackage",
"(",
")",
"{",
"$",
"pkg",
"=",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getPackage",
"(",
")",
"?",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getPackage",
"(",
")",
":",
"$",
"this",
"->",
"g... | Gets package name for this table.
This is overridden by child classes that have different packages.
@return string | [
"Gets",
"package",
"name",
"for",
"this",
"table",
".",
"This",
"is",
"overridden",
"by",
"child",
"classes",
"that",
"have",
"different",
"packages",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L197-L205 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getPackagePath | public function getPackagePath()
{
$pkg = $this->getPackage();
if (false !== strpos($pkg, '/')) {
$pkg = preg_replace('#\.(map|om)$#', '/\1', $pkg);
$pkg = preg_replace('#\.(Map|Om)$#', '/\1', $pkg);
return $pkg;
}
$path = $pkg;
$path =... | php | public function getPackagePath()
{
$pkg = $this->getPackage();
if (false !== strpos($pkg, '/')) {
$pkg = preg_replace('#\.(map|om)$#', '/\1', $pkg);
$pkg = preg_replace('#\.(Map|Om)$#', '/\1', $pkg);
return $pkg;
}
$path = $pkg;
$path =... | [
"public",
"function",
"getPackagePath",
"(",
")",
"{",
"$",
"pkg",
"=",
"$",
"this",
"->",
"getPackage",
"(",
")",
";",
"if",
"(",
"false",
"!==",
"strpos",
"(",
"$",
"pkg",
",",
"'/'",
")",
")",
"{",
"$",
"pkg",
"=",
"preg_replace",
"(",
"'#\\.(ma... | Returns filesystem path for current package.
@return string | [
"Returns",
"filesystem",
"path",
"for",
"current",
"package",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L211-L229 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getClassNameFromBuilder | public function getClassNameFromBuilder($builder, $fqcn = false)
{
if ($fqcn) {
return $builder->getFullyQualifiedClassName();
}
$namespace = $builder->getNamespace();
$class = $builder->getUnqualifiedClassName();
if (isset($this->declaredClasses[$namespace])
... | php | public function getClassNameFromBuilder($builder, $fqcn = false)
{
if ($fqcn) {
return $builder->getFullyQualifiedClassName();
}
$namespace = $builder->getNamespace();
$class = $builder->getUnqualifiedClassName();
if (isset($this->declaredClasses[$namespace])
... | [
"public",
"function",
"getClassNameFromBuilder",
"(",
"$",
"builder",
",",
"$",
"fqcn",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"fqcn",
")",
"{",
"return",
"$",
"builder",
"->",
"getFullyQualifiedClassName",
"(",
")",
";",
"}",
"$",
"namespace",
"=",
"$"... | This declares the class use and returns the correct name to use (short classname, Alias, or FQCN)
@param AbstractOMBuilder $builder
@param boolean $fqcn true to return the $fqcn classname
@return string ClassName, Alias or FQCN | [
"This",
"declares",
"the",
"class",
"use",
"and",
"returns",
"the",
"correct",
"name",
"to",
"use",
"(",
"short",
"classname",
"Alias",
"or",
"FQCN",
")"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L249-L264 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getClassNameFromTable | public function getClassNameFromTable(Table $table, $fqcn = false)
{
$namespace = $table->getNamespace();
$class = $table->getPhpName();
return $this->declareClassNamespace($class, $namespace, true);
} | php | public function getClassNameFromTable(Table $table, $fqcn = false)
{
$namespace = $table->getNamespace();
$class = $table->getPhpName();
return $this->declareClassNamespace($class, $namespace, true);
} | [
"public",
"function",
"getClassNameFromTable",
"(",
"Table",
"$",
"table",
",",
"$",
"fqcn",
"=",
"false",
")",
"{",
"$",
"namespace",
"=",
"$",
"table",
"->",
"getNamespace",
"(",
")",
";",
"$",
"class",
"=",
"$",
"table",
"->",
"getPhpName",
"(",
")"... | This declares the class use and returns the correct name to use
@param Table $table
@param bool $fqcn
@return string | [
"This",
"declares",
"the",
"class",
"use",
"and",
"returns",
"the",
"correct",
"name",
"to",
"use"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L273-L279 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.declareClassNamespace | public function declareClassNamespace($class, $namespace = '', $alias = false)
{
$namespace = trim($namespace, '\\');
// check if the class is already declared
if (isset($this->declaredClasses[$namespace])
&& isset($this->declaredClasses[$namespace][$class])) {
retur... | php | public function declareClassNamespace($class, $namespace = '', $alias = false)
{
$namespace = trim($namespace, '\\');
// check if the class is already declared
if (isset($this->declaredClasses[$namespace])
&& isset($this->declaredClasses[$namespace][$class])) {
retur... | [
"public",
"function",
"declareClassNamespace",
"(",
"$",
"class",
",",
"$",
"namespace",
"=",
"''",
",",
"$",
"alias",
"=",
"false",
")",
"{",
"$",
"namespace",
"=",
"trim",
"(",
"$",
"namespace",
",",
"'\\\\'",
")",
";",
"// check if the class is already de... | Declare a class to be use and return it's name or it's alias
@param string $class the class name
@param string $namespace the namespace
@param string|boolean $alias the alias wanted, if set to True, it automatically adds an alias when needed
@return string the class name or it's alia... | [
"Declare",
"a",
"class",
"to",
"be",
"use",
"and",
"return",
"it",
"s",
"name",
"or",
"it",
"s",
"alias"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L289-L342 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.needAliasForClassName | protected function needAliasForClassName($class, $namespace)
{
if ($namespace == $this->getNamespace()) {
return false;
}
if (str_replace('\\Base', '', $namespace) == str_replace('\\Base', '', $this->getNamespace())) {
return true;
}
if (empty($names... | php | protected function needAliasForClassName($class, $namespace)
{
if ($namespace == $this->getNamespace()) {
return false;
}
if (str_replace('\\Base', '', $namespace) == str_replace('\\Base', '', $this->getNamespace())) {
return true;
}
if (empty($names... | [
"protected",
"function",
"needAliasForClassName",
"(",
"$",
"class",
",",
"$",
"namespace",
")",
"{",
"if",
"(",
"$",
"namespace",
"==",
"$",
"this",
"->",
"getNamespace",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"str_replace",
"(",
... | check if the current $class need an alias or if the class could be used with a shortname without conflict
@param string $class
@param string $namespace
@return boolean | [
"check",
"if",
"the",
"current",
"$class",
"need",
"an",
"alias",
"or",
"if",
"the",
"class",
"could",
"be",
"used",
"with",
"a",
"shortname",
"without",
"conflict"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L351-L384 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.declareClassNamespacePrefix | public function declareClassNamespacePrefix($class, $namespace = '', $aliasPrefix = false)
{
if (false !== $aliasPrefix && true !== $aliasPrefix) {
$alias = $aliasPrefix . $class;
} else {
$alias = $aliasPrefix;
}
return $this->declareClassNamespace($class, $... | php | public function declareClassNamespacePrefix($class, $namespace = '', $aliasPrefix = false)
{
if (false !== $aliasPrefix && true !== $aliasPrefix) {
$alias = $aliasPrefix . $class;
} else {
$alias = $aliasPrefix;
}
return $this->declareClassNamespace($class, $... | [
"public",
"function",
"declareClassNamespacePrefix",
"(",
"$",
"class",
",",
"$",
"namespace",
"=",
"''",
",",
"$",
"aliasPrefix",
"=",
"false",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"aliasPrefix",
"&&",
"true",
"!==",
"$",
"aliasPrefix",
")",
"{",
"... | Declare a use statement for a $class with a $namespace and an $aliasPrefix
This return the short ClassName or an alias
@param string $class the class
@param string $namespace the namespace
@param mixed $aliasPrefix optionally an alias or True to force an automatic alias prefix (Base or Child)
@return strin... | [
"Declare",
"a",
"use",
"statement",
"for",
"a",
"$class",
"with",
"a",
"$namespace",
"and",
"an",
"$aliasPrefix",
"This",
"return",
"the",
"short",
"ClassName",
"or",
"an",
"alias"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L395-L404 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.declareClass | public function declareClass($fullyQualifiedClassName, $aliasPrefix = false)
{
$fullyQualifiedClassName = trim($fullyQualifiedClassName, '\\');
if (($pos = strrpos($fullyQualifiedClassName, '\\')) !== false) {
return $this->declareClassNamespacePrefix(substr($fullyQualifiedClassName, $po... | php | public function declareClass($fullyQualifiedClassName, $aliasPrefix = false)
{
$fullyQualifiedClassName = trim($fullyQualifiedClassName, '\\');
if (($pos = strrpos($fullyQualifiedClassName, '\\')) !== false) {
return $this->declareClassNamespacePrefix(substr($fullyQualifiedClassName, $po... | [
"public",
"function",
"declareClass",
"(",
"$",
"fullyQualifiedClassName",
",",
"$",
"aliasPrefix",
"=",
"false",
")",
"{",
"$",
"fullyQualifiedClassName",
"=",
"trim",
"(",
"$",
"fullyQualifiedClassName",
",",
"'\\\\'",
")",
";",
"if",
"(",
"(",
"$",
"pos",
... | Declare a Fully qualified classname with an $aliasPrefix
This return the short ClassName to use or an alias
@param string $fullyQualifiedClassName the fully qualified classname
@param mixed $aliasPrefix optionally an alias or True to force an automatic alias prefix (Base or Child)
@return string the sho... | [
"Declare",
"a",
"Fully",
"qualified",
"classname",
"with",
"an",
"$aliasPrefix",
"This",
"return",
"the",
"short",
"ClassName",
"to",
"use",
"or",
"an",
"alias"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L414-L422 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getUseStatements | public function getUseStatements($ignoredNamespace = null)
{
$script = '';
$declaredClasses = $this->declaredClasses;
unset($declaredClasses[$ignoredNamespace]);
ksort($declaredClasses);
foreach ($declaredClasses as $namespace => $classes) {
asort($classes);
... | php | public function getUseStatements($ignoredNamespace = null)
{
$script = '';
$declaredClasses = $this->declaredClasses;
unset($declaredClasses[$ignoredNamespace]);
ksort($declaredClasses);
foreach ($declaredClasses as $namespace => $classes) {
asort($classes);
... | [
"public",
"function",
"getUseStatements",
"(",
"$",
"ignoredNamespace",
"=",
"null",
")",
"{",
"$",
"script",
"=",
"''",
";",
"$",
"declaredClasses",
"=",
"$",
"this",
"->",
"declaredClasses",
";",
"unset",
"(",
"$",
"declaredClasses",
"[",
"$",
"ignoredName... | Return all the use statement of the class
@param string $ignoredNamespace the ignored namespace
@return string | [
"Return",
"all",
"the",
"use",
"statement",
"of",
"the",
"class"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L478-L502 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getColumnConstant | public function getColumnConstant($col, $classname = null)
{
if (null === $col) {
throw new InvalidArgumentException('No columns were specified.');
}
if (null === $classname) {
return $this->getBuildProperty('generator.objectModel.classPrefix') . $col->getFQConstantN... | php | public function getColumnConstant($col, $classname = null)
{
if (null === $col) {
throw new InvalidArgumentException('No columns were specified.');
}
if (null === $classname) {
return $this->getBuildProperty('generator.objectModel.classPrefix') . $col->getFQConstantN... | [
"public",
"function",
"getColumnConstant",
"(",
"$",
"col",
",",
"$",
"classname",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"col",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'No columns were specified.'",
")",
";",
"}",
"if",
... | Get the column constant name (e.g. TableMapName::COLUMN_NAME).
@param Column $col The column we need a name for.
@param string $classname The TableMap classname to use.
@return string If $classname is provided, then will return $classname::COLUMN_NAME; if not, then the TableMapName is looked up for current tabl... | [
"Get",
"the",
"column",
"constant",
"name",
"(",
"e",
".",
"g",
".",
"TableMapName",
"::",
"COLUMN_NAME",
")",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L559-L577 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.extractCrossInformation | protected function extractCrossInformation(
CrossForeignKeys $crossFKs,
$crossFKToIgnore = null,
&$signature,
&$shortSignature,
&$normalizedShortSignature,
&$phpDoc
) {
foreach ($crossFKs->getCrossForeignKeys() as $fk) {
if (is_array($crossFKToIgno... | php | protected function extractCrossInformation(
CrossForeignKeys $crossFKs,
$crossFKToIgnore = null,
&$signature,
&$shortSignature,
&$normalizedShortSignature,
&$phpDoc
) {
foreach ($crossFKs->getCrossForeignKeys() as $fk) {
if (is_array($crossFKToIgno... | [
"protected",
"function",
"extractCrossInformation",
"(",
"CrossForeignKeys",
"$",
"crossFKs",
",",
"$",
"crossFKToIgnore",
"=",
"null",
",",
"&",
"$",
"signature",
",",
"&",
"$",
"shortSignature",
",",
"&",
"$",
"normalizedShortSignature",
",",
"&",
"$",
"phpDoc... | Extracts some useful information from a CrossForeignKeys object.
@param CrossForeignKeys $crossFKs
@param array|ForeignKey $crossFKToIgnore
@param array $signature
@param array $shortSignature
@param array $normalizedShortSignature
@param array $phpDoc | [
"Extracts",
"some",
"useful",
"information",
"from",
"a",
"CrossForeignKeys",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L768-L810 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getRelatedBySuffix | protected static function getRelatedBySuffix(ForeignKey $fk)
{
$relCol = '';
foreach ($fk->getMapping() as $mapping) {
list($localColumn, $foreignValueOrColumn) = $mapping;
$localColumnName = $localColumn->getPhpName();
$localTable = $fk->getTable();
... | php | protected static function getRelatedBySuffix(ForeignKey $fk)
{
$relCol = '';
foreach ($fk->getMapping() as $mapping) {
list($localColumn, $foreignValueOrColumn) = $mapping;
$localColumnName = $localColumn->getPhpName();
$localTable = $fk->getTable();
... | [
"protected",
"static",
"function",
"getRelatedBySuffix",
"(",
"ForeignKey",
"$",
"fk",
")",
"{",
"$",
"relCol",
"=",
"''",
";",
"foreach",
"(",
"$",
"fk",
"->",
"getMapping",
"(",
")",
"as",
"$",
"mapping",
")",
"{",
"list",
"(",
"$",
"localColumn",
",... | Gets the "RelatedBy*" suffix (if needed) that is attached to method and variable names.
The related by suffix is based on the local columns of the foreign key. If there is more than
one column in a table that points to the same foreign table, then a 'RelatedByLocalColName' suffix
will be appended.
@return string | [
"Gets",
"the",
"RelatedBy",
"*",
"suffix",
"(",
"if",
"needed",
")",
"that",
"is",
"attached",
"to",
"method",
"and",
"variable",
"names",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L840-L865 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getRefFKPhpNameAffix | public function getRefFKPhpNameAffix(ForeignKey $fk, $plural = false)
{
$pluralizer = $this->getPluralizer();
if ($fk->getRefPhpName()) {
return $plural ? $pluralizer->getPluralForm($fk->getRefPhpName()) : $fk->getRefPhpName();
}
$className = $fk->getTable()->getPhpName(... | php | public function getRefFKPhpNameAffix(ForeignKey $fk, $plural = false)
{
$pluralizer = $this->getPluralizer();
if ($fk->getRefPhpName()) {
return $plural ? $pluralizer->getPluralForm($fk->getRefPhpName()) : $fk->getRefPhpName();
}
$className = $fk->getTable()->getPhpName(... | [
"public",
"function",
"getRefFKPhpNameAffix",
"(",
"ForeignKey",
"$",
"fk",
",",
"$",
"plural",
"=",
"false",
")",
"{",
"$",
"pluralizer",
"=",
"$",
"this",
"->",
"getPluralizer",
"(",
")",
";",
"if",
"(",
"$",
"fk",
"->",
"getRefPhpName",
"(",
")",
")... | Gets the PHP method name affix to be used for referencing foreign key methods and variable names (e.g. set????(), $coll???).
The difference between this method and the getFKPhpNameAffix() method is that in this method the
classname in the affix is the classname of the local fkey table.
@param ForeignKey $fk The ... | [
"Gets",
"the",
"PHP",
"method",
"name",
"affix",
"to",
"be",
"used",
"for",
"referencing",
"foreign",
"key",
"methods",
"and",
"variable",
"names",
"(",
"e",
".",
"g",
".",
"set????",
"()",
"$coll???",
")",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L877-L890 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.hasBehaviorModifier | public function hasBehaviorModifier($hookName, $modifier)
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
if (method_exists($behavior->$modifierGetter(), $hookName)) {
return true;
}
}
return f... | php | public function hasBehaviorModifier($hookName, $modifier)
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
if (method_exists($behavior->$modifierGetter(), $hookName)) {
return true;
}
}
return f... | [
"public",
"function",
"hasBehaviorModifier",
"(",
"$",
"hookName",
",",
"$",
"modifier",
")",
"{",
"$",
"modifierGetter",
"=",
"'get'",
".",
"$",
"modifier",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getBehaviors",
"(",
")",
"a... | Checks whether any registered behavior on that table has a modifier for a hook
@param string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
@param string $modifier The name of the modifier object providing the method in the behavior
@return boolean | [
"Checks",
"whether",
"any",
"registered",
"behavior",
"on",
"that",
"table",
"has",
"a",
"modifier",
"for",
"a",
"hook"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L930-L940 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.applyBehaviorModifierBase | public function applyBehaviorModifierBase($hookName, $modifier, &$script, $tab = " ")
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
$modifier = $behavior->$modifierGetter();
if (method_exists($modifier, $hookName)) {
... | php | public function applyBehaviorModifierBase($hookName, $modifier, &$script, $tab = " ")
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
$modifier = $behavior->$modifierGetter();
if (method_exists($modifier, $hookName)) {
... | [
"public",
"function",
"applyBehaviorModifierBase",
"(",
"$",
"hookName",
",",
"$",
"modifier",
",",
"&",
"$",
"script",
",",
"$",
"tab",
"=",
"\" \"",
")",
"{",
"$",
"modifierGetter",
"=",
"'get'",
".",
"$",
"modifier",
";",
"foreach",
"(",
"$",
"... | Checks whether any registered behavior on that table has a modifier for a hook
@param string $hookName The name of the hook as called from one of this class methods, e.g. "preSave"
@param string $modifier The name of the modifier object providing the method in the behavior
@param string &$script The script will be mod... | [
"Checks",
"whether",
"any",
"registered",
"behavior",
"on",
"that",
"table",
"has",
"a",
"modifier",
"for",
"a",
"hook"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L948-L970 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.getBehaviorContentBase | public function getBehaviorContentBase($contentName, $modifier)
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
$modifier = $behavior->$modifierGetter();
if (method_exists($modifier, $contentName)) {
return $mo... | php | public function getBehaviorContentBase($contentName, $modifier)
{
$modifierGetter = 'get' . $modifier;
foreach ($this->getTable()->getBehaviors() as $behavior) {
$modifier = $behavior->$modifierGetter();
if (method_exists($modifier, $contentName)) {
return $mo... | [
"public",
"function",
"getBehaviorContentBase",
"(",
"$",
"contentName",
",",
"$",
"modifier",
")",
"{",
"$",
"modifierGetter",
"=",
"'get'",
".",
"$",
"modifier",
";",
"foreach",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getBehaviors",
"(",
")"... | Checks whether any registered behavior content creator on that table exists a contentName
@param string $contentName The name of the content as called from one of this class methods, e.g. "parentClassName"
@param string $modifier The name of the modifier object providing the method in the behavior | [
"Checks",
"whether",
"any",
"registered",
"behavior",
"content",
"creator",
"on",
"that",
"table",
"exists",
"a",
"contentName"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L977-L986 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.renderTemplate | public function renderTemplate($filename, $vars = [], $templateDir = '/templates/')
{
$filePath = __DIR__ . $templateDir . $filename;
if (!file_exists($filePath)) {
// try with '.php' at the end
$filePath = $filePath . '.php';
if (!file_exists($filePath)) {
... | php | public function renderTemplate($filename, $vars = [], $templateDir = '/templates/')
{
$filePath = __DIR__ . $templateDir . $filename;
if (!file_exists($filePath)) {
// try with '.php' at the end
$filePath = $filePath . '.php';
if (!file_exists($filePath)) {
... | [
"public",
"function",
"renderTemplate",
"(",
"$",
"filename",
",",
"$",
"vars",
"=",
"[",
"]",
",",
"$",
"templateDir",
"=",
"'/templates/'",
")",
"{",
"$",
"filePath",
"=",
"__DIR__",
".",
"$",
"templateDir",
".",
"$",
"filename",
";",
"if",
"(",
"!",... | Use Propel simple templating system to render a PHP file using variables
passed as arguments. The template file name is relative to the behavior's
directory name.
@param string $filename
@param array $vars
@param string $templateDir
@return string | [
"Use",
"Propel",
"simple",
"templating",
"system",
"to",
"render",
"a",
"PHP",
"file",
"using",
"variables",
"passed",
"as",
"arguments",
".",
"The",
"template",
"file",
"name",
"is",
"relative",
"to",
"the",
"behavior",
"s",
"directory",
"name",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L998-L1013 |
propelorm/Propel2 | src/Propel/Generator/Builder/Om/AbstractOMBuilder.php | AbstractOMBuilder.clean | private function clean($content)
{
// line feed
$content = str_replace("\r\n", "\n", $content);
// trailing whitespaces
$content = preg_replace('/[ \t]*$/m', '', $content);
// indentation
$content = preg_replace_callback('/^([ \t]+)/m', function ($matches) use ... | php | private function clean($content)
{
// line feed
$content = str_replace("\r\n", "\n", $content);
// trailing whitespaces
$content = preg_replace('/[ \t]*$/m', '', $content);
// indentation
$content = preg_replace_callback('/^([ \t]+)/m', function ($matches) use ... | [
"private",
"function",
"clean",
"(",
"$",
"content",
")",
"{",
"// line feed",
"$",
"content",
"=",
"str_replace",
"(",
"\"\\r\\n\"",
",",
"\"\\n\"",
",",
"$",
"content",
")",
";",
"// trailing whitespaces",
"$",
"content",
"=",
"preg_replace",
"(",
"'/[ \\t]*... | Most of the code comes from the PHP-CS-Fixer project
@param $content
@return mixed | [
"Most",
"of",
"the",
"code",
"comes",
"from",
"the",
"PHP",
"-",
"CS",
"-",
"Fixer",
"project"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Builder/Om/AbstractOMBuilder.php#L1029-L1064 |
propelorm/Propel2 | src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php | ProfilerConnectionWrapper.setAttribute | public function setAttribute($attribute, $value)
{
switch ($attribute) {
case 'isSlowOnly':
// Set whether the connection must only log slow queries.
// The slow threshold must be set on the profiler (100ms by default).
$this->isSlowOnly = $value;
... | php | public function setAttribute($attribute, $value)
{
switch ($attribute) {
case 'isSlowOnly':
// Set whether the connection must only log slow queries.
// The slow threshold must be set on the profiler (100ms by default).
$this->isSlowOnly = $value;
... | [
"public",
"function",
"setAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"attribute",
")",
"{",
"case",
"'isSlowOnly'",
":",
"// Set whether the connection must only log slow queries.",
"// The slow threshold must be set on the profiler ... | Overrides the parent setAttribute to support the isSlowOnly attribute.
@param string $attribute The attribute name, or the constant name containing the attribute name (e.g. 'PDO::ATTR_CASE')
@param mixed $value | [
"Overrides",
"the",
"parent",
"setAttribute",
"to",
"support",
"the",
"isSlowOnly",
"attribute",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php#L65-L76 |
propelorm/Propel2 | src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php | ProfilerConnectionWrapper.prepare | public function prepare($statement, $driver_options = null)
{
$this->getProfiler()->start();
return parent::prepare($statement, $driver_options);
} | php | public function prepare($statement, $driver_options = null)
{
$this->getProfiler()->start();
return parent::prepare($statement, $driver_options);
} | [
"public",
"function",
"prepare",
"(",
"$",
"statement",
",",
"$",
"driver_options",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getProfiler",
"(",
")",
"->",
"start",
"(",
")",
";",
"return",
"parent",
"::",
"prepare",
"(",
"$",
"statement",
",",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php#L81-L86 |
propelorm/Propel2 | src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php | ProfilerConnectionWrapper.log | public function log($msg)
{
if ($this->isSlowOnly && !$this->getProfiler()->isSlow()) {
return;
}
$msg = $this->getProfiler()->getProfile() . $msg;
return parent::log($msg);
} | php | public function log($msg)
{
if ($this->isSlowOnly && !$this->getProfiler()->isSlow()) {
return;
}
$msg = $this->getProfiler()->getProfile() . $msg;
return parent::log($msg);
} | [
"public",
"function",
"log",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSlowOnly",
"&&",
"!",
"$",
"this",
"->",
"getProfiler",
"(",
")",
"->",
"isSlow",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"msg",
"=",
"$",
"this",
"->... | {@inheritDoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Connection/ProfilerConnectionWrapper.php#L120-L128 |
propelorm/Propel2 | src/Propel/Generator/Command/GraphvizGenerateCommand.php | GraphvizGenerateCommand.configure | protected function configure()
{
parent::configure();
$this
->addOption('output-dir', null, InputOption::VALUE_REQUIRED, 'The output directory', self::DEFAULT_OUTPUT_DIRECTORY)
->addOption('schema-dir', null, InputOption::VALUE_REQUIRED, 'The directory where the schema... | php | protected function configure()
{
parent::configure();
$this
->addOption('output-dir', null, InputOption::VALUE_REQUIRED, 'The output directory', self::DEFAULT_OUTPUT_DIRECTORY)
->addOption('schema-dir', null, InputOption::VALUE_REQUIRED, 'The directory where the schema... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"parent",
"::",
"configure",
"(",
")",
";",
"$",
"this",
"->",
"addOption",
"(",
"'output-dir'",
",",
"null",
",",
"InputOption",
"::",
"VALUE_REQUIRED",
",",
"'The output directory'",
",",
"self",
"::",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/GraphvizGenerateCommand.php#L28-L39 |
propelorm/Propel2 | src/Propel/Generator/Command/GraphvizGenerateCommand.php | GraphvizGenerateCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$configOptions = [];
if ($this->hasInputOption('schema-dir', $input)){
$configOptions['propel']['paths']['schemaDir'] = $input->getOption('schema-dir');
}
$generatorConfig = $this->getGeneratorCo... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$configOptions = [];
if ($this->hasInputOption('schema-dir', $input)){
$configOptions['propel']['paths']['schemaDir'] = $input->getOption('schema-dir');
}
$generatorConfig = $this->getGeneratorCo... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"configOptions",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"hasInputOption",
"(",
"'schema-dir'",
",",
"$",
"input",
")",... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/GraphvizGenerateCommand.php#L44-L65 |
propelorm/Propel2 | src/Propel/Runtime/Connection/ConnectionManagerMasterSlave.php | ConnectionManagerMasterSlave.getWriteConnection | public function getWriteConnection(AdapterInterface $adapter = null)
{
if (null === $this->writeConnection) {
$this->writeConnection = ConnectionFactory::create($this->writeConfiguration, $adapter);
$this->writeConnection->setName($this->getName());
}
return $this->w... | php | public function getWriteConnection(AdapterInterface $adapter = null)
{
if (null === $this->writeConnection) {
$this->writeConnection = ConnectionFactory::create($this->writeConfiguration, $adapter);
$this->writeConnection->setName($this->getName());
}
return $this->w... | [
"public",
"function",
"getWriteConnection",
"(",
"AdapterInterface",
"$",
"adapter",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"writeConnection",
")",
"{",
"$",
"this",
"->",
"writeConnection",
"=",
"ConnectionFactory",
"::",
"create"... | Get a master connection.
If no master connection exist yet, open it using the write configuration.
@param \Propel\Runtime\Adapter\AdapterInterface $adapter
@return \Propel\Runtime\Connection\ConnectionInterface | [
"Get",
"a",
"master",
"connection",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Connection/ConnectionManagerMasterSlave.php#L140-L148 |
propelorm/Propel2 | src/Propel/Runtime/Connection/ConnectionManagerMasterSlave.php | ConnectionManagerMasterSlave.getReadConnection | public function getReadConnection(AdapterInterface $adapter = null)
{
if ($this->writeConnection && $this->writeConnection->inTransaction()) {
return $this->writeConnection;
}
if ($this->isForceMasterConnection()) {
return $this->getWriteConnection($adapter);
... | php | public function getReadConnection(AdapterInterface $adapter = null)
{
if ($this->writeConnection && $this->writeConnection->inTransaction()) {
return $this->writeConnection;
}
if ($this->isForceMasterConnection()) {
return $this->getWriteConnection($adapter);
... | [
"public",
"function",
"getReadConnection",
"(",
"AdapterInterface",
"$",
"adapter",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"writeConnection",
"&&",
"$",
"this",
"->",
"writeConnection",
"->",
"inTransaction",
"(",
")",
")",
"{",
"return",
"$",
... | Get a slave connection.
If no slave connection exist yet, choose one configuration randomly in the
read configuration to open it.
@param \Propel\Runtime\Adapter\AdapterInterface $adapter
@return \Propel\Runtime\Connection\ConnectionInterface | [
"Get",
"a",
"slave",
"connection",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Connection/ConnectionManagerMasterSlave.php#L160-L182 |
propelorm/Propel2 | src/Propel/Runtime/Parser/CsvParser.php | CsvParser.escape | protected function escape($input)
{
return str_replace(
$this->quotechar,
$this->escapechar . $this->quotechar,
$input
);
} | php | protected function escape($input)
{
return str_replace(
$this->quotechar,
$this->escapechar . $this->quotechar,
$input
);
} | [
"protected",
"function",
"escape",
"(",
"$",
"input",
")",
"{",
"return",
"str_replace",
"(",
"$",
"this",
"->",
"quotechar",
",",
"$",
"this",
"->",
"escapechar",
".",
"$",
"this",
"->",
"quotechar",
",",
"$",
"input",
")",
";",
"}"
] | Escapes a column (escapes quotechar with escapechar)
@param string $input A single value to be escaped for output
@return string Escaped input value | [
"Escapes",
"a",
"column",
"(",
"escapes",
"quotechar",
"with",
"escapechar",
")"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/CsvParser.php#L112-L119 |
propelorm/Propel2 | src/Propel/Runtime/Parser/CsvParser.php | CsvParser.toCSV | public function toCSV($array, $isList = false, $includeHeading = true)
{
return $this->fromArray($array, null, $isList, $includeHeading);
} | php | public function toCSV($array, $isList = false, $includeHeading = true)
{
return $this->fromArray($array, null, $isList, $includeHeading);
} | [
"public",
"function",
"toCSV",
"(",
"$",
"array",
",",
"$",
"isList",
"=",
"false",
",",
"$",
"includeHeading",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"fromArray",
"(",
"$",
"array",
",",
"null",
",",
"$",
"isList",
",",
"$",
"includeHea... | Alias for CsvParser::fromArray()
@param array $array Source data to convert
@param boolean $isList Whether the input data contains more than one row
@param boolean $includeHeading Whether the output should contain a heading line
@return string Converted data, as a CSV string | [
"Alias",
"for",
"CsvParser",
"::",
"fromArray",
"()"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/CsvParser.php#L170-L173 |
propelorm/Propel2 | src/Propel/Runtime/Parser/CsvParser.php | CsvParser.toArray | public function toArray($data, $rootKey = null, $isList = false, $includeHeading = true)
{
$rows = explode($this->lineTerminator, $data);
if ($includeHeading) {
$heading = array_shift($rows);
$keys = explode($this->delimiter, $heading);
} else {
$keys = ra... | php | public function toArray($data, $rootKey = null, $isList = false, $includeHeading = true)
{
$rows = explode($this->lineTerminator, $data);
if ($includeHeading) {
$heading = array_shift($rows);
$keys = explode($this->delimiter, $heading);
} else {
$keys = ra... | [
"public",
"function",
"toArray",
"(",
"$",
"data",
",",
"$",
"rootKey",
"=",
"null",
",",
"$",
"isList",
"=",
"false",
",",
"$",
"includeHeading",
"=",
"true",
")",
"{",
"$",
"rows",
"=",
"explode",
"(",
"$",
"this",
"->",
"lineTerminator",
",",
"$",... | Converts data from CSV to an associative array.
@param string $data Source data to convert, as a CSV string
@param string|null $rootKey Will not be used for converting because csv is flat
@param boolean $isList Whether the input data contains more than one row
@param boolean $includeHeading Whether the input contains ... | [
"Converts",
"data",
"from",
"CSV",
"to",
"an",
"associative",
"array",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/CsvParser.php#L185-L216 |
propelorm/Propel2 | src/Propel/Runtime/Parser/CsvParser.php | CsvParser.cleanupRow | protected function cleanupRow($row)
{
foreach ($row as $key => $column) {
if ($this->isQuoted($column)) {
$column = $this->unescape($this->unquote($column));
}
if ($this->isSerialized($column)) {
$column = $this->unserialize($column);
... | php | protected function cleanupRow($row)
{
foreach ($row as $key => $column) {
if ($this->isQuoted($column)) {
$column = $this->unescape($this->unquote($column));
}
if ($this->isSerialized($column)) {
$column = $this->unserialize($column);
... | [
"protected",
"function",
"cleanupRow",
"(",
"$",
"row",
")",
"{",
"foreach",
"(",
"$",
"row",
"as",
"$",
"key",
"=>",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isQuoted",
"(",
"$",
"column",
")",
")",
"{",
"$",
"column",
"=",
"$",
... | Accepts a formatted row of data and returns it raw
@param array $row An array of data from a CSV output
@return array The cleaned up array | [
"Accepts",
"a",
"formatted",
"row",
"of",
"data",
"and",
"returns",
"it",
"raw"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/Parser/CsvParser.php#L237-L253 |
propelorm/Propel2 | src/Propel/Generator/Model/ConstraintNameGenerator.php | ConstraintNameGenerator.generateName | public function generateName($inputs)
{
$db = $inputs[0];
$name = $inputs[1];
$namePostfix = $inputs[2];
$constraintNbr = (string) $inputs[3];
// Calculate maximum RDBMS-specific column character limit.
try {
$maxColumnNameLength = (... | php | public function generateName($inputs)
{
$db = $inputs[0];
$name = $inputs[1];
$namePostfix = $inputs[2];
$constraintNbr = (string) $inputs[3];
// Calculate maximum RDBMS-specific column character limit.
try {
$maxColumnNameLength = (... | [
"public",
"function",
"generateName",
"(",
"$",
"inputs",
")",
"{",
"$",
"db",
"=",
"$",
"inputs",
"[",
"0",
"]",
";",
"$",
"name",
"=",
"$",
"inputs",
"[",
"1",
"]",
";",
"$",
"namePostfix",
"=",
"$",
"inputs",
"[",
"2",
"]",
";",
"$",
"constr... | First element of <code>inputs</code> should be of type {@link Database}, second
should be a table name, third is the type identifier (spared if
trimming is necessary due to database type length constraints),
and the fourth is a <code>Integer</code> indicating the number
of this constraint.
@see NameGenerator
@param a... | [
"First",
"element",
"of",
"<code",
">",
"inputs<",
"/",
"code",
">",
"should",
"be",
"of",
"type",
"{",
"@link",
"Database",
"}",
"second",
"should",
"be",
"a",
"table",
"name",
"third",
"is",
"the",
"type",
"identifier",
"(",
"spared",
"if",
"trimming",... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/ConstraintNameGenerator.php#L43-L67 |
propelorm/Propel2 | src/Propel/Generator/Command/DatabaseReverseCommand.php | DatabaseReverseCommand.configure | protected function configure()
{
parent::configure();
$this
->addOption('output-dir', null, InputOption::VALUE_REQUIRED, 'The output directory', self::DEFAULT_OUTPUT_DIRECTORY)
->addOption('database-name', null, InputOption::VALUE_REQUIRED, 'The database name used in the ... | php | protected function configure()
{
parent::configure();
$this
->addOption('output-dir', null, InputOption::VALUE_REQUIRED, 'The output directory', self::DEFAULT_OUTPUT_DIRECTORY)
->addOption('database-name', null, InputOption::VALUE_REQUIRED, 'The database name used in the ... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"parent",
"::",
"configure",
"(",
")",
";",
"$",
"this",
"->",
"addOption",
"(",
"'output-dir'",
",",
"null",
",",
"InputOption",
"::",
"VALUE_REQUIRED",
",",
"'The output directory'",
",",
"self",
"::",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/DatabaseReverseCommand.php#L32-L51 |
propelorm/Propel2 | src/Propel/Generator/Command/DatabaseReverseCommand.php | DatabaseReverseCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$configOptions = [];
$connection = $input->getArgument('connection');
if (false === strpos($connection, ':')) {
//treat it as connection name
$configOptions['propel']['reverse']['connection'... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$configOptions = [];
$connection = $input->getArgument('connection');
if (false === strpos($connection, ':')) {
//treat it as connection name
$configOptions['propel']['reverse']['connection'... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"configOptions",
"=",
"[",
"]",
";",
"$",
"connection",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'connection'",
")",
";",
"i... | {@inheritdoc} | [
"{"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Command/DatabaseReverseCommand.php#L56-L103 |
propelorm/Propel2 | src/Propel/Generator/Model/MappingModel.php | MappingModel.booleanValue | protected function booleanValue($value)
{
if (is_bool($value)) {
return $value;
}
if (is_numeric($value)) {
return (Boolean) $value;
}
return in_array(strtolower($value), [ 'true', 't', 'y', 'yes' ], true);
} | php | protected function booleanValue($value)
{
if (is_bool($value)) {
return $value;
}
if (is_numeric($value)) {
return (Boolean) $value;
}
return in_array(strtolower($value), [ 'true', 't', 'y', 'yes' ], true);
} | [
"protected",
"function",
"booleanValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if",
"(",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"return",
"(",
"Boolean",
")"... | Converts a value (Boolean, string or numeric) into a Boolean value.
This is to support the default value when used with a boolean column.
@param mixed $value
@return boolean | [
"Converts",
"a",
"value",
"(",
"Boolean",
"string",
"or",
"numeric",
")",
"into",
"a",
"Boolean",
"value",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/MappingModel.php#L104-L115 |
propelorm/Propel2 | src/Propel/Generator/Model/MappingModel.php | MappingModel.getDefaultValueForSet | protected function getDefaultValueForSet($stringValue)
{
$stringValue = trim($stringValue);
if (empty($stringValue)) {
return null;
}
$values = [];
foreach (explode(',', $stringValue) as $v) {
$values[] = trim($v);
}
if (count($values... | php | protected function getDefaultValueForSet($stringValue)
{
$stringValue = trim($stringValue);
if (empty($stringValue)) {
return null;
}
$values = [];
foreach (explode(',', $stringValue) as $v) {
$values[] = trim($v);
}
if (count($values... | [
"protected",
"function",
"getDefaultValueForSet",
"(",
"$",
"stringValue",
")",
"{",
"$",
"stringValue",
"=",
"trim",
"(",
"$",
"stringValue",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"stringValue",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"values"... | Converts the default string for set columns to an array.
@param string $stringValue
@return array|null | [
"Converts",
"the",
"default",
"string",
"for",
"set",
"columns",
"to",
"an",
"array",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/MappingModel.php#L145-L161 |
propelorm/Propel2 | src/Propel/Generator/Model/MappingModel.php | MappingModel.addVendorInfo | public function addVendorInfo($vendor)
{
if ($vendor instanceof VendorInfo) {
$this->vendorInfos[$vendor->getType()] = $vendor;
return $vendor;
}
$vi = new VendorInfo();
$vi->loadMapping($vendor);
return $this->addVendorInfo($vi);
} | php | public function addVendorInfo($vendor)
{
if ($vendor instanceof VendorInfo) {
$this->vendorInfos[$vendor->getType()] = $vendor;
return $vendor;
}
$vi = new VendorInfo();
$vi->loadMapping($vendor);
return $this->addVendorInfo($vi);
} | [
"public",
"function",
"addVendorInfo",
"(",
"$",
"vendor",
")",
"{",
"if",
"(",
"$",
"vendor",
"instanceof",
"VendorInfo",
")",
"{",
"$",
"this",
"->",
"vendorInfos",
"[",
"$",
"vendor",
"->",
"getType",
"(",
")",
"]",
"=",
"$",
"vendor",
";",
"return"... | Adds a new VendorInfo instance to this current model object.
@param VendorInfo|array $vendor
@return VendorInfo | [
"Adds",
"a",
"new",
"VendorInfo",
"instance",
"to",
"this",
"current",
"model",
"object",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Generator/Model/MappingModel.php#L169-L181 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.condition | public function condition($conditionName, $clause, $value = null, $bindingType = null)
{
$this->addCond($conditionName, $this->getCriterionForClause($clause, $value, $bindingType), null, $bindingType);
return $this;
} | php | public function condition($conditionName, $clause, $value = null, $bindingType = null)
{
$this->addCond($conditionName, $this->getCriterionForClause($clause, $value, $bindingType), null, $bindingType);
return $this;
} | [
"public",
"function",
"condition",
"(",
"$",
"conditionName",
",",
"$",
"clause",
",",
"$",
"value",
"=",
"null",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addCond",
"(",
"$",
"conditionName",
",",
"$",
"this",
"->",
"getCrite... | Adds a condition on a column based on a pseudo SQL clause
but keeps it for later use with combine()
Until combine() is called, the condition is not added to the query
Uses introspection to translate the column phpName into a fully qualified name
<code>
$c->condition('cond1', 'b.Title = ?', 'foo');
</code>
@see Criteri... | [
"Adds",
"a",
"condition",
"on",
"a",
"column",
"based",
"on",
"a",
"pseudo",
"SQL",
"clause",
"but",
"keeps",
"it",
"for",
"later",
"use",
"with",
"combine",
"()",
"Until",
"combine",
"()",
"is",
"called",
"the",
"condition",
"is",
"not",
"added",
"to",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L108-L113 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.filterBy | public function filterBy($column, $value, $comparison = Criteria::EQUAL)
{
return $this->add($this->getRealColumnName($column), $value, $comparison);
} | php | public function filterBy($column, $value, $comparison = Criteria::EQUAL)
{
return $this->add($this->getRealColumnName($column), $value, $comparison);
} | [
"public",
"function",
"filterBy",
"(",
"$",
"column",
",",
"$",
"value",
",",
"$",
"comparison",
"=",
"Criteria",
"::",
"EQUAL",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"this",
"->",
"getRealColumnName",
"(",
"$",
"column",
")",
",",
... | Adds a condition on a column based on a column phpName and a value
Uses introspection to translate the column phpName into a fully qualified name
Warning: recognizes only the phpNames of the main Model (not joined tables)
<code>
$c->filterBy('Title', 'foo');
</code>
@see Criteria::add()
@param string $column A st... | [
"Adds",
"a",
"condition",
"on",
"a",
"column",
"based",
"on",
"a",
"column",
"phpName",
"and",
"a",
"value",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name",
"Warning",
":",
"recognizes",
"onl... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L131-L134 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.filterByArray | public function filterByArray($conditions)
{
foreach ($conditions as $column => $args) {
call_user_func_array([$this, 'filterBy' . $column], is_array($args) ? $args : [$args]);
}
return $this;
} | php | public function filterByArray($conditions)
{
foreach ($conditions as $column => $args) {
call_user_func_array([$this, 'filterBy' . $column], is_array($args) ? $args : [$args]);
}
return $this;
} | [
"public",
"function",
"filterByArray",
"(",
"$",
"conditions",
")",
"{",
"foreach",
"(",
"$",
"conditions",
"as",
"$",
"column",
"=>",
"$",
"args",
")",
"{",
"call_user_func_array",
"(",
"[",
"$",
"this",
",",
"'filterBy'",
".",
"$",
"column",
"]",
",",
... | Adds a list of conditions on the columns of the current model
Uses introspection to translate the column phpName into a fully qualified name
Warning: recognizes only the phpNames of the main Model (not joined tables)
<code>
$c->filterByArray(array(
'Title' => 'War And Peace',
'Publisher' => $publisher
));
</code>
... | [
"Adds",
"a",
"list",
"of",
"conditions",
"on",
"the",
"columns",
"of",
"the",
"current",
"model",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name",
"Warning",
":",
"recognizes",
"only",
"the",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L153-L160 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.where | public function where($clause, $value = null, $bindingType = null)
{
if (is_array($clause)) {
// where(array('cond1', 'cond2'), Criteria::LOGICAL_OR)
$criterion = $this->getCriterionForConditions($clause, $value);
} else {
// where('Book.AuthorId = ?', 12)
... | php | public function where($clause, $value = null, $bindingType = null)
{
if (is_array($clause)) {
// where(array('cond1', 'cond2'), Criteria::LOGICAL_OR)
$criterion = $this->getCriterionForConditions($clause, $value);
} else {
// where('Book.AuthorId = ?', 12)
... | [
"public",
"function",
"where",
"(",
"$",
"clause",
",",
"$",
"value",
"=",
"null",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clause",
")",
")",
"{",
"// where(array('cond1', 'cond2'), Criteria::LOGICAL_OR)",
"$",
"crit... | Adds a condition on a column based on a pseudo SQL clause
Uses introspection to translate the column phpName into a fully qualified name
<code>
// simple clause
$c->where('b.Title = ?', 'foo');
// named conditions
$c->condition('cond1', 'b.Title = ?', 'foo');
$c->condition('cond2', 'b.ISBN = ?', 12345);
$c->where(array... | [
"Adds",
"a",
"condition",
"on",
"a",
"column",
"based",
"on",
"a",
"pseudo",
"SQL",
"clause",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name",
"<code",
">",
"//",
"simple",
"clause",
"$c",
"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L182-L195 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.having | public function having($clause, $value = null, $bindingType = null)
{
if (is_array($clause)) {
// having(array('cond1', 'cond2'), Criteria::LOGICAL_OR)
$criterion = $this->getCriterionForConditions($clause, $value);
} else {
// having('Book.AuthorId = ?', 12)
... | php | public function having($clause, $value = null, $bindingType = null)
{
if (is_array($clause)) {
// having(array('cond1', 'cond2'), Criteria::LOGICAL_OR)
$criterion = $this->getCriterionForConditions($clause, $value);
} else {
// having('Book.AuthorId = ?', 12)
... | [
"public",
"function",
"having",
"(",
"$",
"clause",
",",
"$",
"value",
"=",
"null",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"clause",
")",
")",
"{",
"// having(array('cond1', 'cond2'), Criteria::LOGICAL_OR)",
"$",
"cr... | Adds a having condition on a column based on a pseudo SQL clause
Uses introspection to translate the column phpName into a fully qualified name
<code>
// simple clause
$c->having('b.Title = ?', 'foo');
// named conditions
$c->condition('cond1', 'b.Title = ?', 'foo');
$c->condition('cond2', 'b.ISBN = ?', 12345);
$c->hav... | [
"Adds",
"a",
"having",
"condition",
"on",
"a",
"column",
"based",
"on",
"a",
"pseudo",
"SQL",
"clause",
"Uses",
"introspection",
"to",
"translate",
"the",
"column",
"phpName",
"into",
"a",
"fully",
"qualified",
"name",
"<code",
">",
"//",
"simple",
"clause",... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L217-L230 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.orderBy | public function orderBy($columnName, $order = Criteria::ASC)
{
list(, $realColumnName) = $this->getColumnFromName($columnName, false);
$order = strtoupper($order);
switch ($order) {
case Criteria::ASC:
$this->addAscendingOrderByColumn($realColumnName);
... | php | public function orderBy($columnName, $order = Criteria::ASC)
{
list(, $realColumnName) = $this->getColumnFromName($columnName, false);
$order = strtoupper($order);
switch ($order) {
case Criteria::ASC:
$this->addAscendingOrderByColumn($realColumnName);
... | [
"public",
"function",
"orderBy",
"(",
"$",
"columnName",
",",
"$",
"order",
"=",
"Criteria",
"::",
"ASC",
")",
"{",
"list",
"(",
",",
"$",
"realColumnName",
")",
"=",
"$",
"this",
"->",
"getColumnFromName",
"(",
"$",
"columnName",
",",
"false",
")",
";... | Adds an ORDER BY clause to the query
Usability layer on top of Criteria::addAscendingOrderByColumn() and Criteria::addDescendingOrderByColumn()
Infers $column and $order from $columnName and some optional arguments
Examples:
$c->orderBy('Book.CreatedAt')
=> $c->addAscendingOrderByColumn(BookTableMap::CREATED_AT)
$c->or... | [
"Adds",
"an",
"ORDER",
"BY",
"clause",
"to",
"the",
"query",
"Usability",
"layer",
"on",
"top",
"of",
"Criteria",
"::",
"addAscendingOrderByColumn",
"()",
"and",
"Criteria",
"::",
"addDescendingOrderByColumn",
"()",
"Infers",
"$column",
"and",
"$order",
"from",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L247-L263 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.groupBy | public function groupBy($columnName)
{
if (empty($columnName)) {
throw new PropelException('You must ask for at least one column');
}
if (!is_array($columnName)) {
$columnName = array($columnName);
}
foreach ($columnName as $column) {
lis... | php | public function groupBy($columnName)
{
if (empty($columnName)) {
throw new PropelException('You must ask for at least one column');
}
if (!is_array($columnName)) {
$columnName = array($columnName);
}
foreach ($columnName as $column) {
lis... | [
"public",
"function",
"groupBy",
"(",
"$",
"columnName",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"columnName",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'You must ask for at least one column'",
")",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
... | Adds a GROUP BY clause to the query
Usability layer on top of Criteria::addGroupByColumn()
Infers $column $columnName
Examples:
$c->groupBy('Book.AuthorId')
=> $c->addGroupByColumn(BookTableMap::AUTHOR_ID)
$c->groupBy(array('Book.AuthorId', 'Book.AuthorName'))
=> $c->addGroupByColumn(BookTableMap::AUTHOR_ID)
=> $c->ad... | [
"Adds",
"a",
"GROUP",
"BY",
"clause",
"to",
"the",
"query",
"Usability",
"layer",
"on",
"top",
"of",
"Criteria",
"::",
"addGroupByColumn",
"()",
"Infers",
"$column",
"$columnName",
"Examples",
":",
"$c",
"-",
">",
"groupBy",
"(",
"Book",
".",
"AuthorId",
"... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L281-L297 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.select | public function select($columnArray)
{
if (empty($columnArray)) {
throw new PropelException('You must ask for at least one column');
}
if ('*' === $columnArray) {
$columnArray = [];
foreach (call_user_func([$this->modelTableMapName, 'getFieldNames'], Tabl... | php | public function select($columnArray)
{
if (empty($columnArray)) {
throw new PropelException('You must ask for at least one column');
}
if ('*' === $columnArray) {
$columnArray = [];
foreach (call_user_func([$this->modelTableMapName, 'getFieldNames'], Tabl... | [
"public",
"function",
"select",
"(",
"$",
"columnArray",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"columnArray",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"'You must ask for at least one column'",
")",
";",
"}",
"if",
"(",
"'*'",
"===",
"$",
"c... | Makes the ModelCriteria return a string, array, or ArrayCollection
Examples:
ArticleQuery::create()->select('Name')->find();
=> ArrayCollection Object ('Foo', 'Bar')
ArticleQuery::create()->select('Name')->findOne();
=> string 'Foo'
ArticleQuery::create()->select(array('Id', 'Name'))->find();
=> ArrayCollection Objec... | [
"Makes",
"the",
"ModelCriteria",
"return",
"a",
"string",
"array",
"or",
"ArrayCollection",
"Examples",
":",
"ArticleQuery",
"::",
"create",
"()",
"-",
">",
"select",
"(",
"Name",
")",
"-",
">",
"find",
"()",
";",
"=",
">",
"ArrayCollection",
"Object",
"("... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L400-L416 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.join | public function join($relation, $joinType = Criteria::INNER_JOIN)
{
// relation looks like '$leftName.$relationName $relationAlias'
list($fullName, $relationAlias) = self::getClassAndAlias($relation);
if (false === strpos($fullName, '.')) {
// simple relation name, refers to the ... | php | public function join($relation, $joinType = Criteria::INNER_JOIN)
{
// relation looks like '$leftName.$relationName $relationAlias'
list($fullName, $relationAlias) = self::getClassAndAlias($relation);
if (false === strpos($fullName, '.')) {
// simple relation name, refers to the ... | [
"public",
"function",
"join",
"(",
"$",
"relation",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"// relation looks like '$leftName.$relationName $relationAlias'",
"list",
"(",
"$",
"fullName",
",",
"$",
"relationAlias",
")",
"=",
"self",
"... | Adds a JOIN clause to the query
Infers the ON clause from a relation name
Uses the Propel table maps, based on the schema, to guess the related columns
Beware that the default JOIN operator is INNER JOIN, while Criteria defaults to WHERE
Examples:
<code>
$c->join('Book.Author');
=> $c->addJoin(BookTableMap::AUTHOR_ID, ... | [
"Adds",
"a",
"JOIN",
"clause",
"to",
"the",
"query",
"Infers",
"the",
"ON",
"clause",
"from",
"a",
"relation",
"name",
"Uses",
"the",
"Propel",
"table",
"maps",
"based",
"on",
"the",
"schema",
"to",
"guess",
"the",
"related",
"columns",
"Beware",
"that",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L472-L524 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addJoinCondition | public function addJoinCondition($name, $clause, $value = null, $operator = null, $bindingType = null)
{
if (!isset($this->joins[$name])) {
throw new PropelException(sprintf('Adding a condition to a nonexistent join, %s. Try calling join() first.', $name));
}
$join = $this->joins... | php | public function addJoinCondition($name, $clause, $value = null, $operator = null, $bindingType = null)
{
if (!isset($this->joins[$name])) {
throw new PropelException(sprintf('Adding a condition to a nonexistent join, %s. Try calling join() first.', $name));
}
$join = $this->joins... | [
"public",
"function",
"addJoinCondition",
"(",
"$",
"name",
",",
"$",
"clause",
",",
"$",
"value",
"=",
"null",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"bindingType",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"joi... | Add another condition to an already added join
@example
<code>
$query->join('Book.Author');
$query->addJoinCondition('Author', 'Book.Title LIKE ?', 'foo%');
</code>
@param string $name The relation name or alias on which the join was created
@param string $clause SQL clause, may contain column and table phpNames... | [
"Add",
"another",
"condition",
"to",
"an",
"already",
"added",
"join",
"@example",
"<code",
">",
"$query",
"-",
">",
"join",
"(",
"Book",
".",
"Author",
")",
";",
"$query",
"-",
">",
"addJoinCondition",
"(",
"Author",
"Book",
".",
"Title",
"LIKE",
"?",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L541-L555 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.setJoinCondition | public function setJoinCondition($name, $condition)
{
if (!isset($this->joins[$name])) {
throw new PropelException(sprintf('Setting a condition to a nonexistent join, %s. Try calling join() first.', $name));
}
if ($condition instanceof AbstractCriterion) {
$this->get... | php | public function setJoinCondition($name, $condition)
{
if (!isset($this->joins[$name])) {
throw new PropelException(sprintf('Setting a condition to a nonexistent join, %s. Try calling join() first.', $name));
}
if ($condition instanceof AbstractCriterion) {
$this->get... | [
"public",
"function",
"setJoinCondition",
"(",
"$",
"name",
",",
"$",
"condition",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"joins",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"sprintf",
"(",
"'Set... | Replace the condition of an already added join
@example
<code>
$query->join('Book.Author');
$query->condition('cond1', 'Book.AuthorId = Author.Id')
$query->condition('cond2', 'Book.Title LIKE ?', 'War%')
$query->combine(array('cond1', 'cond2'), 'and', 'cond3')
$query->setJoinCondition('Author', 'cond3');
</code>
@para... | [
"Replace",
"the",
"condition",
"of",
"an",
"already",
"added",
"join",
"@example",
"<code",
">",
"$query",
"-",
">",
"join",
"(",
"Book",
".",
"Author",
")",
";",
"$query",
"-",
">",
"condition",
"(",
"cond1",
"Book",
".",
"AuthorId",
"=",
"Author",
".... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L573-L588 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addJoinObject | public function addJoinObject(Join $join, $name = null)
{
if (!in_array($join, $this->joins)) { // compare equality, NOT identity
if (null === $name) {
$this->joins[] = $join;
} else {
$this->joins[$name] = $join;
}
}
retur... | php | public function addJoinObject(Join $join, $name = null)
{
if (!in_array($join, $this->joins)) { // compare equality, NOT identity
if (null === $name) {
$this->joins[] = $join;
} else {
$this->joins[$name] = $join;
}
}
retur... | [
"public",
"function",
"addJoinObject",
"(",
"Join",
"$",
"join",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"join",
",",
"$",
"this",
"->",
"joins",
")",
")",
"{",
"// compare equality, NOT identity",
"if",
"(",
"nul... | Add a join object to the Criteria
@see Criteria::addJoinObject()
@param Join $join A join object
@return $this|ModelCriteria The current object, for fluid interface | [
"Add",
"a",
"join",
"object",
"to",
"the",
"Criteria",
"@see",
"Criteria",
"::",
"addJoinObject",
"()",
"@param",
"Join",
"$join",
"A",
"join",
"object"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L597-L608 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.joinWith | public function joinWith($relation, $joinType = Criteria::INNER_JOIN)
{
$this->join($relation, $joinType);
$this->with(self::getRelationName($relation));
return $this;
} | php | public function joinWith($relation, $joinType = Criteria::INNER_JOIN)
{
$this->join($relation, $joinType);
$this->with(self::getRelationName($relation));
return $this;
} | [
"public",
"function",
"joinWith",
"(",
"$",
"relation",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"$",
"this",
"->",
"join",
"(",
"$",
"relation",
",",
"$",
"joinType",
")",
";",
"$",
"this",
"->",
"with",
"(",
"self",
"::"... | Adds a JOIN clause to the query and hydrates the related objects
Shortcut for $c->join()->with()
<code>
$c->joinWith('Book.Author');
=> $c->join('Book.Author');
=> $c->with('Author');
$c->joinWith('Book.Author a', Criteria::RIGHT_JOIN);
=> $c->join('Book.Author a', Criteria::RIGHT_JOIN);
=> $c->with('a');
</code>
@par... | [
"Adds",
"a",
"JOIN",
"clause",
"to",
"the",
"query",
"and",
"hydrates",
"the",
"related",
"objects",
"Shortcut",
"for",
"$c",
"-",
">",
"join",
"()",
"-",
">",
"with",
"()",
"<code",
">",
"$c",
"-",
">",
"joinWith",
"(",
"Book",
".",
"Author",
")",
... | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L627-L633 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.endUse | public function endUse()
{
if (isset($this->aliases[$this->modelAlias])) {
$this->removeAlias($this->modelAlias);
}
$primaryCriteria = $this->getPrimaryCriteria();
$primaryCriteria->mergeWith($this);
return $primaryCriteria;
} | php | public function endUse()
{
if (isset($this->aliases[$this->modelAlias])) {
$this->removeAlias($this->modelAlias);
}
$primaryCriteria = $this->getPrimaryCriteria();
$primaryCriteria->mergeWith($this);
return $primaryCriteria;
} | [
"public",
"function",
"endUse",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"aliases",
"[",
"$",
"this",
"->",
"modelAlias",
"]",
")",
")",
"{",
"$",
"this",
"->",
"removeAlias",
"(",
"$",
"this",
"->",
"modelAlias",
")",
";",
"}",
... | Finalizes a secondary criteria and merges it with its primary Criteria
@see Criteria::mergeWith()
@return ModelCriteria The primary criteria object | [
"Finalizes",
"a",
"secondary",
"criteria",
"and",
"merges",
"it",
"with",
"its",
"primary",
"Criteria"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L753-L763 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.mergeWith | public function mergeWith(Criteria $criteria, $operator = null)
{
parent::mergeWith($criteria, $operator);
// merge with
if ($criteria instanceof ModelCriteria) {
$this->with = array_merge($this->getWith(), $criteria->getWith());
}
return $this;
} | php | public function mergeWith(Criteria $criteria, $operator = null)
{
parent::mergeWith($criteria, $operator);
// merge with
if ($criteria instanceof ModelCriteria) {
$this->with = array_merge($this->getWith(), $criteria->getWith());
}
return $this;
} | [
"public",
"function",
"mergeWith",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"operator",
"=",
"null",
")",
"{",
"parent",
"::",
"mergeWith",
"(",
"$",
"criteria",
",",
"$",
"operator",
")",
";",
"// merge with",
"if",
"(",
"$",
"criteria",
"instanceof",
... | Add the content of a Criteria to the current Criteria
In case of conflict, the current Criteria keeps its properties
@see Criteria::mergeWith()
@param Criteria $criteria The criteria to read properties from
@param string $operator The logical operator used to combine conditions
Defaults to Criteria::LOGICAL_AND, als... | [
"Add",
"the",
"content",
"of",
"a",
"Criteria",
"to",
"the",
"current",
"Criteria",
"In",
"case",
"of",
"conflict",
"the",
"current",
"Criteria",
"keeps",
"its",
"properties",
"@see",
"Criteria",
"::",
"mergeWith",
"()"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L776-L786 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.clear | public function clear()
{
parent::clear();
$this->with = [];
$this->primaryCriteria = null;
$this->formatter = null;
$this->select = null;
return $this;
} | php | public function clear()
{
parent::clear();
$this->with = [];
$this->primaryCriteria = null;
$this->formatter = null;
$this->select = null;
return $this;
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"parent",
"::",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"with",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"primaryCriteria",
"=",
"null",
";",
"$",
"this",
"->",
"formatter",
"=",
"null",
";",
"$",
"t... | Clear the conditions to allow the reuse of the query object.
The ModelCriteria's Model and alias 'all the properties set by construct) will remain.
@return $this|ModelCriteria The primary criteria object | [
"Clear",
"the",
"conditions",
"to",
"allow",
"the",
"reuse",
"of",
"the",
"query",
"object",
".",
"The",
"ModelCriteria",
"s",
"Model",
"and",
"alias",
"all",
"the",
"properties",
"set",
"by",
"construct",
")",
"will",
"remain",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L794-L804 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.setPrimaryCriteria | public function setPrimaryCriteria(ModelCriteria $criteria, Join $previousJoin)
{
$this->primaryCriteria = $criteria;
$this->setPreviousJoin($previousJoin);
} | php | public function setPrimaryCriteria(ModelCriteria $criteria, Join $previousJoin)
{
$this->primaryCriteria = $criteria;
$this->setPreviousJoin($previousJoin);
} | [
"public",
"function",
"setPrimaryCriteria",
"(",
"ModelCriteria",
"$",
"criteria",
",",
"Join",
"$",
"previousJoin",
")",
"{",
"$",
"this",
"->",
"primaryCriteria",
"=",
"$",
"criteria",
";",
"$",
"this",
"->",
"setPreviousJoin",
"(",
"$",
"previousJoin",
")",... | Sets the primary Criteria for this secondary Criteria
@param ModelCriteria $criteria The primary criteria
@param Join $previousJoin The previousJoin for this ModelCriteria | [
"Sets",
"the",
"primary",
"Criteria",
"for",
"this",
"secondary",
"Criteria"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L811-L815 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addSelectQuery | public function addSelectQuery(Criteria $subQueryCriteria, $alias = null, $addAliasAndSelectColumns = true)
{
if (!$subQueryCriteria->hasSelectClause()) {
$subQueryCriteria->addSelfSelectColumns();
}
parent::addSelectQuery($subQueryCriteria, $alias);
if ($addAliasAndSel... | php | public function addSelectQuery(Criteria $subQueryCriteria, $alias = null, $addAliasAndSelectColumns = true)
{
if (!$subQueryCriteria->hasSelectClause()) {
$subQueryCriteria->addSelfSelectColumns();
}
parent::addSelectQuery($subQueryCriteria, $alias);
if ($addAliasAndSel... | [
"public",
"function",
"addSelectQuery",
"(",
"Criteria",
"$",
"subQueryCriteria",
",",
"$",
"alias",
"=",
"null",
",",
"$",
"addAliasAndSelectColumns",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"subQueryCriteria",
"->",
"hasSelectClause",
"(",
")",
")",
"{... | Adds a Criteria as subQuery in the From Clause.
@see Criteria::addSelectQuery()
@param Criteria $subQueryCriteria Criteria to build the subquery from
@param string $alias alias for the subQuery
@param boolean $addAliasAndSelectColumns Set to false if you want to manually add the aliased ... | [
"Adds",
"a",
"Criteria",
"as",
"subQuery",
"in",
"the",
"From",
"Clause",
"."
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L838-L858 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addSelfSelectColumns | public function addSelfSelectColumns($force = false)
{
if ($this->isSelfSelected && !$force) {
return $this;
}
$tableMap = $this->modelTableMapName;
$tableMap::addSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null);
$this->isSelfSelected = true;... | php | public function addSelfSelectColumns($force = false)
{
if ($this->isSelfSelected && !$force) {
return $this;
}
$tableMap = $this->modelTableMapName;
$tableMap::addSelectColumns($this, $this->useAliasInSQL ? $this->modelAlias : null);
$this->isSelfSelected = true;... | [
"public",
"function",
"addSelfSelectColumns",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSelfSelected",
"&&",
"!",
"$",
"force",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"tableMap",
"=",
"$",
"this",
"->",
"mod... | Adds the select columns for the current table
@param bool $force To enforce adding columns for changed alias, set it to true (f.e. with sub selects)
@return $this|ModelCriteria The current object, for fluid interface | [
"Adds",
"the",
"select",
"columns",
"for",
"the",
"current",
"table"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L866-L877 |
propelorm/Propel2 | src/Propel/Runtime/ActiveQuery/ModelCriteria.php | ModelCriteria.addRelationSelectColumns | public function addRelationSelectColumns($relation)
{
$join = $this->joins[$relation];
$join->getTableMap()->addSelectColumns($this, $join->getRelationAlias());
return $this;
} | php | public function addRelationSelectColumns($relation)
{
$join = $this->joins[$relation];
$join->getTableMap()->addSelectColumns($this, $join->getRelationAlias());
return $this;
} | [
"public",
"function",
"addRelationSelectColumns",
"(",
"$",
"relation",
")",
"{",
"$",
"join",
"=",
"$",
"this",
"->",
"joins",
"[",
"$",
"relation",
"]",
";",
"$",
"join",
"->",
"getTableMap",
"(",
")",
"->",
"addSelectColumns",
"(",
"$",
"this",
",",
... | Adds the select columns for a relation
@param string $relation The relation name or alias, as defined in join()
@return $this|ModelCriteria The current object, for fluid interface | [
"Adds",
"the",
"select",
"columns",
"for",
"a",
"relation"
] | train | https://github.com/propelorm/Propel2/blob/6c4996fc130c7555d82d9dca04396c6f3eeef306/src/Propel/Runtime/ActiveQuery/ModelCriteria.php#L886-L892 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.