id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
211,000 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._recoverTree | protected function _recoverTree($counter = 0, $parentId = null, $level = -1)
{
$config = $this->getConfig();
list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
$primaryKey = $this->_getPrimaryKey();
$aliasedPrimaryKey = $this->_table->aliasField($p... | php | protected function _recoverTree($counter = 0, $parentId = null, $level = -1)
{
$config = $this->getConfig();
list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
$primaryKey = $this->_getPrimaryKey();
$aliasedPrimaryKey = $this->_table->aliasField($p... | [
"protected",
"function",
"_recoverTree",
"(",
"$",
"counter",
"=",
"0",
",",
"$",
"parentId",
"=",
"null",
",",
"$",
"level",
"=",
"-",
"1",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"list",
"(",
"$",
"parent",
... | Recursive method used to recover a single level of the tree
@param int $counter The Last left column value that was assigned
@param mixed $parentId the parent id of the level to be recovered
@param int $level Node level
@return int The next value to use for the left column | [
"Recursive",
"method",
"used",
"to",
"recover",
"a",
"single",
"level",
"of",
"the",
"tree"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L828-L864 |
211,001 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._getMax | protected function _getMax()
{
$field = $this->_config['right'];
$rightField = $this->_config['rightField'];
$edge = $this->_scope($this->_table->find())
->select([$field])
->orderDesc($rightField)
->first();
if (empty($edge->{$field})) {
... | php | protected function _getMax()
{
$field = $this->_config['right'];
$rightField = $this->_config['rightField'];
$edge = $this->_scope($this->_table->find())
->select([$field])
->orderDesc($rightField)
->first();
if (empty($edge->{$field})) {
... | [
"protected",
"function",
"_getMax",
"(",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"_config",
"[",
"'right'",
"]",
";",
"$",
"rightField",
"=",
"$",
"this",
"->",
"_config",
"[",
"'rightField'",
"]",
";",
"$",
"edge",
"=",
"$",
"this",
"->",
... | Returns the maximum index value in the table.
@return int | [
"Returns",
"the",
"maximum",
"index",
"value",
"in",
"the",
"table",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L871-L885 |
211,002 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._sync | protected function _sync($shift, $dir, $conditions, $mark = false)
{
$config = $this->_config;
foreach ([$config['leftField'], $config['rightField']] as $field) {
$query = $this->_scope($this->_table->query());
$exp = $query->newExpr();
$movement = clone $exp;
... | php | protected function _sync($shift, $dir, $conditions, $mark = false)
{
$config = $this->_config;
foreach ([$config['leftField'], $config['rightField']] as $field) {
$query = $this->_scope($this->_table->query());
$exp = $query->newExpr();
$movement = clone $exp;
... | [
"protected",
"function",
"_sync",
"(",
"$",
"shift",
",",
"$",
"dir",
",",
"$",
"conditions",
",",
"$",
"mark",
"=",
"false",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"_config",
";",
"foreach",
"(",
"[",
"$",
"config",
"[",
"'leftField'",
"... | Auxiliary function used to automatically alter the value of both the left and
right columns by a certain amount that match the passed conditions
@param int $shift the value to use for operating the left and right columns
@param string $dir The operator to use for shifting the value (+/-)
@param string $conditions a SQ... | [
"Auxiliary",
"function",
"used",
"to",
"automatically",
"alter",
"the",
"value",
"of",
"both",
"the",
"left",
"and",
"right",
"columns",
"by",
"a",
"certain",
"amount",
"that",
"match",
"the",
"passed",
"conditions"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L899-L924 |
211,003 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._scope | protected function _scope($query)
{
$scope = $this->getConfig('scope');
if (is_array($scope)) {
return $query->where($scope);
}
if (is_callable($scope)) {
return $scope($query);
}
return $query;
} | php | protected function _scope($query)
{
$scope = $this->getConfig('scope');
if (is_array($scope)) {
return $query->where($scope);
}
if (is_callable($scope)) {
return $scope($query);
}
return $query;
} | [
"protected",
"function",
"_scope",
"(",
"$",
"query",
")",
"{",
"$",
"scope",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'scope'",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"scope",
")",
")",
"{",
"return",
"$",
"query",
"->",
"where",
"(",
"$",
... | Alters the passed query so that it only returns scoped records as defined
in the tree configuration.
@param \Cake\ORM\Query $query the Query to modify
@return \Cake\ORM\Query | [
"Alters",
"the",
"passed",
"query",
"so",
"that",
"it",
"only",
"returns",
"scoped",
"records",
"as",
"defined",
"in",
"the",
"tree",
"configuration",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L933-L945 |
211,004 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._ensureFields | protected function _ensureFields($entity)
{
$config = $this->getConfig();
$fields = [$config['left'], $config['right']];
$values = array_filter($entity->extract($fields));
if (count($values) === count($fields)) {
return;
}
$fresh = $this->_table->get($ent... | php | protected function _ensureFields($entity)
{
$config = $this->getConfig();
$fields = [$config['left'], $config['right']];
$values = array_filter($entity->extract($fields));
if (count($values) === count($fields)) {
return;
}
$fresh = $this->_table->get($ent... | [
"protected",
"function",
"_ensureFields",
"(",
"$",
"entity",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"fields",
"=",
"[",
"$",
"config",
"[",
"'left'",
"]",
",",
"$",
"config",
"[",
"'right'",
"]",
"]",
";"... | Ensures that the provided entity contains non-empty values for the left and
right fields
@param \Cake\Datasource\EntityInterface $entity The entity to ensure fields for
@return void | [
"Ensures",
"that",
"the",
"provided",
"entity",
"contains",
"non",
"-",
"empty",
"values",
"for",
"the",
"left",
"and",
"right",
"fields"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L954-L969 |
211,005 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior._getPrimaryKey | protected function _getPrimaryKey()
{
if (!$this->_primaryKey) {
$primaryKey = (array)$this->_table->getPrimaryKey();
$this->_primaryKey = $primaryKey[0];
}
return $this->_primaryKey;
} | php | protected function _getPrimaryKey()
{
if (!$this->_primaryKey) {
$primaryKey = (array)$this->_table->getPrimaryKey();
$this->_primaryKey = $primaryKey[0];
}
return $this->_primaryKey;
} | [
"protected",
"function",
"_getPrimaryKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_primaryKey",
")",
"{",
"$",
"primaryKey",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"_table",
"->",
"getPrimaryKey",
"(",
")",
";",
"$",
"this",
"->",
"_p... | Returns a single string value representing the primary key of the attached table
@return string | [
"Returns",
"a",
"single",
"string",
"value",
"representing",
"the",
"primary",
"key",
"of",
"the",
"attached",
"table"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L976-L984 |
211,006 | cakephp/cakephp | src/ORM/Behavior/TreeBehavior.php | TreeBehavior.getLevel | public function getLevel($entity)
{
$primaryKey = $this->_getPrimaryKey();
$id = $entity;
if ($entity instanceof EntityInterface) {
$id = $entity->get($primaryKey);
}
$config = $this->getConfig();
$entity = $this->_table->find('all')
->select([... | php | public function getLevel($entity)
{
$primaryKey = $this->_getPrimaryKey();
$id = $entity;
if ($entity instanceof EntityInterface) {
$id = $entity->get($primaryKey);
}
$config = $this->getConfig();
$entity = $this->_table->find('all')
->select([... | [
"public",
"function",
"getLevel",
"(",
"$",
"entity",
")",
"{",
"$",
"primaryKey",
"=",
"$",
"this",
"->",
"_getPrimaryKey",
"(",
")",
";",
"$",
"id",
"=",
"$",
"entity",
";",
"if",
"(",
"$",
"entity",
"instanceof",
"EntityInterface",
")",
"{",
"$",
... | Returns the depth level of a node in the tree.
@param int|string|\Cake\Datasource\EntityInterface $entity The entity or primary key get the level of.
@return int|bool Integer of the level or false if the node does not exist. | [
"Returns",
"the",
"depth",
"level",
"of",
"a",
"node",
"in",
"the",
"tree",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TreeBehavior.php#L992-L1015 |
211,007 | cakephp/cakephp | src/Database/Query.php | Query.connection | public function connection($connection = null)
{
deprecationWarning(
'Query::connection() is deprecated. ' .
'Use Query::setConnection()/getConnection() instead.'
);
if ($connection !== null) {
return $this->setConnection($connection);
}
r... | php | public function connection($connection = null)
{
deprecationWarning(
'Query::connection() is deprecated. ' .
'Use Query::setConnection()/getConnection() instead.'
);
if ($connection !== null) {
return $this->setConnection($connection);
}
r... | [
"public",
"function",
"connection",
"(",
"$",
"connection",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'Query::connection() is deprecated. '",
".",
"'Use Query::setConnection()/getConnection() instead.'",
")",
";",
"if",
"(",
"$",
"connection",
"!==",
"null",
")... | Sets the connection instance to be used for executing and transforming this query
When called with a null argument, it will return the current connection instance.
@deprecated 3.4.0 Use setConnection()/getConnection() instead.
@param \Cake\Database\Connection|null $connection Connection instance
@return $this|\Cake\Da... | [
"Sets",
"the",
"connection",
"instance",
"to",
"be",
"used",
"for",
"executing",
"and",
"transforming",
"this",
"query",
"When",
"called",
"with",
"a",
"null",
"argument",
"it",
"will",
"return",
"the",
"current",
"connection",
"instance",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L184-L195 |
211,008 | cakephp/cakephp | src/Database/Query.php | Query.execute | public function execute()
{
$statement = $this->_connection->run($this);
$this->_iterator = $this->_decorateStatement($statement);
$this->_dirty = false;
return $this->_iterator;
} | php | public function execute()
{
$statement = $this->_connection->run($this);
$this->_iterator = $this->_decorateStatement($statement);
$this->_dirty = false;
return $this->_iterator;
} | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"_connection",
"->",
"run",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"_iterator",
"=",
"$",
"this",
"->",
"_decorateStatement",
"(",
"$",
"statement",
")",
... | Compiles the SQL representation of this query and executes it using the
configured connection object. Returns the resulting statement object.
Executing a query internally executes several steps, the first one is
letting the connection transform this object to fit its particular dialect,
this might result in generating... | [
"Compiles",
"the",
"SQL",
"representation",
"of",
"this",
"query",
"and",
"executes",
"it",
"using",
"the",
"configured",
"connection",
"object",
".",
"Returns",
"the",
"resulting",
"statement",
"object",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L217-L224 |
211,009 | cakephp/cakephp | src/Database/Query.php | Query.sql | public function sql(ValueBinder $generator = null)
{
if (!$generator) {
$generator = $this->getValueBinder();
$generator->resetCount();
}
return $this->getConnection()->compileQuery($this, $generator);
} | php | public function sql(ValueBinder $generator = null)
{
if (!$generator) {
$generator = $this->getValueBinder();
$generator->resetCount();
}
return $this->getConnection()->compileQuery($this, $generator);
} | [
"public",
"function",
"sql",
"(",
"ValueBinder",
"$",
"generator",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"generator",
")",
"{",
"$",
"generator",
"=",
"$",
"this",
"->",
"getValueBinder",
"(",
")",
";",
"$",
"generator",
"->",
"resetCount",
"(",
... | Returns the SQL representation of this object.
This function will compile this query to make it compatible
with the SQL dialect that is used by the connection, This process might
add, remove or alter any query part or internal expression to make it
executable in the target platform.
The resulting query may have place... | [
"Returns",
"the",
"SQL",
"representation",
"of",
"this",
"object",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L273-L281 |
211,010 | cakephp/cakephp | src/Database/Query.php | Query.traverse | public function traverse(callable $visitor, array $parts = [])
{
$parts = $parts ?: array_keys($this->_parts);
foreach ($parts as $name) {
$visitor($this->_parts[$name], $name);
}
return $this;
} | php | public function traverse(callable $visitor, array $parts = [])
{
$parts = $parts ?: array_keys($this->_parts);
foreach ($parts as $name) {
$visitor($this->_parts[$name], $name);
}
return $this;
} | [
"public",
"function",
"traverse",
"(",
"callable",
"$",
"visitor",
",",
"array",
"$",
"parts",
"=",
"[",
"]",
")",
"{",
"$",
"parts",
"=",
"$",
"parts",
"?",
":",
"array_keys",
"(",
"$",
"this",
"->",
"_parts",
")",
";",
"foreach",
"(",
"$",
"parts... | Will iterate over every specified part. Traversing functions can aggregate
results using variables in the closure or instance variables. This function
is commonly used as a way for traversing all query parts that
are going to be used for constructing a query.
The callback will receive 2 parameters, the first one is th... | [
"Will",
"iterate",
"over",
"every",
"specified",
"part",
".",
"Traversing",
"functions",
"can",
"aggregate",
"results",
"using",
"variables",
"in",
"the",
"closure",
"or",
"instance",
"variables",
".",
"This",
"function",
"is",
"commonly",
"used",
"as",
"a",
"... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L305-L313 |
211,011 | cakephp/cakephp | src/Database/Query.php | Query.distinct | public function distinct($on = [], $overwrite = false)
{
if ($on === []) {
$on = true;
} elseif (is_string($on)) {
$on = [$on];
}
if (is_array($on)) {
$merge = [];
if (is_array($this->_parts['distinct'])) {
$merge = $th... | php | public function distinct($on = [], $overwrite = false)
{
if ($on === []) {
$on = true;
} elseif (is_string($on)) {
$on = [$on];
}
if (is_array($on)) {
$merge = [];
if (is_array($this->_parts['distinct'])) {
$merge = $th... | [
"public",
"function",
"distinct",
"(",
"$",
"on",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"on",
"===",
"[",
"]",
")",
"{",
"$",
"on",
"=",
"true",
";",
"}",
"elseif",
"(",
"is_string",
"(",
"$",
"on",
")"... | Adds a `DISTINCT` clause to the query to remove duplicates from the result set.
This clause can only be used for select statements.
If you wish to filter duplicates based of those rows sharing a particular field
or set of fields, you may pass an array of fields to filter on. Beware that
this option might not be fully ... | [
"Adds",
"a",
"DISTINCT",
"clause",
"to",
"the",
"query",
"to",
"remove",
"duplicates",
"from",
"the",
"result",
"set",
".",
"This",
"clause",
"can",
"only",
"be",
"used",
"for",
"select",
"statements",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L400-L420 |
211,012 | cakephp/cakephp | src/Database/Query.php | Query.modifier | public function modifier($modifiers, $overwrite = false)
{
$this->_dirty();
if ($overwrite) {
$this->_parts['modifier'] = [];
}
$this->_parts['modifier'] = array_merge($this->_parts['modifier'], (array)$modifiers);
return $this;
} | php | public function modifier($modifiers, $overwrite = false)
{
$this->_dirty();
if ($overwrite) {
$this->_parts['modifier'] = [];
}
$this->_parts['modifier'] = array_merge($this->_parts['modifier'], (array)$modifiers);
return $this;
} | [
"public",
"function",
"modifier",
"(",
"$",
"modifiers",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_dirty",
"(",
")",
";",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_parts",
"[",
"'modifier'",
"]",
"=",
"["... | Adds a single or multiple `SELECT` modifiers to be used in the `SELECT`.
By default this function will append any passed argument to the list of modifiers
to be applied, unless the second argument is set to true.
### Example:
```
// Ignore cache query in MySQL
$query->select(['name', 'city'])->from('products')->modi... | [
"Adds",
"a",
"single",
"or",
"multiple",
"SELECT",
"modifiers",
"to",
"be",
"used",
"in",
"the",
"SELECT",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L444-L453 |
211,013 | cakephp/cakephp | src/Database/Query.php | Query.from | public function from($tables = [], $overwrite = false)
{
if (empty($tables)) {
deprecationWarning('Using Query::from() to read state is deprecated. Use clause("from") instead.');
return $this->_parts['from'];
}
$tables = (array)$tables;
if ($overwrite) {
... | php | public function from($tables = [], $overwrite = false)
{
if (empty($tables)) {
deprecationWarning('Using Query::from() to read state is deprecated. Use clause("from") instead.');
return $this->_parts['from'];
}
$tables = (array)$tables;
if ($overwrite) {
... | [
"public",
"function",
"from",
"(",
"$",
"tables",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"tables",
")",
")",
"{",
"deprecationWarning",
"(",
"'Using Query::from() to read state is deprecated. Use clause(\"from... | Adds a single or multiple tables to be used in the FROM clause for this query.
Tables can be passed as an array of strings, array of expression
objects, a single expression or a single string.
If an array is passed, keys will be used to alias tables using the value as the
real field to be aliased. It is possible to al... | [
"Adds",
"a",
"single",
"or",
"multiple",
"tables",
"to",
"be",
"used",
"in",
"the",
"FROM",
"clause",
"for",
"this",
"query",
".",
"Tables",
"can",
"be",
"passed",
"as",
"an",
"array",
"of",
"strings",
"array",
"of",
"expression",
"objects",
"a",
"single... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L484-L503 |
211,014 | cakephp/cakephp | src/Database/Query.php | Query.join | public function join($tables = null, $types = [], $overwrite = false)
{
if ($tables === null) {
deprecationWarning('Using Query::join() to read state is deprecated. Use clause("join") instead.');
return $this->_parts['join'];
}
if (is_string($tables) || isset($table... | php | public function join($tables = null, $types = [], $overwrite = false)
{
if ($tables === null) {
deprecationWarning('Using Query::join() to read state is deprecated. Use clause("join") instead.');
return $this->_parts['join'];
}
if (is_string($tables) || isset($table... | [
"public",
"function",
"join",
"(",
"$",
"tables",
"=",
"null",
",",
"$",
"types",
"=",
"[",
"]",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"tables",
"===",
"null",
")",
"{",
"deprecationWarning",
"(",
"'Using Query::join() to read st... | Adds a single or multiple tables to be used as JOIN clauses to this query.
Tables can be passed as an array of strings, an array describing the
join parts, an array with multiple join descriptions, or a single string.
By default this function will append any passed argument to the list of tables
to be joined, unless t... | [
"Adds",
"a",
"single",
"or",
"multiple",
"tables",
"to",
"be",
"used",
"as",
"JOIN",
"clauses",
"to",
"this",
"query",
".",
"Tables",
"can",
"be",
"passed",
"as",
"an",
"array",
"of",
"strings",
"an",
"array",
"describing",
"the",
"join",
"parts",
"an",
... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L591-L630 |
211,015 | cakephp/cakephp | src/Database/Query.php | Query.leftJoin | public function leftJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_LEFT), $types);
} | php | public function leftJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_LEFT), $types);
} | [
"public",
"function",
"leftJoin",
"(",
"$",
"table",
",",
"$",
"conditions",
"=",
"[",
"]",
",",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"join",
"(",
"$",
"this",
"->",
"_makeJoin",
"(",
"$",
"table",
",",
"$",
"condit... | Adds a single `LEFT JOIN` clause to the query.
This is a shorthand method for building joins via `join()`.
The table name can be passed as a string, or as an array in case it needs to
be aliased:
```
// LEFT JOIN authors ON authors.id = posts.author_id
$query->leftJoin('authors', 'authors.id = posts.author_id');
//... | [
"Adds",
"a",
"single",
"LEFT",
"JOIN",
"clause",
"to",
"the",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L686-L689 |
211,016 | cakephp/cakephp | src/Database/Query.php | Query.rightJoin | public function rightJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_RIGHT), $types);
} | php | public function rightJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_RIGHT), $types);
} | [
"public",
"function",
"rightJoin",
"(",
"$",
"table",
",",
"$",
"conditions",
"=",
"[",
"]",
",",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"join",
"(",
"$",
"this",
"->",
"_makeJoin",
"(",
"$",
"table",
",",
"$",
"condi... | Adds a single `RIGHT JOIN` clause to the query.
This is a shorthand method for building joins via `join()`.
The arguments of this method are identical to the `leftJoin()` shorthand, please refer
to that methods description for further details.
@param string|array $table The table to join with
@param string|array|\Ca... | [
"Adds",
"a",
"single",
"RIGHT",
"JOIN",
"clause",
"to",
"the",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L706-L709 |
211,017 | cakephp/cakephp | src/Database/Query.php | Query.innerJoin | public function innerJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_INNER), $types);
} | php | public function innerJoin($table, $conditions = [], $types = [])
{
return $this->join($this->_makeJoin($table, $conditions, QueryInterface::JOIN_TYPE_INNER), $types);
} | [
"public",
"function",
"innerJoin",
"(",
"$",
"table",
",",
"$",
"conditions",
"=",
"[",
"]",
",",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"join",
"(",
"$",
"this",
"->",
"_makeJoin",
"(",
"$",
"table",
",",
"$",
"condi... | Adds a single `INNER JOIN` clause to the query.
This is a shorthand method for building joins via `join()`.
The arguments of this method are identical to the `leftJoin()` shorthand, please refer
to that methods description for further details.
@param string|array $table The table to join with
@param string|array|\Ca... | [
"Adds",
"a",
"single",
"INNER",
"JOIN",
"clause",
"to",
"the",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L726-L729 |
211,018 | cakephp/cakephp | src/Database/Query.php | Query._makeJoin | protected function _makeJoin($table, $conditions, $type)
{
$alias = $table;
if (is_array($table)) {
$alias = key($table);
$table = current($table);
}
return [
$alias => [
'table' => $table,
'conditions' => $conditi... | php | protected function _makeJoin($table, $conditions, $type)
{
$alias = $table;
if (is_array($table)) {
$alias = key($table);
$table = current($table);
}
return [
$alias => [
'table' => $table,
'conditions' => $conditi... | [
"protected",
"function",
"_makeJoin",
"(",
"$",
"table",
",",
"$",
"conditions",
",",
"$",
"type",
")",
"{",
"$",
"alias",
"=",
"$",
"table",
";",
"if",
"(",
"is_array",
"(",
"$",
"table",
")",
")",
"{",
"$",
"alias",
"=",
"key",
"(",
"$",
"table... | Returns an array that can be passed to the join method describing a single join clause
@param string|array $table The table to join with
@param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
to use for joining.
@param string $type the join type to use
@return array | [
"Returns",
"an",
"array",
"that",
"can",
"be",
"passed",
"to",
"the",
"join",
"method",
"describing",
"a",
"single",
"join",
"clause"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L740-L756 |
211,019 | cakephp/cakephp | src/Database/Query.php | Query.whereNotNull | public function whereNotNull($fields)
{
if (!is_array($fields)) {
$fields = [$fields];
}
$exp = $this->newExpr();
foreach ($fields as $field) {
$exp->isNotNull($field);
}
return $this->where($exp);
} | php | public function whereNotNull($fields)
{
if (!is_array($fields)) {
$fields = [$fields];
}
$exp = $this->newExpr();
foreach ($fields as $field) {
$exp->isNotNull($field);
}
return $this->where($exp);
} | [
"public",
"function",
"whereNotNull",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"fields",
"=",
"[",
"$",
"fields",
"]",
";",
"}",
"$",
"exp",
"=",
"$",
"this",
"->",
"newExpr",
"(",
")",
"... | Convenience method that adds a NOT NULL condition to the query
@param array|string|\Cake\Database\ExpressionInterface $fields A single field or expressions or a list of them that should be not null
@return $this | [
"Convenience",
"method",
"that",
"adds",
"a",
"NOT",
"NULL",
"condition",
"to",
"the",
"query"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L894-L907 |
211,020 | cakephp/cakephp | src/Database/Query.php | Query.whereNull | public function whereNull($fields)
{
if (!is_array($fields)) {
$fields = [$fields];
}
$exp = $this->newExpr();
foreach ($fields as $field) {
$exp->isNull($field);
}
return $this->where($exp);
} | php | public function whereNull($fields)
{
if (!is_array($fields)) {
$fields = [$fields];
}
$exp = $this->newExpr();
foreach ($fields as $field) {
$exp->isNull($field);
}
return $this->where($exp);
} | [
"public",
"function",
"whereNull",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"fields",
")",
")",
"{",
"$",
"fields",
"=",
"[",
"$",
"fields",
"]",
";",
"}",
"$",
"exp",
"=",
"$",
"this",
"->",
"newExpr",
"(",
")",
";",... | Convenience method that adds a IS NULL condition to the query
@param array|string|\Cake\Database\ExpressionInterface $fields A single field or expressions or a list of them that should be null
@return $this | [
"Convenience",
"method",
"that",
"adds",
"a",
"IS",
"NULL",
"condition",
"to",
"the",
"query"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L915-L928 |
211,021 | cakephp/cakephp | src/Database/Query.php | Query.whereInList | public function whereInList($field, array $values, array $options = [])
{
$options += [
'types' => [],
'allowEmpty' => false,
];
if ($options['allowEmpty'] && !$values) {
return $this->where('1=0');
}
return $this->where([$field . ' IN' =... | php | public function whereInList($field, array $values, array $options = [])
{
$options += [
'types' => [],
'allowEmpty' => false,
];
if ($options['allowEmpty'] && !$values) {
return $this->where('1=0');
}
return $this->where([$field . ' IN' =... | [
"public",
"function",
"whereInList",
"(",
"$",
"field",
",",
"array",
"$",
"values",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'types'",
"=>",
"[",
"]",
",",
"'allowEmpty'",
"=>",
"false",
",",
"]",
";",
"if... | Adds an IN condition or set of conditions to be used in the WHERE clause for this
query.
This method does allow empty inputs in contrast to where() if you set
'allowEmpty' to true.
Be careful about using it without proper sanity checks.
Options:
- `types` - Associative array of type names used to bind values to query... | [
"Adds",
"an",
"IN",
"condition",
"or",
"set",
"of",
"conditions",
"to",
"be",
"used",
"in",
"the",
"WHERE",
"clause",
"for",
"this",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L947-L959 |
211,022 | cakephp/cakephp | src/Database/Query.php | Query.whereNotInList | public function whereNotInList($field, array $values, array $options = [])
{
$options += [
'types' => [],
'allowEmpty' => false,
];
if ($options['allowEmpty'] && !$values) {
return $this->where([$field . ' IS NOT' => null]);
}
return $thi... | php | public function whereNotInList($field, array $values, array $options = [])
{
$options += [
'types' => [],
'allowEmpty' => false,
];
if ($options['allowEmpty'] && !$values) {
return $this->where([$field . ' IS NOT' => null]);
}
return $thi... | [
"public",
"function",
"whereNotInList",
"(",
"$",
"field",
",",
"array",
"$",
"values",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'types'",
"=>",
"[",
"]",
",",
"'allowEmpty'",
"=>",
"false",
",",
"]",
";",
... | Adds a NOT IN condition or set of conditions to be used in the WHERE clause for this
query.
This method does allow empty inputs in contrast to where() if you set
'allowEmpty' to true.
Be careful about using it without proper sanity checks.
@param string $field Field
@param array $values Array of values
@param array $... | [
"Adds",
"a",
"NOT",
"IN",
"condition",
"or",
"set",
"of",
"conditions",
"to",
"be",
"used",
"in",
"the",
"WHERE",
"clause",
"for",
"this",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L974-L986 |
211,023 | cakephp/cakephp | src/Database/Query.php | Query.orderDesc | public function orderDesc($field, $overwrite = false)
{
if ($overwrite) {
$this->_parts['order'] = null;
}
if (!$field) {
return $this;
}
if (!$this->_parts['order']) {
$this->_parts['order'] = new OrderByExpression();
}
$t... | php | public function orderDesc($field, $overwrite = false)
{
if ($overwrite) {
$this->_parts['order'] = null;
}
if (!$field) {
return $this;
}
if (!$this->_parts['order']) {
$this->_parts['order'] = new OrderByExpression();
}
$t... | [
"public",
"function",
"orderDesc",
"(",
"$",
"field",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_parts",
"[",
"'order'",
"]",
"=",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"field",
")"... | Add an ORDER BY clause with a DESC direction.
This method allows you to set complex expressions
as order conditions unlike order()
Order fields are not suitable for use with user supplied data as they are
not sanitized by the query builder.
@param string|\Cake\Database\Expression\QueryExpression $field The field to ... | [
"Add",
"an",
"ORDER",
"BY",
"clause",
"with",
"a",
"DESC",
"direction",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1240-L1255 |
211,024 | cakephp/cakephp | src/Database/Query.php | Query.group | public function group($fields, $overwrite = false)
{
if ($overwrite) {
$this->_parts['group'] = [];
}
if (!is_array($fields)) {
$fields = [$fields];
}
$this->_parts['group'] = array_merge($this->_parts['group'], array_values($fields));
$this-... | php | public function group($fields, $overwrite = false)
{
if ($overwrite) {
$this->_parts['group'] = [];
}
if (!is_array($fields)) {
$fields = [$fields];
}
$this->_parts['group'] = array_merge($this->_parts['group'], array_values($fields));
$this-... | [
"public",
"function",
"group",
"(",
"$",
"fields",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_parts",
"[",
"'group'",
"]",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
... | Adds a single or multiple fields to be used in the GROUP BY clause for this query.
Fields can be passed as an array of strings, array of expression
objects, a single expression or a single string.
By default this function will append any passed argument to the list of fields
to be grouped, unless the second argument i... | [
"Adds",
"a",
"single",
"or",
"multiple",
"fields",
"to",
"be",
"used",
"in",
"the",
"GROUP",
"BY",
"clause",
"for",
"this",
"query",
".",
"Fields",
"can",
"be",
"passed",
"as",
"an",
"array",
"of",
"strings",
"array",
"of",
"expression",
"objects",
"a",
... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1282-L1296 |
211,025 | cakephp/cakephp | src/Database/Query.php | Query.limit | public function limit($num)
{
$this->_dirty();
if ($num !== null && !is_object($num)) {
$num = (int)$num;
}
$this->_parts['limit'] = $num;
return $this;
} | php | public function limit($num)
{
$this->_dirty();
if ($num !== null && !is_object($num)) {
$num = (int)$num;
}
$this->_parts['limit'] = $num;
return $this;
} | [
"public",
"function",
"limit",
"(",
"$",
"num",
")",
"{",
"$",
"this",
"->",
"_dirty",
"(",
")",
";",
"if",
"(",
"$",
"num",
"!==",
"null",
"&&",
"!",
"is_object",
"(",
"$",
"num",
")",
")",
"{",
"$",
"num",
"=",
"(",
"int",
")",
"$",
"num",
... | Sets the number of records that should be retrieved from database,
accepts an integer or an expression object that evaluates to an integer.
In some databases, this operation might not be supported or will require
the query to be transformed in order to limit the result set size.
### Examples
```
$query->limit(10) // ... | [
"Sets",
"the",
"number",
"of",
"records",
"that",
"should",
"be",
"retrieved",
"from",
"database",
"accepts",
"an",
"integer",
"or",
"an",
"expression",
"object",
"that",
"evaluates",
"to",
"an",
"integer",
".",
"In",
"some",
"databases",
"this",
"operation",
... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1421-L1430 |
211,026 | cakephp/cakephp | src/Database/Query.php | Query.offset | public function offset($num)
{
$this->_dirty();
if ($num !== null && !is_object($num)) {
$num = (int)$num;
}
$this->_parts['offset'] = $num;
return $this;
} | php | public function offset($num)
{
$this->_dirty();
if ($num !== null && !is_object($num)) {
$num = (int)$num;
}
$this->_parts['offset'] = $num;
return $this;
} | [
"public",
"function",
"offset",
"(",
"$",
"num",
")",
"{",
"$",
"this",
"->",
"_dirty",
"(",
")",
";",
"if",
"(",
"$",
"num",
"!==",
"null",
"&&",
"!",
"is_object",
"(",
"$",
"num",
")",
")",
"{",
"$",
"num",
"=",
"(",
"int",
")",
"$",
"num",... | Sets the number of records that should be skipped from the original result set
This is commonly used for paginating large results. Accepts an integer or an
expression object that evaluates to an integer.
In some databases, this operation might not be supported or will require
the query to be transformed in order to li... | [
"Sets",
"the",
"number",
"of",
"records",
"that",
"should",
"be",
"skipped",
"from",
"the",
"original",
"result",
"set",
"This",
"is",
"commonly",
"used",
"for",
"paginating",
"large",
"results",
".",
"Accepts",
"an",
"integer",
"or",
"an",
"expression",
"ob... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1450-L1459 |
211,027 | cakephp/cakephp | src/Database/Query.php | Query.union | public function union($query, $overwrite = false)
{
if ($overwrite) {
$this->_parts['union'] = [];
}
$this->_parts['union'][] = [
'all' => false,
'query' => $query
];
$this->_dirty();
return $this;
} | php | public function union($query, $overwrite = false)
{
if ($overwrite) {
$this->_parts['union'] = [];
}
$this->_parts['union'][] = [
'all' => false,
'query' => $query
];
$this->_dirty();
return $this;
} | [
"public",
"function",
"union",
"(",
"$",
"query",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_parts",
"[",
"'union'",
"]",
"=",
"[",
"]",
";",
"}",
"$",
"this",
"->",
"_parts",
"[",
... | Adds a complete query to be used in conjunction with an UNION operator with
this query. This is used to combine the result set of this query with the one
that will be returned by the passed query. You can add as many queries as you
required by calling multiple times this method with different queries.
By default, the ... | [
"Adds",
"a",
"complete",
"query",
"to",
"be",
"used",
"in",
"conjunction",
"with",
"an",
"UNION",
"operator",
"with",
"this",
"query",
".",
"This",
"is",
"used",
"to",
"combine",
"the",
"result",
"set",
"of",
"this",
"query",
"with",
"the",
"one",
"that"... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1485-L1497 |
211,028 | cakephp/cakephp | src/Database/Query.php | Query.unionAll | public function unionAll($query, $overwrite = false)
{
if ($overwrite) {
$this->_parts['union'] = [];
}
$this->_parts['union'][] = [
'all' => true,
'query' => $query
];
$this->_dirty();
return $this;
} | php | public function unionAll($query, $overwrite = false)
{
if ($overwrite) {
$this->_parts['union'] = [];
}
$this->_parts['union'][] = [
'all' => true,
'query' => $query
];
$this->_dirty();
return $this;
} | [
"public",
"function",
"unionAll",
"(",
"$",
"query",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_parts",
"[",
"'union'",
"]",
"=",
"[",
"]",
";",
"}",
"$",
"this",
"->",
"_parts",
"["... | Adds a complete query to be used in conjunction with the UNION ALL operator with
this query. This is used to combine the result set of this query with the one
that will be returned by the passed query. You can add as many queries as you
required by calling multiple times this method with different queries.
Unlike UNIO... | [
"Adds",
"a",
"complete",
"query",
"to",
"be",
"used",
"in",
"conjunction",
"with",
"the",
"UNION",
"ALL",
"operator",
"with",
"this",
"query",
".",
"This",
"is",
"used",
"to",
"combine",
"the",
"result",
"set",
"of",
"this",
"query",
"with",
"the",
"one"... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1520-L1532 |
211,029 | cakephp/cakephp | src/Database/Query.php | Query.into | public function into($table)
{
$this->_dirty();
$this->_type = 'insert';
$this->_parts['insert'][0] = $table;
return $this;
} | php | public function into($table)
{
$this->_dirty();
$this->_type = 'insert';
$this->_parts['insert'][0] = $table;
return $this;
} | [
"public",
"function",
"into",
"(",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_dirty",
"(",
")",
";",
"$",
"this",
"->",
"_type",
"=",
"'insert'",
";",
"$",
"this",
"->",
"_parts",
"[",
"'insert'",
"]",
"[",
"0",
"]",
"=",
"$",
"table",
";",
"... | Set the table name for insert queries.
@param string $table The table name to insert into.
@return $this | [
"Set",
"the",
"table",
"name",
"for",
"insert",
"queries",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1568-L1575 |
211,030 | cakephp/cakephp | src/Database/Query.php | Query.values | public function values($data)
{
if ($this->_type !== 'insert') {
throw new Exception(
'You cannot add values before defining columns to use.'
);
}
if (empty($this->_parts['insert'])) {
throw new Exception(
'You cannot add va... | php | public function values($data)
{
if ($this->_type !== 'insert') {
throw new Exception(
'You cannot add values before defining columns to use.'
);
}
if (empty($this->_parts['insert'])) {
throw new Exception(
'You cannot add va... | [
"public",
"function",
"values",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_type",
"!==",
"'insert'",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'You cannot add values before defining columns to use.'",
")",
";",
"}",
"if",
"(",
"empty",
"(... | Set the values for an insert query.
Multi inserts can be performed by calling values() more than one time,
or by providing an array of value sets. Additionally $data can be a Query
instance to insert data from another SELECT statement.
@param array|\Cake\Database\Query $data The data to insert.
@return $this
@throws ... | [
"Set",
"the",
"values",
"for",
"an",
"insert",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1610-L1633 |
211,031 | cakephp/cakephp | src/Database/Query.php | Query.set | public function set($key, $value = null, $types = [])
{
if (empty($this->_parts['set'])) {
$this->_parts['set'] = $this->newExpr()->setConjunction(',');
}
if ($this->_parts['set']->isCallable($key)) {
$exp = $this->newExpr()->setConjunction(',');
$this->_... | php | public function set($key, $value = null, $types = [])
{
if (empty($this->_parts['set'])) {
$this->_parts['set'] = $this->newExpr()->setConjunction(',');
}
if ($this->_parts['set']->isCallable($key)) {
$exp = $this->newExpr()->setConjunction(',');
$this->_... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
",",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_parts",
"[",
"'set'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_parts",
"["... | Set one or many fields to update.
### Examples
Passing a string:
```
$query->update('articles')->set('title', 'The Title');
```
Passing an array:
```
$query->update('articles')->set(['title' => 'The Title'], ['title' => 'string']);
```
Passing a callable:
```
$query->update('articles')->set(function ($exp) {
ret... | [
"Set",
"one",
"or",
"many",
"fields",
"to",
"update",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1692-L1718 |
211,032 | cakephp/cakephp | src/Database/Query.php | Query.newExpr | public function newExpr($rawExpression = null)
{
$expression = new QueryExpression([], $this->getTypeMap());
if ($rawExpression !== null) {
$expression->add($rawExpression);
}
return $expression;
} | php | public function newExpr($rawExpression = null)
{
$expression = new QueryExpression([], $this->getTypeMap());
if ($rawExpression !== null) {
$expression->add($rawExpression);
}
return $expression;
} | [
"public",
"function",
"newExpr",
"(",
"$",
"rawExpression",
"=",
"null",
")",
"{",
"$",
"expression",
"=",
"new",
"QueryExpression",
"(",
"[",
"]",
",",
"$",
"this",
"->",
"getTypeMap",
"(",
")",
")",
";",
"if",
"(",
"$",
"rawExpression",
"!==",
"null"... | Returns a new QueryExpression object. This is a handy function when
building complex queries using a fluent interface. You can also override
this function in subclasses to use a more specialized QueryExpression class
if required.
You can optionally pass a single raw SQL string or an array or expressions in
any format ... | [
"Returns",
"a",
"new",
"QueryExpression",
"object",
".",
"This",
"is",
"a",
"handy",
"function",
"when",
"building",
"complex",
"queries",
"using",
"a",
"fluent",
"interface",
".",
"You",
"can",
"also",
"override",
"this",
"function",
"in",
"subclasses",
"to",... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1792-L1801 |
211,033 | cakephp/cakephp | src/Database/Query.php | Query.decorateResults | public function decorateResults($callback, $overwrite = false)
{
if ($overwrite) {
$this->_resultDecorators = [];
}
if ($callback !== null) {
$this->_resultDecorators[] = $callback;
}
return $this;
} | php | public function decorateResults($callback, $overwrite = false)
{
if ($overwrite) {
$this->_resultDecorators = [];
}
if ($callback !== null) {
$this->_resultDecorators[] = $callback;
}
return $this;
} | [
"public",
"function",
"decorateResults",
"(",
"$",
"callback",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"overwrite",
")",
"{",
"$",
"this",
"->",
"_resultDecorators",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"$",
"callback",
"!==",
"... | Registers a callback to be executed for each result that is fetched from the
result set, the callback function will receive as first parameter an array with
the raw data from the database for every row that is fetched and must return the
row with any possible modifications.
Callbacks will be executed lazily, if only 3... | [
"Registers",
"a",
"callback",
"to",
"be",
"executed",
"for",
"each",
"result",
"that",
"is",
"fetched",
"from",
"the",
"result",
"set",
"the",
"callback",
"function",
"will",
"receive",
"as",
"first",
"parameter",
"an",
"array",
"with",
"the",
"raw",
"data",... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1912-L1923 |
211,034 | cakephp/cakephp | src/Database/Query.php | Query.bind | public function bind($param, $value, $type = 'string')
{
$this->getValueBinder()->bind($param, $value, $type);
return $this;
} | php | public function bind($param, $value, $type = 'string')
{
$this->getValueBinder()->bind($param, $value, $type);
return $this;
} | [
"public",
"function",
"bind",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"getValueBinder",
"(",
")",
"->",
"bind",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$",
"type",
")",
";",
"retur... | Associates a query placeholder to a value and a type.
If type is expressed as "atype[]" (note braces) then it will cause the
placeholder to be re-written dynamically so if the value is an array, it
will create as many placeholders as values are in it. For example:
```
$query->bind(':id', [1, 2, 3], 'int[]');
```
Wil... | [
"Associates",
"a",
"query",
"placeholder",
"to",
"a",
"value",
"and",
"a",
"type",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L1981-L1986 |
211,035 | cakephp/cakephp | src/Database/Query.php | Query.valueBinder | public function valueBinder($binder = null)
{
deprecationWarning('Query::valueBinder() is deprecated. Use Query::getValueBinder()/setValueBinder() instead.');
if ($binder === null) {
if ($this->_valueBinder === null) {
$this->_valueBinder = new ValueBinder();
... | php | public function valueBinder($binder = null)
{
deprecationWarning('Query::valueBinder() is deprecated. Use Query::getValueBinder()/setValueBinder() instead.');
if ($binder === null) {
if ($this->_valueBinder === null) {
$this->_valueBinder = new ValueBinder();
... | [
"public",
"function",
"valueBinder",
"(",
"$",
"binder",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'Query::valueBinder() is deprecated. Use Query::getValueBinder()/setValueBinder() instead.'",
")",
";",
"if",
"(",
"$",
"binder",
"===",
"null",
")",
"{",
"if",
... | Returns the currently used ValueBinder instance. If a value is passed,
it will be set as the new instance to be used.
A ValueBinder is responsible for generating query placeholders and temporarily
associate values to those placeholders so that they can be passed correctly
to the statement object.
@deprecated 3.5.0 Us... | [
"Returns",
"the",
"currently",
"used",
"ValueBinder",
"instance",
".",
"If",
"a",
"value",
"is",
"passed",
"it",
"will",
"be",
"set",
"as",
"the",
"new",
"instance",
"to",
"be",
"used",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L2036-L2049 |
211,036 | cakephp/cakephp | src/Database/Query.php | Query.selectTypeMap | public function selectTypeMap(TypeMap $typeMap = null)
{
deprecationWarning(
'Query::selectTypeMap() is deprecated. ' .
'Use Query::setSelectTypeMap()/getSelectTypeMap() instead.'
);
if ($typeMap !== null) {
return $this->setSelectTypeMap($typeMap);
... | php | public function selectTypeMap(TypeMap $typeMap = null)
{
deprecationWarning(
'Query::selectTypeMap() is deprecated. ' .
'Use Query::setSelectTypeMap()/getSelectTypeMap() instead.'
);
if ($typeMap !== null) {
return $this->setSelectTypeMap($typeMap);
... | [
"public",
"function",
"selectTypeMap",
"(",
"TypeMap",
"$",
"typeMap",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'Query::selectTypeMap() is deprecated. '",
".",
"'Use Query::setSelectTypeMap()/getSelectTypeMap() instead.'",
")",
";",
"if",
"(",
"$",
"typeMap",
"!... | Sets the TypeMap class where the types for each of the fields in the
select clause are stored.
When called with no arguments, the current TypeMap object is returned.
@deprecated 3.4.0 Use setSelectTypeMap()/getSelectTypeMap() instead.
@param \Cake\Database\TypeMap|null $typeMap The map object to use
@return $this|\Ca... | [
"Sets",
"the",
"TypeMap",
"class",
"where",
"the",
"types",
"for",
"each",
"of",
"the",
"fields",
"in",
"the",
"select",
"clause",
"are",
"stored",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L2199-L2210 |
211,037 | cakephp/cakephp | src/Database/Query.php | Query._decorateStatement | protected function _decorateStatement($statement)
{
$typeMap = $this->getSelectTypeMap();
$driver = $this->getConnection()->getDriver();
if ($this->typeCastEnabled && $typeMap->toArray()) {
$statement = new CallbackStatement($statement, $driver, new FieldTypeConverter($typeMap, ... | php | protected function _decorateStatement($statement)
{
$typeMap = $this->getSelectTypeMap();
$driver = $this->getConnection()->getDriver();
if ($this->typeCastEnabled && $typeMap->toArray()) {
$statement = new CallbackStatement($statement, $driver, new FieldTypeConverter($typeMap, ... | [
"protected",
"function",
"_decorateStatement",
"(",
"$",
"statement",
")",
"{",
"$",
"typeMap",
"=",
"$",
"this",
"->",
"getSelectTypeMap",
"(",
")",
";",
"$",
"driver",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"getDriver",
"(",
")",
";",... | Auxiliary function used to wrap the original statement from the driver with
any registered callbacks.
@param \Cake\Database\StatementInterface $statement to be decorated
@return \Cake\Database\Statement\CallbackStatement | [
"Auxiliary",
"function",
"used",
"to",
"wrap",
"the",
"original",
"statement",
"from",
"the",
"driver",
"with",
"any",
"registered",
"callbacks",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L2219-L2233 |
211,038 | cakephp/cakephp | src/Database/Query.php | Query._conjugate | protected function _conjugate($part, $append, $conjunction, $types)
{
$expression = $this->_parts[$part] ?: $this->newExpr();
if (empty($append)) {
$this->_parts[$part] = $expression;
return;
}
if ($expression->isCallable($append)) {
$append = $a... | php | protected function _conjugate($part, $append, $conjunction, $types)
{
$expression = $this->_parts[$part] ?: $this->newExpr();
if (empty($append)) {
$this->_parts[$part] = $expression;
return;
}
if ($expression->isCallable($append)) {
$append = $a... | [
"protected",
"function",
"_conjugate",
"(",
"$",
"part",
",",
"$",
"append",
",",
"$",
"conjunction",
",",
"$",
"types",
")",
"{",
"$",
"expression",
"=",
"$",
"this",
"->",
"_parts",
"[",
"$",
"part",
"]",
"?",
":",
"$",
"this",
"->",
"newExpr",
"... | Helper function used to build conditions by composing QueryExpression objects.
@param string $part Name of the query part to append the new part to
@param string|null|array|\Cake\Database\ExpressionInterface|callable $append Expression or builder function to append.
@param string $conjunction type of conjunction to be... | [
"Helper",
"function",
"used",
"to",
"build",
"conditions",
"by",
"composing",
"QueryExpression",
"objects",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L2244-L2267 |
211,039 | cakephp/cakephp | src/Database/Query.php | Query._dirty | protected function _dirty()
{
$this->_dirty = true;
if ($this->_iterator && $this->_valueBinder) {
$this->getValueBinder()->reset();
}
} | php | protected function _dirty()
{
$this->_dirty = true;
if ($this->_iterator && $this->_valueBinder) {
$this->getValueBinder()->reset();
}
} | [
"protected",
"function",
"_dirty",
"(",
")",
"{",
"$",
"this",
"->",
"_dirty",
"=",
"true",
";",
"if",
"(",
"$",
"this",
"->",
"_iterator",
"&&",
"$",
"this",
"->",
"_valueBinder",
")",
"{",
"$",
"this",
"->",
"getValueBinder",
"(",
")",
"->",
"reset... | Marks a query as dirty, removing any preprocessed information
from in memory caching.
@return void | [
"Marks",
"a",
"query",
"as",
"dirty",
"removing",
"any",
"preprocessed",
"information",
"from",
"in",
"memory",
"caching",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Query.php#L2275-L2282 |
211,040 | cakephp/cakephp | src/Console/ConsoleErrorHandler.php | ConsoleErrorHandler._displayException | protected function _displayException($exception)
{
$errorName = 'Exception:';
if ($exception instanceof FatalErrorException) {
$errorName = 'Fatal Error:';
}
if ($exception instanceof PHP7ErrorException) {
$exception = $exception->getError();
}
... | php | protected function _displayException($exception)
{
$errorName = 'Exception:';
if ($exception instanceof FatalErrorException) {
$errorName = 'Fatal Error:';
}
if ($exception instanceof PHP7ErrorException) {
$exception = $exception->getError();
}
... | [
"protected",
"function",
"_displayException",
"(",
"$",
"exception",
")",
"{",
"$",
"errorName",
"=",
"'Exception:'",
";",
"if",
"(",
"$",
"exception",
"instanceof",
"FatalErrorException",
")",
"{",
"$",
"errorName",
"=",
"'Fatal Error:'",
";",
"}",
"if",
"(",... | Prints an exception to stderr.
@param \Exception $exception The exception to handle
@return void | [
"Prints",
"an",
"exception",
"to",
"stderr",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ConsoleErrorHandler.php#L81-L100 |
211,041 | cakephp/cakephp | src/Console/ConsoleErrorHandler.php | ConsoleErrorHandler._displayError | protected function _displayError($error, $debug)
{
$message = sprintf(
'%s in [%s, line %s]',
$error['description'],
$error['file'],
$error['line']
);
$message = sprintf(
"<error>%s Error:</error> %s\n",
$error['error'],... | php | protected function _displayError($error, $debug)
{
$message = sprintf(
'%s in [%s, line %s]',
$error['description'],
$error['file'],
$error['line']
);
$message = sprintf(
"<error>%s Error:</error> %s\n",
$error['error'],... | [
"protected",
"function",
"_displayError",
"(",
"$",
"error",
",",
"$",
"debug",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'%s in [%s, line %s]'",
",",
"$",
"error",
"[",
"'description'",
"]",
",",
"$",
"error",
"[",
"'file'",
"]",
",",
"$",
"error"... | Prints an error to stderr.
Template method of BaseErrorHandler.
@param array $error An array of error data.
@param bool $debug Whether or not the app is in debug mode.
@return void | [
"Prints",
"an",
"error",
"to",
"stderr",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ConsoleErrorHandler.php#L111-L125 |
211,042 | cakephp/cakephp | src/Database/Schema/SqliteSchema.php | SqliteSchema.hasSequences | public function hasSequences()
{
$result = $this->_driver->prepare(
'SELECT 1 FROM sqlite_master WHERE name = "sqlite_sequence"'
);
$result->execute();
$this->_hasSequences = (bool)$result->rowCount();
$result->closeCursor();
return $this->_hasSequences;
... | php | public function hasSequences()
{
$result = $this->_driver->prepare(
'SELECT 1 FROM sqlite_master WHERE name = "sqlite_sequence"'
);
$result->execute();
$this->_hasSequences = (bool)$result->rowCount();
$result->closeCursor();
return $this->_hasSequences;
... | [
"public",
"function",
"hasSequences",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_driver",
"->",
"prepare",
"(",
"'SELECT 1 FROM sqlite_master WHERE name = \"sqlite_sequence\"'",
")",
";",
"$",
"result",
"->",
"execute",
"(",
")",
";",
"$",
"this",
... | Returns whether there is any table in this connection to SQLite containing
sequences
@return bool | [
"Returns",
"whether",
"there",
"is",
"any",
"table",
"in",
"this",
"connection",
"to",
"SQLite",
"containing",
"sequences"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Schema/SqliteSchema.php#L515-L525 |
211,043 | cakephp/cakephp | src/View/Helper/UrlHelper.php | UrlHelper.image | public function image($path, array $options = [])
{
$pathPrefix = Configure::read('App.imageBaseUrl');
return $this->assetUrl($path, $options + compact('pathPrefix'));
} | php | public function image($path, array $options = [])
{
$pathPrefix = Configure::read('App.imageBaseUrl');
return $this->assetUrl($path, $options + compact('pathPrefix'));
} | [
"public",
"function",
"image",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"pathPrefix",
"=",
"Configure",
"::",
"read",
"(",
"'App.imageBaseUrl'",
")",
";",
"return",
"$",
"this",
"->",
"assetUrl",
"(",
"$",
"path",
... | Generates URL for given image file.
Depending on options passed provides full URL with domain name. Also calls
`Helper::assetTimestamp()` to add timestamp to local files.
@param string|array $path Path string or URL array
@param array $options Options array. Possible keys:
`fullBase` Return full URL with domain name
... | [
"Generates",
"URL",
"for",
"given",
"image",
"file",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/UrlHelper.php#L82-L87 |
211,044 | cakephp/cakephp | src/View/Helper/UrlHelper.php | UrlHelper.script | public function script($path, array $options = [])
{
$pathPrefix = Configure::read('App.jsBaseUrl');
$ext = '.js';
return $this->assetUrl($path, $options + compact('pathPrefix', 'ext'));
} | php | public function script($path, array $options = [])
{
$pathPrefix = Configure::read('App.jsBaseUrl');
$ext = '.js';
return $this->assetUrl($path, $options + compact('pathPrefix', 'ext'));
} | [
"public",
"function",
"script",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"pathPrefix",
"=",
"Configure",
"::",
"read",
"(",
"'App.jsBaseUrl'",
")",
";",
"$",
"ext",
"=",
"'.js'",
";",
"return",
"$",
"this",
"->",
... | Generates URL for given javascript file.
Depending on options passed provides full URL with domain name. Also calls
`Helper::assetTimestamp()` to add timestamp to local files.
@param string|array $path Path string or URL array
@param array $options Options array. Possible keys:
`fullBase` Return full URL with domain ... | [
"Generates",
"URL",
"for",
"given",
"javascript",
"file",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/UrlHelper.php#L133-L139 |
211,045 | cakephp/cakephp | src/View/Helper/UrlHelper.php | UrlHelper.assetUrl | public function assetUrl($path, array $options = [])
{
if (is_array($path)) {
return $this->build($path, !empty($options['fullBase']));
}
// data URIs only require HTML escaping
if (preg_match('/^data:[a-z]+\/[a-z]+;/', $path)) {
return h($path);
}
... | php | public function assetUrl($path, array $options = [])
{
if (is_array($path)) {
return $this->build($path, !empty($options['fullBase']));
}
// data URIs only require HTML escaping
if (preg_match('/^data:[a-z]+\/[a-z]+;/', $path)) {
return h($path);
}
... | [
"public",
"function",
"assetUrl",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
")",
"{",
"return",
"$",
"this",
"->",
"build",
"(",
"$",
"path",
",",
"!",
"empty",
"(",
"... | Generates URL for given asset file.
Depending on options passed provides full URL with domain name. Also calls
`Helper::assetTimestamp()` to add timestamp to local files.
### Options:
- `fullBase` Boolean true or a string (e.g. https://example) to
return full URL with protocol and domain name.
- `pathPrefix` Path pr... | [
"Generates",
"URL",
"for",
"given",
"asset",
"file",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/UrlHelper.php#L163-L208 |
211,046 | cakephp/cakephp | src/View/Helper/UrlHelper.php | UrlHelper._encodeUrl | protected function _encodeUrl($url)
{
$path = parse_url($url, PHP_URL_PATH);
$parts = array_map('rawurldecode', explode('/', $path));
$parts = array_map('rawurlencode', $parts);
$encoded = implode('/', $parts);
/** @var string $url */
$url = h(str_replace($path, $enc... | php | protected function _encodeUrl($url)
{
$path = parse_url($url, PHP_URL_PATH);
$parts = array_map('rawurldecode', explode('/', $path));
$parts = array_map('rawurlencode', $parts);
$encoded = implode('/', $parts);
/** @var string $url */
$url = h(str_replace($path, $enc... | [
"protected",
"function",
"_encodeUrl",
"(",
"$",
"url",
")",
"{",
"$",
"path",
"=",
"parse_url",
"(",
"$",
"url",
",",
"PHP_URL_PATH",
")",
";",
"$",
"parts",
"=",
"array_map",
"(",
"'rawurldecode'",
",",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
... | Encodes a URL for use in HTML attributes.
@param string $url The URL to encode.
@return string The URL encoded for both URL & HTML contexts. | [
"Encodes",
"a",
"URL",
"for",
"use",
"in",
"HTML",
"attributes",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/UrlHelper.php#L216-L227 |
211,047 | cakephp/cakephp | src/View/Helper/UrlHelper.php | UrlHelper.webroot | public function webroot($file)
{
$request = $this->_View->getRequest();
$asset = explode('?', $file);
$asset[1] = isset($asset[1]) ? '?' . $asset[1] : null;
$webPath = $request->getAttribute('webroot') . $asset[0];
$file = $asset[0];
if (!empty($this->_View->getThem... | php | public function webroot($file)
{
$request = $this->_View->getRequest();
$asset = explode('?', $file);
$asset[1] = isset($asset[1]) ? '?' . $asset[1] : null;
$webPath = $request->getAttribute('webroot') . $asset[0];
$file = $asset[0];
if (!empty($this->_View->getThem... | [
"public",
"function",
"webroot",
"(",
"$",
"file",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"_View",
"->",
"getRequest",
"(",
")",
";",
"$",
"asset",
"=",
"explode",
"(",
"'?'",
",",
"$",
"file",
")",
";",
"$",
"asset",
"[",
"1",
"]",
... | Checks if a file exists when theme is used, if no file is found default location is returned
@param string $file The file to create a webroot path to.
@return string Web accessible path to file. | [
"Checks",
"if",
"a",
"file",
"exists",
"when",
"theme",
"is",
"used",
"if",
"no",
"file",
"is",
"found",
"default",
"location",
"is",
"returned"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/UrlHelper.php#L274-L306 |
211,048 | cakephp/cakephp | src/Log/Engine/BaseLog.php | BaseLog._format | protected function _format($data, array $context = [])
{
if (is_string($data)) {
return $data;
}
$isObject = is_object($data);
if ($isObject && $data instanceof EntityInterface) {
return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
... | php | protected function _format($data, array $context = [])
{
if (is_string($data)) {
return $data;
}
$isObject = is_object($data);
if ($isObject && $data instanceof EntityInterface) {
return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
... | [
"protected",
"function",
"_format",
"(",
"$",
"data",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"data",
";",
"}",
"$",
"isObject",
"=",
"is_object",
"(",
"$",
"d... | Converts to string the provided data so it can be logged. The context
can optionally be used by log engines to interpolate variables
or add additional info to the logged message.
@param mixed $data The data to be converted to string and logged.
@param array $context Additional logging information for the message.
@ret... | [
"Converts",
"to",
"string",
"the",
"provided",
"data",
"so",
"it",
"can",
"be",
"logged",
".",
"The",
"context",
"can",
"optionally",
"be",
"used",
"by",
"log",
"engines",
"to",
"interpolate",
"variables",
"or",
"add",
"additional",
"info",
"to",
"the",
"l... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Log/Engine/BaseLog.php#L90-L111 |
211,049 | cakephp/cakephp | src/Mailer/MailerAwareTrait.php | MailerAwareTrait.getMailer | protected function getMailer($name, Email $email = null)
{
if ($email === null) {
$email = new Email();
}
$className = App::className($name, 'Mailer', 'Mailer');
if (empty($className)) {
throw new MissingMailerException(compact('name'));
}
r... | php | protected function getMailer($name, Email $email = null)
{
if ($email === null) {
$email = new Email();
}
$className = App::className($name, 'Mailer', 'Mailer');
if (empty($className)) {
throw new MissingMailerException(compact('name'));
}
r... | [
"protected",
"function",
"getMailer",
"(",
"$",
"name",
",",
"Email",
"$",
"email",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"email",
"===",
"null",
")",
"{",
"$",
"email",
"=",
"new",
"Email",
"(",
")",
";",
"}",
"$",
"className",
"=",
"App",
"::"... | Returns a mailer instance.
@param string $name Mailer's name.
@param \Cake\Mailer\Email|null $email Email instance.
@return \Cake\Mailer\Mailer
@throws \Cake\Mailer\Exception\MissingMailerException if undefined mailer class. | [
"Returns",
"a",
"mailer",
"instance",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Mailer/MailerAwareTrait.php#L38-L51 |
211,050 | cakephp/cakephp | src/Cache/Engine/MemcachedEngine.php | MemcachedEngine._setOptions | protected function _setOptions()
{
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$serializer = strtolower($this->_config['serialize']);
if (!isset($this->_serializers[$serializer])) {
throw new InvalidArgumentException(
sprintf('%s is n... | php | protected function _setOptions()
{
$this->_Memcached->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$serializer = strtolower($this->_config['serialize']);
if (!isset($this->_serializers[$serializer])) {
throw new InvalidArgumentException(
sprintf('%s is n... | [
"protected",
"function",
"_setOptions",
"(",
")",
"{",
"$",
"this",
"->",
"_Memcached",
"->",
"setOption",
"(",
"Memcached",
"::",
"OPT_LIBKETAMA_COMPATIBLE",
",",
"true",
")",
";",
"$",
"serializer",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"_config",
"["... | Settings the memcached instance
@return void
@throws \InvalidArgumentException When the Memcached extension is not built
with the desired serializer engine. | [
"Settings",
"the",
"memcached",
"instance"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/MemcachedEngine.php#L197-L235 |
211,051 | cakephp/cakephp | src/Cache/Engine/MemcachedEngine.php | MemcachedEngine.write | public function write($key, $value)
{
$duration = $this->_config['duration'];
if ($duration > 30 * DAY) {
$duration = 0;
}
$key = $this->_key($key);
return $this->_Memcached->set($key, $value, $duration);
} | php | public function write($key, $value)
{
$duration = $this->_config['duration'];
if ($duration > 30 * DAY) {
$duration = 0;
}
$key = $this->_key($key);
return $this->_Memcached->set($key, $value, $duration);
} | [
"public",
"function",
"write",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"duration",
"=",
"$",
"this",
"->",
"_config",
"[",
"'duration'",
"]",
";",
"if",
"(",
"$",
"duration",
">",
"30",
"*",
"DAY",
")",
"{",
"$",
"duration",
"=",
"0",
... | Write data for key into cache. When using memcached as your cache engine
remember that the Memcached pecl extension does not support cache expiry
times greater than 30 days in the future. Any duration greater than 30 days
will be treated as never expiring.
@param string $key Identifier for the data
@param mixed $value... | [
"Write",
"data",
"for",
"key",
"into",
"cache",
".",
"When",
"using",
"memcached",
"as",
"your",
"cache",
"engine",
"remember",
"that",
"the",
"Memcached",
"pecl",
"extension",
"does",
"not",
"support",
"cache",
"expiry",
"times",
"greater",
"than",
"30",
"d... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/MemcachedEngine.php#L302-L312 |
211,052 | cakephp/cakephp | src/Cache/Engine/MemcachedEngine.php | MemcachedEngine.writeMany | public function writeMany($data)
{
$cacheData = [];
foreach ($data as $key => $value) {
$cacheData[$this->_key($key)] = $value;
}
$success = $this->_Memcached->setMulti($cacheData);
$return = [];
foreach (array_keys($data) as $key) {
$return[... | php | public function writeMany($data)
{
$cacheData = [];
foreach ($data as $key => $value) {
$cacheData[$this->_key($key)] = $value;
}
$success = $this->_Memcached->setMulti($cacheData);
$return = [];
foreach (array_keys($data) as $key) {
$return[... | [
"public",
"function",
"writeMany",
"(",
"$",
"data",
")",
"{",
"$",
"cacheData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"cacheData",
"[",
"$",
"this",
"->",
"_key",
"(",
"$",
"key",
... | Write many cache entries to the cache at once
@param array $data An array of data to be stored in the cache
@return array of bools for each key provided, true if the data was
successfully cached, false on failure | [
"Write",
"many",
"cache",
"entries",
"to",
"the",
"cache",
"at",
"once"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/MemcachedEngine.php#L321-L336 |
211,053 | cakephp/cakephp | src/Cache/Engine/MemcachedEngine.php | MemcachedEngine.readMany | public function readMany($keys)
{
$cacheKeys = [];
foreach ($keys as $key) {
$cacheKeys[] = $this->_key($key);
}
$values = $this->_Memcached->getMulti($cacheKeys);
$return = [];
foreach ($keys as &$key) {
$return[$key] = array_key_exists($this... | php | public function readMany($keys)
{
$cacheKeys = [];
foreach ($keys as $key) {
$cacheKeys[] = $this->_key($key);
}
$values = $this->_Memcached->getMulti($cacheKeys);
$return = [];
foreach ($keys as &$key) {
$return[$key] = array_key_exists($this... | [
"public",
"function",
"readMany",
"(",
"$",
"keys",
")",
"{",
"$",
"cacheKeys",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"cacheKeys",
"[",
"]",
"=",
"$",
"this",
"->",
"_key",
"(",
"$",
"key",
")",
";",
... | Read many keys from the cache at once
@param array $keys An array of identifiers for the data
@return array An array containing, for each of the given $keys, the cached data or
false if cached data could not be retrieved. | [
"Read",
"many",
"keys",
"from",
"the",
"cache",
"at",
"once"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/MemcachedEngine.php#L359-L374 |
211,054 | cakephp/cakephp | src/Cache/Engine/MemcachedEngine.php | MemcachedEngine.deleteMany | public function deleteMany($keys)
{
$cacheKeys = [];
foreach ($keys as $key) {
$cacheKeys[] = $this->_key($key);
}
$success = $this->_Memcached->deleteMulti($cacheKeys);
$return = [];
foreach ($keys as $key) {
$return[$key] = $success;
... | php | public function deleteMany($keys)
{
$cacheKeys = [];
foreach ($keys as $key) {
$cacheKeys[] = $this->_key($key);
}
$success = $this->_Memcached->deleteMulti($cacheKeys);
$return = [];
foreach ($keys as $key) {
$return[$key] = $success;
... | [
"public",
"function",
"deleteMany",
"(",
"$",
"keys",
")",
"{",
"$",
"cacheKeys",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"key",
")",
"{",
"$",
"cacheKeys",
"[",
"]",
"=",
"$",
"this",
"->",
"_key",
"(",
"$",
"key",
")",
";"... | Delete many keys from the cache at once
@param array $keys An array of identifiers for the data
@return array of boolean values that are true if the key was successfully
deleted, false if it didn't exist or couldn't be removed. | [
"Delete",
"many",
"keys",
"from",
"the",
"cache",
"at",
"once"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/MemcachedEngine.php#L425-L440 |
211,055 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.getShell | protected function getShell(ConsoleIo $io, CommandCollection $commands, $name)
{
$instance = $commands->get($name);
if (is_string($instance)) {
$instance = $this->createShell($instance, $io);
}
if ($instance instanceof Shell) {
$instance->setRootName($this->ro... | php | protected function getShell(ConsoleIo $io, CommandCollection $commands, $name)
{
$instance = $commands->get($name);
if (is_string($instance)) {
$instance = $this->createShell($instance, $io);
}
if ($instance instanceof Shell) {
$instance->setRootName($this->ro... | [
"protected",
"function",
"getShell",
"(",
"ConsoleIo",
"$",
"io",
",",
"CommandCollection",
"$",
"commands",
",",
"$",
"name",
")",
"{",
"$",
"instance",
"=",
"$",
"commands",
"->",
"get",
"(",
"$",
"name",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
... | Get the shell instance for a given command name
@param \Cake\Console\ConsoleIo $io The IO wrapper for the created shell class.
@param \Cake\Console\CommandCollection $commands The command collection to find the shell in.
@param string $name The command name to find
@return \Cake\Console\Shell|\Cake\Console\Command | [
"Get",
"the",
"shell",
"instance",
"for",
"a",
"given",
"command",
"name"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L277-L294 |
211,056 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.longestCommandName | protected function longestCommandName($commands, $argv)
{
for ($i = 3; $i > 1; $i--) {
$parts = array_slice($argv, 0, $i);
$name = implode(' ', $parts);
if ($commands->has($name)) {
return [$name, array_slice($argv, $i)];
}
}
$n... | php | protected function longestCommandName($commands, $argv)
{
for ($i = 3; $i > 1; $i--) {
$parts = array_slice($argv, 0, $i);
$name = implode(' ', $parts);
if ($commands->has($name)) {
return [$name, array_slice($argv, $i)];
}
}
$n... | [
"protected",
"function",
"longestCommandName",
"(",
"$",
"commands",
",",
"$",
"argv",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"3",
";",
"$",
"i",
">",
"1",
";",
"$",
"i",
"--",
")",
"{",
"$",
"parts",
"=",
"array_slice",
"(",
"$",
"argv",
",",
"0... | Build the longest command name that exists in the collection
Build the longest command name that matches a
defined command. This will traverse a maximum of 3 tokens.
@param \Cake\Console\CommandCollection $commands The command collection to check.
@param array $argv The CLI arguments.
@return array An array of the re... | [
"Build",
"the",
"longest",
"command",
"name",
"that",
"exists",
"in",
"the",
"collection"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L306-L318 |
211,057 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.resolveName | protected function resolveName($commands, $io, $name)
{
if (!$name) {
$io->err('<error>No command provided. Choose one of the available commands.</error>', 2);
$name = 'help';
}
if (isset($this->aliases[$name])) {
$name = $this->aliases[$name];
}
... | php | protected function resolveName($commands, $io, $name)
{
if (!$name) {
$io->err('<error>No command provided. Choose one of the available commands.</error>', 2);
$name = 'help';
}
if (isset($this->aliases[$name])) {
$name = $this->aliases[$name];
}
... | [
"protected",
"function",
"resolveName",
"(",
"$",
"commands",
",",
"$",
"io",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"name",
")",
"{",
"$",
"io",
"->",
"err",
"(",
"'<error>No command provided. Choose one of the available commands.</error>'",
",",
"2... | Resolve the command name into a name that exists in the collection.
Apply backwards compatible inflections and aliases.
Will step forward up to 3 tokens in $argv to generate
a command name in the CommandCollection. More specific
command names take precedence over less specific ones.
@param \Cake\Console\CommandCollec... | [
"Resolve",
"the",
"command",
"name",
"into",
"a",
"name",
"that",
"exists",
"in",
"the",
"collection",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L333-L353 |
211,058 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.runCommand | protected function runCommand(Command $command, array $argv, ConsoleIo $io)
{
try {
return $command->run($argv, $io);
} catch (StopException $e) {
return $e->getCode();
}
} | php | protected function runCommand(Command $command, array $argv, ConsoleIo $io)
{
try {
return $command->run($argv, $io);
} catch (StopException $e) {
return $e->getCode();
}
} | [
"protected",
"function",
"runCommand",
"(",
"Command",
"$",
"command",
",",
"array",
"$",
"argv",
",",
"ConsoleIo",
"$",
"io",
")",
"{",
"try",
"{",
"return",
"$",
"command",
"->",
"run",
"(",
"$",
"argv",
",",
"$",
"io",
")",
";",
"}",
"catch",
"(... | Execute a Command class.
@param \Cake\Console\Command $command The command to run.
@param array $argv The CLI arguments to invoke.
@param \Cake\Console\ConsoleIo $io The console io
@return int Exit code | [
"Execute",
"a",
"Command",
"class",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L363-L370 |
211,059 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.runShell | protected function runShell(Shell $shell, array $argv)
{
try {
$shell->initialize();
return $shell->runCommand($argv, true);
} catch (StopException $e) {
return $e->getCode();
}
} | php | protected function runShell(Shell $shell, array $argv)
{
try {
$shell->initialize();
return $shell->runCommand($argv, true);
} catch (StopException $e) {
return $e->getCode();
}
} | [
"protected",
"function",
"runShell",
"(",
"Shell",
"$",
"shell",
",",
"array",
"$",
"argv",
")",
"{",
"try",
"{",
"$",
"shell",
"->",
"initialize",
"(",
")",
";",
"return",
"$",
"shell",
"->",
"runCommand",
"(",
"$",
"argv",
",",
"true",
")",
";",
... | Execute a Shell class.
@param \Cake\Console\Shell $shell The shell to run.
@param array $argv The CLI arguments to invoke.
@return int Exit code | [
"Execute",
"a",
"Shell",
"class",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L379-L388 |
211,060 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.createShell | protected function createShell($className, ConsoleIo $io)
{
$shell = $this->factory->create($className);
if ($shell instanceof Shell) {
$shell->setIo($io);
}
return $shell;
} | php | protected function createShell($className, ConsoleIo $io)
{
$shell = $this->factory->create($className);
if ($shell instanceof Shell) {
$shell->setIo($io);
}
return $shell;
} | [
"protected",
"function",
"createShell",
"(",
"$",
"className",
",",
"ConsoleIo",
"$",
"io",
")",
"{",
"$",
"shell",
"=",
"$",
"this",
"->",
"factory",
"->",
"create",
"(",
"$",
"className",
")",
";",
"if",
"(",
"$",
"shell",
"instanceof",
"Shell",
")",... | The wrapper for creating shell instances.
@param string $className Shell class name.
@param \Cake\Console\ConsoleIo $io The IO wrapper for the created shell class.
@return \Cake\Console\Shell|\Cake\Console\Command | [
"The",
"wrapper",
"for",
"creating",
"shell",
"instances",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L397-L405 |
211,061 | cakephp/cakephp | src/Console/CommandRunner.php | CommandRunner.loadRoutes | protected function loadRoutes()
{
$builder = Router::createRouteBuilder('/');
if ($this->app instanceof HttpApplicationInterface) {
$this->app->routes($builder);
}
if ($this->app instanceof PluginApplicationInterface) {
$this->app->pluginRoutes($builder);
... | php | protected function loadRoutes()
{
$builder = Router::createRouteBuilder('/');
if ($this->app instanceof HttpApplicationInterface) {
$this->app->routes($builder);
}
if ($this->app instanceof PluginApplicationInterface) {
$this->app->pluginRoutes($builder);
... | [
"protected",
"function",
"loadRoutes",
"(",
")",
"{",
"$",
"builder",
"=",
"Router",
"::",
"createRouteBuilder",
"(",
"'/'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"app",
"instanceof",
"HttpApplicationInterface",
")",
"{",
"$",
"this",
"->",
"app",
"->",
... | Ensure that the application's routes are loaded.
Console commands and shells often need to generate URLs.
@return void | [
"Ensure",
"that",
"the",
"application",
"s",
"routes",
"are",
"loaded",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/CommandRunner.php#L414-L424 |
211,062 | cakephp/cakephp | src/Collection/Iterator/ReplaceIterator.php | ReplaceIterator.current | public function current()
{
$callback = $this->_callback;
return $callback(parent::current(), $this->key(), $this->_innerIterator);
} | php | public function current()
{
$callback = $this->_callback;
return $callback(parent::current(), $this->key(), $this->_innerIterator);
} | [
"public",
"function",
"current",
"(",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"_callback",
";",
"return",
"$",
"callback",
"(",
"parent",
"::",
"current",
"(",
")",
",",
"$",
"this",
"->",
"key",
"(",
")",
",",
"$",
"this",
"->",
"_inner... | Returns the value returned by the callback after passing the current value in
the iteration
@return mixed | [
"Returns",
"the",
"value",
"returned",
"by",
"the",
"callback",
"after",
"passing",
"the",
"current",
"value",
"in",
"the",
"iteration"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Collection/Iterator/ReplaceIterator.php#L66-L71 |
211,063 | cakephp/cakephp | src/Database/ValueBinder.php | ValueBinder.bind | public function bind($param, $value, $type = 'string')
{
$this->_bindings[$param] = compact('value', 'type') + [
'placeholder' => is_int($param) ? $param : substr($param, 1)
];
} | php | public function bind($param, $value, $type = 'string')
{
$this->_bindings[$param] = compact('value', 'type') + [
'placeholder' => is_int($param) ? $param : substr($param, 1)
];
} | [
"public",
"function",
"bind",
"(",
"$",
"param",
",",
"$",
"value",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"this",
"->",
"_bindings",
"[",
"$",
"param",
"]",
"=",
"compact",
"(",
"'value'",
",",
"'type'",
")",
"+",
"[",
"'placeholder'",
... | Associates a query placeholder to a value and a type
@param string|int $param placeholder to be replaced with quoted version
of $value
@param mixed $value The value to be bound
@param string|int $type the mapped type name, used for casting when sending
to database
@return void | [
"Associates",
"a",
"query",
"placeholder",
"to",
"a",
"value",
"and",
"a",
"type"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/ValueBinder.php#L51-L56 |
211,064 | cakephp/cakephp | src/Database/ValueBinder.php | ValueBinder.generateManyNamed | public function generateManyNamed($values, $type = 'string')
{
$placeholders = [];
foreach ($values as $k => $value) {
$param = $this->placeholder('c');
$this->_bindings[$param] = [
'value' => $value,
'type' => $type,
'placehold... | php | public function generateManyNamed($values, $type = 'string')
{
$placeholders = [];
foreach ($values as $k => $value) {
$param = $this->placeholder('c');
$this->_bindings[$param] = [
'value' => $value,
'type' => $type,
'placehold... | [
"public",
"function",
"generateManyNamed",
"(",
"$",
"values",
",",
"$",
"type",
"=",
"'string'",
")",
"{",
"$",
"placeholders",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"value",
")",
"{",
"$",
"param",
"=",
"$"... | Creates unique named placeholders for each of the passed values
and binds them with the specified type.
@param array|\Traversable $values The list of values to be bound
@param string $type The type with which all values will be bound
@return array with the placeholders to insert in the query | [
"Creates",
"unique",
"named",
"placeholders",
"for",
"each",
"of",
"the",
"passed",
"values",
"and",
"binds",
"them",
"with",
"the",
"specified",
"type",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/ValueBinder.php#L85-L99 |
211,065 | cakephp/cakephp | src/Database/ValueBinder.php | ValueBinder.attachTo | public function attachTo($statement)
{
$bindings = $this->bindings();
if (empty($bindings)) {
return;
}
foreach ($bindings as $b) {
$statement->bindValue($b['placeholder'], $b['value'], $b['type']);
}
} | php | public function attachTo($statement)
{
$bindings = $this->bindings();
if (empty($bindings)) {
return;
}
foreach ($bindings as $b) {
$statement->bindValue($b['placeholder'], $b['value'], $b['type']);
}
} | [
"public",
"function",
"attachTo",
"(",
"$",
"statement",
")",
"{",
"$",
"bindings",
"=",
"$",
"this",
"->",
"bindings",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"bindings",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"bindings",
"as... | Binds all the stored values in this object to the passed statement.
@param \Cake\Database\StatementInterface $statement The statement to add parameters to.
@return void | [
"Binds",
"all",
"the",
"stored",
"values",
"in",
"this",
"object",
"to",
"the",
"passed",
"statement",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/ValueBinder.php#L139-L149 |
211,066 | cakephp/cakephp | src/Routing/Route/PluginShortRoute.php | PluginShortRoute.parse | public function parse($url, $method = '')
{
$params = parent::parse($url, $method);
if (!$params) {
return false;
}
$params['controller'] = $params['plugin'];
return $params;
} | php | public function parse($url, $method = '')
{
$params = parent::parse($url, $method);
if (!$params) {
return false;
}
$params['controller'] = $params['plugin'];
return $params;
} | [
"public",
"function",
"parse",
"(",
"$",
"url",
",",
"$",
"method",
"=",
"''",
")",
"{",
"$",
"params",
"=",
"parent",
"::",
"parse",
"(",
"$",
"url",
",",
"$",
"method",
")",
";",
"if",
"(",
"!",
"$",
"params",
")",
"{",
"return",
"false",
";"... | Parses a string URL into an array. If a plugin key is found, it will be copied to the
controller parameter.
@param string $url The URL to parse
@param string $method The HTTP method
@return array|false An array of request parameters, or boolean false on failure. | [
"Parses",
"a",
"string",
"URL",
"into",
"an",
"array",
".",
"If",
"a",
"plugin",
"key",
"is",
"found",
"it",
"will",
"be",
"copied",
"to",
"the",
"controller",
"parameter",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/Route/PluginShortRoute.php#L32-L41 |
211,067 | cakephp/cakephp | src/Routing/Route/PluginShortRoute.php | PluginShortRoute.match | public function match(array $url, array $context = [])
{
if (isset($url['controller'], $url['plugin']) && $url['plugin'] !== $url['controller']) {
return false;
}
$this->defaults['controller'] = $url['controller'];
$result = parent::match($url, $context);
unset($t... | php | public function match(array $url, array $context = [])
{
if (isset($url['controller'], $url['plugin']) && $url['plugin'] !== $url['controller']) {
return false;
}
$this->defaults['controller'] = $url['controller'];
$result = parent::match($url, $context);
unset($t... | [
"public",
"function",
"match",
"(",
"array",
"$",
"url",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"url",
"[",
"'controller'",
"]",
",",
"$",
"url",
"[",
"'plugin'",
"]",
")",
"&&",
"$",
"url",
"[",
"'... | Reverses route plugin shortcut URLs. If the plugin and controller
are not the same the match is an auto fail.
@param array $url Array of parameters to convert to a string.
@param array $context An array of the current request context.
Contains information such as the current host, scheme, port, and base
directory.
@re... | [
"Reverses",
"route",
"plugin",
"shortcut",
"URLs",
".",
"If",
"the",
"plugin",
"and",
"controller",
"are",
"not",
"the",
"same",
"the",
"match",
"is",
"an",
"auto",
"fail",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/Route/PluginShortRoute.php#L53-L63 |
211,068 | cakephp/cakephp | src/ORM/Locator/TableLocator.php | TableLocator.getConfig | public function getConfig($alias = null)
{
if ($alias === null) {
return $this->_config;
}
return isset($this->_config[$alias]) ? $this->_config[$alias] : [];
} | php | public function getConfig($alias = null)
{
if ($alias === null) {
return $this->_config;
}
return isset($this->_config[$alias]) ? $this->_config[$alias] : [];
} | [
"public",
"function",
"getConfig",
"(",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"alias",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_config",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
"_config",
"[",
"$",
"alias"... | Returns configuration for an alias or the full configuration array for all aliases.
@param string|null $alias Alias to get config for, null for complete config.
@return array The config data. | [
"Returns",
"configuration",
"for",
"an",
"alias",
"or",
"the",
"full",
"configuration",
"array",
"for",
"all",
"aliases",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Locator/TableLocator.php#L94-L101 |
211,069 | cakephp/cakephp | src/ORM/Locator/TableLocator.php | TableLocator.get | public function get($alias, array $options = [])
{
if (isset($this->_instances[$alias])) {
if (!empty($options) && $this->_options[$alias] !== $options) {
throw new RuntimeException(sprintf(
'You cannot configure "%s", it already exists in the registry.',
... | php | public function get($alias, array $options = [])
{
if (isset($this->_instances[$alias])) {
if (!empty($options) && $this->_options[$alias] !== $options) {
throw new RuntimeException(sprintf(
'You cannot configure "%s", it already exists in the registry.',
... | [
"public",
"function",
"get",
"(",
"$",
"alias",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_instances",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"options"... | Get a table instance from the registry.
Tables are only created once until the registry is flushed.
This means that aliases must be unique across your application.
This is important because table associations are resolved at runtime
and cyclic references need to be handled correctly.
The options that can be passed ar... | [
"Get",
"a",
"table",
"instance",
"from",
"the",
"registry",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Locator/TableLocator.php#L173-L231 |
211,070 | cakephp/cakephp | src/ORM/Locator/TableLocator.php | TableLocator._getClassName | protected function _getClassName($alias, array $options = [])
{
if (empty($options['className'])) {
$options['className'] = Inflector::camelize($alias);
}
return App::className($options['className'], 'Model/Table', 'Table');
} | php | protected function _getClassName($alias, array $options = [])
{
if (empty($options['className'])) {
$options['className'] = Inflector::camelize($alias);
}
return App::className($options['className'], 'Model/Table', 'Table');
} | [
"protected",
"function",
"_getClassName",
"(",
"$",
"alias",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'className'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'className'",
"]",
"=",
"Inflec... | Gets the table class name.
@param string $alias The alias name you want to get.
@param array $options Table options array.
@return string|false | [
"Gets",
"the",
"table",
"class",
"name",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Locator/TableLocator.php#L240-L247 |
211,071 | cakephp/cakephp | src/View/Helper/TextHelper.php | TextHelper._insertPlaceHolder | protected function _insertPlaceHolder($matches)
{
$match = $matches[0];
$envelope = ['', ''];
if (isset($matches['url'])) {
$match = $matches['url'];
$envelope = [$matches['left'], $matches['right']];
}
if (isset($matches['url_bare'])) {
$m... | php | protected function _insertPlaceHolder($matches)
{
$match = $matches[0];
$envelope = ['', ''];
if (isset($matches['url'])) {
$match = $matches['url'];
$envelope = [$matches['left'], $matches['right']];
}
if (isset($matches['url_bare'])) {
$m... | [
"protected",
"function",
"_insertPlaceHolder",
"(",
"$",
"matches",
")",
"{",
"$",
"match",
"=",
"$",
"matches",
"[",
"0",
"]",
";",
"$",
"envelope",
"=",
"[",
"''",
",",
"''",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"matches",
"[",
"'url'",
"]",
... | Saves the placeholder for a string, for later use. This gets around double
escaping content in URL's.
@param array $matches An array of regexp matches.
@return string Replaced values. | [
"Saves",
"the",
"placeholder",
"for",
"a",
"string",
"for",
"later",
"use",
".",
"This",
"gets",
"around",
"double",
"escaping",
"content",
"in",
"URL",
"s",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/TextHelper.php#L160-L178 |
211,072 | cakephp/cakephp | src/View/Helper/TextHelper.php | TextHelper._linkUrls | protected function _linkUrls($text, $htmlOptions)
{
$replace = [];
foreach ($this->_placeholders as $hash => $content) {
$link = $url = $content['content'];
$envelope = $content['envelope'];
if (!preg_match('#^[a-z]+\://#i', $url)) {
$url = 'http:/... | php | protected function _linkUrls($text, $htmlOptions)
{
$replace = [];
foreach ($this->_placeholders as $hash => $content) {
$link = $url = $content['content'];
$envelope = $content['envelope'];
if (!preg_match('#^[a-z]+\://#i', $url)) {
$url = 'http:/... | [
"protected",
"function",
"_linkUrls",
"(",
"$",
"text",
",",
"$",
"htmlOptions",
")",
"{",
"$",
"replace",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_placeholders",
"as",
"$",
"hash",
"=>",
"$",
"content",
")",
"{",
"$",
"link",
"=",
... | Replace placeholders with links.
@param string $text The text to operate on.
@param array $htmlOptions The options for the generated links.
@return string The text with links inserted. | [
"Replace",
"placeholders",
"with",
"links",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/TextHelper.php#L187-L200 |
211,073 | cakephp/cakephp | src/View/Helper/TextHelper.php | TextHelper._linkEmails | protected function _linkEmails($text, $options)
{
$replace = [];
foreach ($this->_placeholders as $hash => $content) {
$url = $content['content'];
$envelope = $content['envelope'];
$replace[$hash] = $envelope[0] . $this->Html->link($url, 'mailto:' . $url, $options... | php | protected function _linkEmails($text, $options)
{
$replace = [];
foreach ($this->_placeholders as $hash => $content) {
$url = $content['content'];
$envelope = $content['envelope'];
$replace[$hash] = $envelope[0] . $this->Html->link($url, 'mailto:' . $url, $options... | [
"protected",
"function",
"_linkEmails",
"(",
"$",
"text",
",",
"$",
"options",
")",
"{",
"$",
"replace",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_placeholders",
"as",
"$",
"hash",
"=>",
"$",
"content",
")",
"{",
"$",
"url",
"=",
"$"... | Links email addresses
@param string $text The text to operate on
@param array $options An array of options to use for the HTML.
@return string
@see \Cake\View\Helper\TextHelper::autoLinkEmails() | [
"Links",
"email",
"addresses"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/TextHelper.php#L210-L220 |
211,074 | cakephp/cakephp | src/View/Helper/TextHelper.php | TextHelper.autoLink | public function autoLink($text, array $options = [])
{
$text = $this->autoLinkUrls($text, $options);
return $this->autoLinkEmails($text, ['escape' => false] + $options);
} | php | public function autoLink($text, array $options = [])
{
$text = $this->autoLinkUrls($text, $options);
return $this->autoLinkEmails($text, ['escape' => false] + $options);
} | [
"public",
"function",
"autoLink",
"(",
"$",
"text",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"autoLinkUrls",
"(",
"$",
"text",
",",
"$",
"options",
")",
";",
"return",
"$",
"this",
"->",
"autoLinkE... | Convert all links and email addresses to HTML links.
### Options
- `escape` Control HTML escaping of input. Defaults to true.
@param string $text Text
@param array $options Array of HTML options, and options listed above.
@return string The text with links
@link https://book.cakephp.org/3.0/en/views/helpers/text.htm... | [
"Convert",
"all",
"links",
"and",
"email",
"addresses",
"to",
"HTML",
"links",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/TextHelper.php#L264-L269 |
211,075 | cakephp/cakephp | src/I18n/DateFormatTrait.php | DateFormatTrait.i18nFormat | public function i18nFormat($format = null, $timezone = null, $locale = null)
{
if ($format === Time::UNIX_TIMESTAMP_FORMAT) {
return $this->getTimestamp();
}
$time = $this;
if ($timezone) {
// Handle the immutable and mutable object cases.
$time ... | php | public function i18nFormat($format = null, $timezone = null, $locale = null)
{
if ($format === Time::UNIX_TIMESTAMP_FORMAT) {
return $this->getTimestamp();
}
$time = $this;
if ($timezone) {
// Handle the immutable and mutable object cases.
$time ... | [
"public",
"function",
"i18nFormat",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"timezone",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"Time",
"::",
"UNIX_TIMESTAMP_FORMAT",
")",
"{",
"return",
"$",
"this",
... | Returns a formatted string for this time object using the preferred format and
language for the specified locale.
It is possible to specify the desired format for the string to be displayed.
You can either pass `IntlDateFormatter` constants as the first argument of this
function, or pass a full ICU date formatting str... | [
"Returns",
"a",
"formatted",
"string",
"for",
"this",
"time",
"object",
"using",
"the",
"preferred",
"format",
"and",
"language",
"for",
"the",
"specified",
"locale",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/DateFormatTrait.php#L161-L179 |
211,076 | cakephp/cakephp | src/I18n/DateFormatTrait.php | DateFormatTrait.parseDateTime | public static function parseDateTime($time, $format = null)
{
$dateFormat = $format ?: static::$_toStringFormat;
$timeFormat = $pattern = null;
if (is_array($dateFormat)) {
list($newDateFormat, $timeFormat) = $dateFormat;
$dateFormat = $newDateFormat;
} else ... | php | public static function parseDateTime($time, $format = null)
{
$dateFormat = $format ?: static::$_toStringFormat;
$timeFormat = $pattern = null;
if (is_array($dateFormat)) {
list($newDateFormat, $timeFormat) = $dateFormat;
$dateFormat = $newDateFormat;
} else ... | [
"public",
"static",
"function",
"parseDateTime",
"(",
"$",
"time",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"dateFormat",
"=",
"$",
"format",
"?",
":",
"static",
"::",
"$",
"_toStringFormat",
";",
"$",
"timeFormat",
"=",
"$",
"pattern",
"=",
"nu... | Returns a new Time object after parsing the provided time string based on
the passed or configured date time format. This method is locale dependent,
Any string that is passed to this function will be interpreted as a locale
dependent string.
When no $format is provided, the `toString` format will be used.
If it was ... | [
"Returns",
"a",
"new",
"Time",
"object",
"after",
"parsing",
"the",
"provided",
"time",
"string",
"based",
"on",
"the",
"passed",
"or",
"configured",
"date",
"time",
"format",
".",
"This",
"method",
"is",
"locale",
"dependent",
"Any",
"string",
"that",
"is",... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/DateFormatTrait.php#L305-L341 |
211,077 | cakephp/cakephp | src/Database/Schema/Collection.php | Collection.listTables | public function listTables()
{
list($sql, $params) = $this->_dialect->listTablesSql($this->_connection->config());
$result = [];
$statement = $this->_connection->execute($sql, $params);
while ($row = $statement->fetch()) {
$result[] = $row[0];
}
$statement... | php | public function listTables()
{
list($sql, $params) = $this->_dialect->listTablesSql($this->_connection->config());
$result = [];
$statement = $this->_connection->execute($sql, $params);
while ($row = $statement->fetch()) {
$result[] = $row[0];
}
$statement... | [
"public",
"function",
"listTables",
"(",
")",
"{",
"list",
"(",
"$",
"sql",
",",
"$",
"params",
")",
"=",
"$",
"this",
"->",
"_dialect",
"->",
"listTablesSql",
"(",
"$",
"this",
"->",
"_connection",
"->",
"config",
"(",
")",
")",
";",
"$",
"result",
... | Get the list of tables available in the current connection.
@return array The list of tables in the connected database/schema. | [
"Get",
"the",
"list",
"of",
"tables",
"available",
"in",
"the",
"current",
"connection",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Schema/Collection.php#L60-L71 |
211,078 | cakephp/cakephp | src/Database/Schema/Collection.php | Collection.describe | public function describe($name, array $options = [])
{
$config = $this->_connection->config();
if (strpos($name, '.')) {
list($config['schema'], $name) = explode('.', $name);
}
$table = new TableSchema($name);
$this->_reflect('Column', $name, $config, $table);
... | php | public function describe($name, array $options = [])
{
$config = $this->_connection->config();
if (strpos($name, '.')) {
list($config['schema'], $name) = explode('.', $name);
}
$table = new TableSchema($name);
$this->_reflect('Column', $name, $config, $table);
... | [
"public",
"function",
"describe",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"_connection",
"->",
"config",
"(",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'.'",
")"... | Get the column metadata for a table.
Caching will be applied if `cacheMetadata` key is present in the Connection
configuration options. Defaults to _cake_model_ when true.
### Options
- `forceRefresh` - Set to true to force rebuilding the cached metadata.
Defaults to false.
@param string $name The name of the table... | [
"Get",
"the",
"column",
"metadata",
"for",
"a",
"table",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Schema/Collection.php#L89-L107 |
211,079 | cakephp/cakephp | src/Database/Schema/Collection.php | Collection._reflect | protected function _reflect($stage, $name, $config, $schema)
{
$describeMethod = "describe{$stage}Sql";
$convertMethod = "convert{$stage}Description";
list($sql, $params) = $this->_dialect->{$describeMethod}($name, $config);
if (empty($sql)) {
return;
}
t... | php | protected function _reflect($stage, $name, $config, $schema)
{
$describeMethod = "describe{$stage}Sql";
$convertMethod = "convert{$stage}Description";
list($sql, $params) = $this->_dialect->{$describeMethod}($name, $config);
if (empty($sql)) {
return;
}
t... | [
"protected",
"function",
"_reflect",
"(",
"$",
"stage",
",",
"$",
"name",
",",
"$",
"config",
",",
"$",
"schema",
")",
"{",
"$",
"describeMethod",
"=",
"\"describe{$stage}Sql\"",
";",
"$",
"convertMethod",
"=",
"\"convert{$stage}Description\"",
";",
"list",
"(... | Helper method for running each step of the reflection process.
@param string $stage The stage name.
@param string $name The table name.
@param array $config The config data.
@param \Cake\Database\Schema\TableSchema $schema The table instance
@return void
@throws \Cake\Database\Exception on query failure. | [
"Helper",
"method",
"for",
"running",
"each",
"step",
"of",
"the",
"reflection",
"process",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Schema/Collection.php#L119-L137 |
211,080 | cakephp/cakephp | src/Database/TypeMapTrait.php | TypeMapTrait.defaultTypes | public function defaultTypes(array $types = null)
{
deprecationWarning(
'TypeMapTrait::defaultTypes() is deprecated. ' .
'Use TypeMapTrait::setDefaultTypes()/getDefaultTypes() instead.'
);
if ($types !== null) {
return $this->setDefaultTypes($types);
... | php | public function defaultTypes(array $types = null)
{
deprecationWarning(
'TypeMapTrait::defaultTypes() is deprecated. ' .
'Use TypeMapTrait::setDefaultTypes()/getDefaultTypes() instead.'
);
if ($types !== null) {
return $this->setDefaultTypes($types);
... | [
"public",
"function",
"defaultTypes",
"(",
"array",
"$",
"types",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'TypeMapTrait::defaultTypes() is deprecated. '",
".",
"'Use TypeMapTrait::setDefaultTypes()/getDefaultTypes() instead.'",
")",
";",
"if",
"(",
"$",
"types",
... | Allows setting default types when chaining query
@deprecated 3.4.0 Use setDefaultTypes()/getDefaultTypes() instead.
@param array|null $types The array of types to set.
@return $this|array | [
"Allows",
"setting",
"default",
"types",
"when",
"chaining",
"query"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/TypeMapTrait.php#L109-L120 |
211,081 | cakephp/cakephp | src/View/HelperRegistry.php | HelperRegistry.__isset | public function __isset($helper)
{
if (isset($this->_loaded[$helper])) {
return true;
}
try {
$this->load($helper);
} catch (Exception\MissingHelperException $exception) {
if ($this->_View->getPlugin()) {
$this->load($this->_View->... | php | public function __isset($helper)
{
if (isset($this->_loaded[$helper])) {
return true;
}
try {
$this->load($helper);
} catch (Exception\MissingHelperException $exception) {
if ($this->_View->getPlugin()) {
$this->load($this->_View->... | [
"public",
"function",
"__isset",
"(",
"$",
"helper",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_loaded",
"[",
"$",
"helper",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"$",
"this",
"->",
"load",
"(",
"$",
"helper",
... | Tries to lazy load a helper based on its name, if it cannot be found
in the application folder, then it tries looking under the current plugin
if any
@param string $helper The helper name to be loaded
@return bool whether the helper could be loaded or not
@throws \Cake\View\Exception\MissingHelperException When a help... | [
"Tries",
"to",
"lazy",
"load",
"a",
"helper",
"based",
"on",
"its",
"name",
"if",
"it",
"cannot",
"be",
"found",
"in",
"the",
"application",
"folder",
"then",
"it",
"tries",
"looking",
"under",
"the",
"current",
"plugin",
"if",
"any"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/HelperRegistry.php#L60-L81 |
211,082 | cakephp/cakephp | src/View/HelperRegistry.php | HelperRegistry._create | protected function _create($class, $alias, $settings)
{
$instance = new $class($this->_View, $settings);
$enable = isset($settings['enabled']) ? $settings['enabled'] : true;
if ($enable) {
$this->getEventManager()->on($instance);
}
return $instance;
} | php | protected function _create($class, $alias, $settings)
{
$instance = new $class($this->_View, $settings);
$enable = isset($settings['enabled']) ? $settings['enabled'] : true;
if ($enable) {
$this->getEventManager()->on($instance);
}
return $instance;
} | [
"protected",
"function",
"_create",
"(",
"$",
"class",
",",
"$",
"alias",
",",
"$",
"settings",
")",
"{",
"$",
"instance",
"=",
"new",
"$",
"class",
"(",
"$",
"this",
"->",
"_View",
",",
"$",
"settings",
")",
";",
"$",
"enable",
"=",
"isset",
"(",
... | Create the helper instance.
Part of the template method for Cake\Core\ObjectRegistry::load()
Enabled helpers will be registered with the event manager.
@param string $class The class to create.
@param string $alias The alias of the loaded helper.
@param array $settings An array of settings to use for the helper.
@ret... | [
"Create",
"the",
"helper",
"instance",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/HelperRegistry.php#L144-L154 |
211,083 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._getPaths | protected function _getPaths()
{
$defaultPath = APP;
while (true) {
$currentPaths = count($this->_paths) > 0 ? $this->_paths : ['None'];
$message = sprintf(
"Current paths: %s\nWhat is the path you would like to extract?\n[Q]uit [D]one",
implod... | php | protected function _getPaths()
{
$defaultPath = APP;
while (true) {
$currentPaths = count($this->_paths) > 0 ? $this->_paths : ['None'];
$message = sprintf(
"Current paths: %s\nWhat is the path you would like to extract?\n[Q]uit [D]one",
implod... | [
"protected",
"function",
"_getPaths",
"(",
")",
"{",
"$",
"defaultPath",
"=",
"APP",
";",
"while",
"(",
"true",
")",
"{",
"$",
"currentPaths",
"=",
"count",
"(",
"$",
"this",
"->",
"_paths",
")",
">",
"0",
"?",
"$",
"this",
"->",
"_paths",
":",
"["... | Method to interact with the User and get path selections.
@return void | [
"Method",
"to",
"interact",
"with",
"the",
"User",
"and",
"get",
"path",
"selections",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L141-L172 |
211,084 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._addTranslation | protected function _addTranslation($domain, $msgid, $details = [])
{
$context = isset($details['msgctxt']) ? $details['msgctxt'] : '';
if (empty($this->_translations[$domain][$msgid][$context])) {
$this->_translations[$domain][$msgid][$context] = [
'msgid_plural' => fals... | php | protected function _addTranslation($domain, $msgid, $details = [])
{
$context = isset($details['msgctxt']) ? $details['msgctxt'] : '';
if (empty($this->_translations[$domain][$msgid][$context])) {
$this->_translations[$domain][$msgid][$context] = [
'msgid_plural' => fals... | [
"protected",
"function",
"_addTranslation",
"(",
"$",
"domain",
",",
"$",
"msgid",
",",
"$",
"details",
"=",
"[",
"]",
")",
"{",
"$",
"context",
"=",
"isset",
"(",
"$",
"details",
"[",
"'msgctxt'",
"]",
")",
"?",
"$",
"details",
"[",
"'msgctxt'",
"]"... | Add a translation to the internal translations property
Takes care of duplicate translations
@param string $domain The domain
@param string $msgid The message string
@param array $details Context and plural form if any, file and line references
@return void | [
"Add",
"a",
"translation",
"to",
"the",
"internal",
"translations",
"property"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L283-L301 |
211,085 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._extractTokens | protected function _extractTokens()
{
/** @var \Cake\Shell\Helper\ProgressHelper $progress */
$progress = $this->helper('progress');
$progress->init(['total' => count($this->_files)]);
$isVerbose = $this->param('verbose');
$functions = [
'__' => ['singular'],
... | php | protected function _extractTokens()
{
/** @var \Cake\Shell\Helper\ProgressHelper $progress */
$progress = $this->helper('progress');
$progress->init(['total' => count($this->_files)]);
$isVerbose = $this->param('verbose');
$functions = [
'__' => ['singular'],
... | [
"protected",
"function",
"_extractTokens",
"(",
")",
"{",
"/** @var \\Cake\\Shell\\Helper\\ProgressHelper $progress */",
"$",
"progress",
"=",
"$",
"this",
"->",
"helper",
"(",
"'progress'",
")",
";",
"$",
"progress",
"->",
"init",
"(",
"[",
"'total'",
"=>",
"coun... | Extract tokens out of all files to be processed
@return void | [
"Extract",
"tokens",
"out",
"of",
"all",
"files",
"to",
"be",
"processed"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L401-L449 |
211,086 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._buildFiles | protected function _buildFiles()
{
$paths = $this->_paths;
$paths[] = realpath(APP) . DIRECTORY_SEPARATOR;
usort($paths, function ($a, $b) {
return strlen($a) - strlen($b);
});
foreach ($this->_translations as $domain => $translations) {
foreach ($tr... | php | protected function _buildFiles()
{
$paths = $this->_paths;
$paths[] = realpath(APP) . DIRECTORY_SEPARATOR;
usort($paths, function ($a, $b) {
return strlen($a) - strlen($b);
});
foreach ($this->_translations as $domain => $translations) {
foreach ($tr... | [
"protected",
"function",
"_buildFiles",
"(",
")",
"{",
"$",
"paths",
"=",
"$",
"this",
"->",
"_paths",
";",
"$",
"paths",
"[",
"]",
"=",
"realpath",
"(",
"APP",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"usort",
"(",
"$",
"paths",
",",
"function",
"(",
"... | Build the translate template file contents out of obtained strings
@return void | [
"Build",
"the",
"translate",
"template",
"file",
"contents",
"out",
"of",
"obtained",
"strings"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L524-L571 |
211,087 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._store | protected function _store($domain, $header, $sentence)
{
if (!isset($this->_storage[$domain])) {
$this->_storage[$domain] = [];
}
if (!isset($this->_storage[$domain][$sentence])) {
$this->_storage[$domain][$sentence] = $header;
} else {
$this->_sto... | php | protected function _store($domain, $header, $sentence)
{
if (!isset($this->_storage[$domain])) {
$this->_storage[$domain] = [];
}
if (!isset($this->_storage[$domain][$sentence])) {
$this->_storage[$domain][$sentence] = $header;
} else {
$this->_sto... | [
"protected",
"function",
"_store",
"(",
"$",
"domain",
",",
"$",
"header",
",",
"$",
"sentence",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_storage",
"[",
"$",
"domain",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_storage",
"[",
"$... | Prepare a file to be stored
@param string $domain The domain
@param string $header The header content.
@param string $sentence The sentence to store.
@return void | [
"Prepare",
"a",
"file",
"to",
"be",
"stored"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L581-L591 |
211,088 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._writeFiles | protected function _writeFiles()
{
$overwriteAll = false;
if (!empty($this->params['overwrite'])) {
$overwriteAll = true;
}
foreach ($this->_storage as $domain => $sentences) {
$output = $this->_writeHeader();
foreach ($sentences as $sentence => $h... | php | protected function _writeFiles()
{
$overwriteAll = false;
if (!empty($this->params['overwrite'])) {
$overwriteAll = true;
}
foreach ($this->_storage as $domain => $sentences) {
$output = $this->_writeHeader();
foreach ($sentences as $sentence => $h... | [
"protected",
"function",
"_writeFiles",
"(",
")",
"{",
"$",
"overwriteAll",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"params",
"[",
"'overwrite'",
"]",
")",
")",
"{",
"$",
"overwriteAll",
"=",
"true",
";",
"}",
"foreach",
"... | Write the files that need to be stored
@return void | [
"Write",
"the",
"files",
"that",
"need",
"to",
"be",
"stored"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L598-L640 |
211,089 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._writeHeader | protected function _writeHeader()
{
$output = "# LANGUAGE translation of CakePHP Application\n";
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
$output .= "#\n";
$output .= "#, fuzzy\n";
$output .= "msgid \"\"\n";
$output .= "msgstr \"\"\n";
$output .= ... | php | protected function _writeHeader()
{
$output = "# LANGUAGE translation of CakePHP Application\n";
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
$output .= "#\n";
$output .= "#, fuzzy\n";
$output .= "msgid \"\"\n";
$output .= "msgstr \"\"\n";
$output .= ... | [
"protected",
"function",
"_writeHeader",
"(",
")",
"{",
"$",
"output",
"=",
"\"# LANGUAGE translation of CakePHP Application\\n\"",
";",
"$",
"output",
".=",
"\"# Copyright YEAR NAME <EMAIL@ADDRESS>\\n\"",
";",
"$",
"output",
".=",
"\"#\\n\"",
";",
"$",
"output",
".=",
... | Build the translation template header
@return string Translation template header | [
"Build",
"the",
"translation",
"template",
"header"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L647-L666 |
211,090 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._getStrings | protected function _getStrings(&$position, $target)
{
$strings = [];
$count = count($strings);
while ($count < $target && ($this->_tokens[$position] === ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING || $this->_tokens[$position][0] == T_LNUMBER)) {
$count = cou... | php | protected function _getStrings(&$position, $target)
{
$strings = [];
$count = count($strings);
while ($count < $target && ($this->_tokens[$position] === ',' || $this->_tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING || $this->_tokens[$position][0] == T_LNUMBER)) {
$count = cou... | [
"protected",
"function",
"_getStrings",
"(",
"&",
"$",
"position",
",",
"$",
"target",
")",
"{",
"$",
"strings",
"=",
"[",
"]",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"strings",
")",
";",
"while",
"(",
"$",
"count",
"<",
"$",
"target",
"&&",
... | Get the strings from the position forward
@param int $position Actual position on tokens array
@param int $target Number of strings to extract
@return array Strings extracted | [
"Get",
"the",
"strings",
"from",
"the",
"position",
"forward"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L675-L699 |
211,091 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._formatString | protected function _formatString($string)
{
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
if ($quote === '"') {
$string = stripcslashes($string);
} else {
$string = strtr($string, ["\\'" => "'", '\\\\' => '\\']);
}
$string =... | php | protected function _formatString($string)
{
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
if ($quote === '"') {
$string = stripcslashes($string);
} else {
$string = strtr($string, ["\\'" => "'", '\\\\' => '\\']);
}
$string =... | [
"protected",
"function",
"_formatString",
"(",
"$",
"string",
")",
"{",
"$",
"quote",
"=",
"substr",
"(",
"$",
"string",
",",
"0",
",",
"1",
")",
";",
"$",
"string",
"=",
"substr",
"(",
"$",
"string",
",",
"1",
",",
"-",
"1",
")",
";",
"if",
"(... | Format a string to be added as a translatable string
@param string $string String to format
@return string Formatted string | [
"Format",
"a",
"string",
"to",
"be",
"added",
"as",
"a",
"translatable",
"string"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L707-L719 |
211,092 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._markerError | protected function _markerError($file, $line, $marker, $count)
{
if (strpos($this->_file, CAKE_CORE_INCLUDE_PATH) === false) {
$this->_countMarkerError++;
}
if (!$this->_markerError) {
return;
}
$this->err(sprintf("Invalid marker content in %s:%s\n* ... | php | protected function _markerError($file, $line, $marker, $count)
{
if (strpos($this->_file, CAKE_CORE_INCLUDE_PATH) === false) {
$this->_countMarkerError++;
}
if (!$this->_markerError) {
return;
}
$this->err(sprintf("Invalid marker content in %s:%s\n* ... | [
"protected",
"function",
"_markerError",
"(",
"$",
"file",
",",
"$",
"line",
",",
"$",
"marker",
",",
"$",
"count",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"this",
"->",
"_file",
",",
"CAKE_CORE_INCLUDE_PATH",
")",
"===",
"false",
")",
"{",
"$",
"th... | Indicate an invalid marker on a processed file
@param string $file File where invalid marker resides
@param int $line Line number
@param string $marker Marker found
@param int $count Count
@return void | [
"Indicate",
"an",
"invalid",
"marker",
"on",
"a",
"processed",
"file"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L730-L761 |
211,093 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._searchFiles | protected function _searchFiles()
{
$pattern = false;
if (!empty($this->_exclude)) {
$exclude = [];
foreach ($this->_exclude as $e) {
if (DIRECTORY_SEPARATOR !== '\\' && $e[0] !== DIRECTORY_SEPARATOR) {
$e = DIRECTORY_SEPARATOR . $e;
... | php | protected function _searchFiles()
{
$pattern = false;
if (!empty($this->_exclude)) {
$exclude = [];
foreach ($this->_exclude as $e) {
if (DIRECTORY_SEPARATOR !== '\\' && $e[0] !== DIRECTORY_SEPARATOR) {
$e = DIRECTORY_SEPARATOR . $e;
... | [
"protected",
"function",
"_searchFiles",
"(",
")",
"{",
"$",
"pattern",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_exclude",
")",
")",
"{",
"$",
"exclude",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_exclude"... | Search files that may contain translatable strings
@return void | [
"Search",
"files",
"that",
"may",
"contain",
"translatable",
"strings"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L768-L792 |
211,094 | cakephp/cakephp | src/Shell/Task/ExtractTask.php | ExtractTask._isPathUsable | protected function _isPathUsable($path)
{
if (!is_dir($path)) {
mkdir($path, 0770, true);
}
return is_dir($path) && is_writable($path);
} | php | protected function _isPathUsable($path)
{
if (!is_dir($path)) {
mkdir($path, 0770, true);
}
return is_dir($path) && is_writable($path);
} | [
"protected",
"function",
"_isPathUsable",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"mkdir",
"(",
"$",
"path",
",",
"0770",
",",
"true",
")",
";",
"}",
"return",
"is_dir",
"(",
"$",
"path",
")",
"&&",
... | Checks whether or not a given path is usable for writing.
@param string $path Path to folder
@return bool true if it exists and is writable, false otherwise | [
"Checks",
"whether",
"or",
"not",
"a",
"given",
"path",
"is",
"usable",
"for",
"writing",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/Task/ExtractTask.php#L811-L818 |
211,095 | cakephp/cakephp | src/I18n/Formatter/IcuFormatter.php | IcuFormatter.format | public function format($locale, $message, array $vars)
{
unset($vars['_singular'], $vars['_count']);
return $this->_formatMessage($locale, $message, $vars);
} | php | public function format($locale, $message, array $vars)
{
unset($vars['_singular'], $vars['_count']);
return $this->_formatMessage($locale, $message, $vars);
} | [
"public",
"function",
"format",
"(",
"$",
"locale",
",",
"$",
"message",
",",
"array",
"$",
"vars",
")",
"{",
"unset",
"(",
"$",
"vars",
"[",
"'_singular'",
"]",
",",
"$",
"vars",
"[",
"'_count'",
"]",
")",
";",
"return",
"$",
"this",
"->",
"_forma... | Returns a string with all passed variables interpolated into the original
message. Variables are interpolated using the MessageFormatter class.
@param string $locale The locale in which the message is presented.
@param string|array $message The message to be translated
@param array $vars The list of values to interpol... | [
"Returns",
"a",
"string",
"with",
"all",
"passed",
"variables",
"interpolated",
"into",
"the",
"original",
"message",
".",
"Variables",
"are",
"interpolated",
"using",
"the",
"MessageFormatter",
"class",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/Formatter/IcuFormatter.php#L39-L44 |
211,096 | cakephp/cakephp | src/I18n/Formatter/IcuFormatter.php | IcuFormatter._formatMessage | protected function _formatMessage($locale, $message, $vars)
{
if ($message === '') {
return $message;
}
// Using procedural style as it showed twice as fast as
// its counterpart in PHP 5.5
$result = MessageFormatter::formatMessage($locale, $message, $vars);
... | php | protected function _formatMessage($locale, $message, $vars)
{
if ($message === '') {
return $message;
}
// Using procedural style as it showed twice as fast as
// its counterpart in PHP 5.5
$result = MessageFormatter::formatMessage($locale, $message, $vars);
... | [
"protected",
"function",
"_formatMessage",
"(",
"$",
"locale",
",",
"$",
"message",
",",
"$",
"vars",
")",
"{",
"if",
"(",
"$",
"message",
"===",
"''",
")",
"{",
"return",
"$",
"message",
";",
"}",
"// Using procedural style as it showed twice as fast as",
"//... | Does the actual formatting using the MessageFormatter class
@param string $locale The locale in which the message is presented.
@param string|array $message The message to be translated
@param array $vars The list of values to interpolate in the message
@return string The formatted message
@throws \Aura\Intl\Exception... | [
"Does",
"the",
"actual",
"formatting",
"using",
"the",
"MessageFormatter",
"class"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/Formatter/IcuFormatter.php#L58-L80 |
211,097 | cakephp/cakephp | src/Log/Engine/ConsoleLog.php | ConsoleLog.log | public function log($level, $message, array $context = [])
{
$message = $this->_format($message, $context);
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($level) . ': ' . $message;
return (bool)$this->_output->write(sprintf('<%s>%s</%s>', $level, $output, $level));
} | php | public function log($level, $message, array $context = [])
{
$message = $this->_format($message, $context);
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($level) . ': ' . $message;
return (bool)$this->_output->write(sprintf('<%s>%s</%s>', $level, $output, $level));
} | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"_format",
"(",
"$",
"message",
",",
"$",
"context",
")",
";",
"$",
"output",
"=",... | Implements writing to console.
@param string $level The severity level of log you are making.
@param string $message The message you want to log.
@param array $context Additional information about the logged message
@return bool success of write. | [
"Implements",
"writing",
"to",
"console",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Log/Engine/ConsoleLog.php#L89-L95 |
211,098 | cakephp/cakephp | src/ORM/Association.php | Association.setName | public function setName($name)
{
if ($this->_targetTable !== null) {
$alias = $this->_targetTable->getAlias();
if ($alias !== $name) {
throw new InvalidArgumentException('Association name does not match target table alias.');
}
}
$this->_n... | php | public function setName($name)
{
if ($this->_targetTable !== null) {
$alias = $this->_targetTable->getAlias();
if ($alias !== $name) {
throw new InvalidArgumentException('Association name does not match target table alias.');
}
}
$this->_n... | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_targetTable",
"!==",
"null",
")",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
"_targetTable",
"->",
"getAlias",
"(",
")",
";",
"if",
"(",
"$",
"alias",
"!==... | Sets the name for this association, usually the alias
assigned to the target associated table
@param string $name Name to be assigned
@return $this | [
"Sets",
"the",
"name",
"for",
"this",
"association",
"usually",
"the",
"alias",
"assigned",
"to",
"the",
"target",
"associated",
"table"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association.php#L249-L261 |
211,099 | cakephp/cakephp | src/ORM/Association.php | Association.name | public function name($name = null)
{
deprecationWarning(
get_called_class() . '::name() is deprecated. ' .
'Use setName()/getName() instead.'
);
if ($name !== null) {
$this->setName($name);
}
return $this->getName();
} | php | public function name($name = null)
{
deprecationWarning(
get_called_class() . '::name() is deprecated. ' .
'Use setName()/getName() instead.'
);
if ($name !== null) {
$this->setName($name);
}
return $this->getName();
} | [
"public",
"function",
"name",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"get_called_class",
"(",
")",
".",
"'::name() is deprecated. '",
".",
"'Use setName()/getName() instead.'",
")",
";",
"if",
"(",
"$",
"name",
"!==",
"null",
")",
... | Sets the name for this association.
@deprecated 3.4.0 Use setName()/getName() instead.
@param string|null $name Name to be assigned
@return string | [
"Sets",
"the",
"name",
"for",
"this",
"association",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association.php#L281-L292 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.