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,400 | cakephp/cakephp | src/View/Helper/PaginatorHelper.php | PaginatorHelper.counter | public function counter($options = [])
{
if (is_string($options)) {
$options = ['format' => $options];
}
$options += [
'model' => $this->defaultModel(),
'format' => 'pages',
];
$paging = $this->params($options['model']);
if (!$pag... | php | public function counter($options = [])
{
if (is_string($options)) {
$options = ['format' => $options];
}
$options += [
'model' => $this->defaultModel(),
'format' => 'pages',
];
$paging = $this->params($options['model']);
if (!$pag... | [
"public",
"function",
"counter",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"options",
")",
")",
"{",
"$",
"options",
"=",
"[",
"'format'",
"=>",
"$",
"options",
"]",
";",
"}",
"$",
"options",
"+=",
"[",
"'mod... | Returns a counter string for the paged result set
### Options
- `model` The model to use, defaults to PaginatorHelper::defaultModel();
- `format` The format string you want to use, defaults to 'pages' Which generates output like '1 of 5'
set to 'range' to generate output like '1 - 3 of 13'. Can also be set to a custo... | [
"Returns",
"a",
"counter",
"string",
"for",
"the",
"paged",
"result",
"set"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/PaginatorHelper.php#L720-L759 |
211,401 | cakephp/cakephp | src/View/Helper/PaginatorHelper.php | PaginatorHelper._getNumbersStartAndEnd | protected function _getNumbersStartAndEnd($params, $options)
{
$half = (int)($options['modulus'] / 2);
$end = max(1 + $options['modulus'], $params['page'] + $half);
$start = min($params['pageCount'] - $options['modulus'], $params['page'] - $half - $options['modulus'] % 2);
if ($opti... | php | protected function _getNumbersStartAndEnd($params, $options)
{
$half = (int)($options['modulus'] / 2);
$end = max(1 + $options['modulus'], $params['page'] + $half);
$start = min($params['pageCount'] - $options['modulus'], $params['page'] - $half - $options['modulus'] % 2);
if ($opti... | [
"protected",
"function",
"_getNumbersStartAndEnd",
"(",
"$",
"params",
",",
"$",
"options",
")",
"{",
"$",
"half",
"=",
"(",
"int",
")",
"(",
"$",
"options",
"[",
"'modulus'",
"]",
"/",
"2",
")",
";",
"$",
"end",
"=",
"max",
"(",
"1",
"+",
"$",
"... | Calculates the start and end for the pagination numbers.
@param array $params Params from the numbers() method.
@param array $options Options from the numbers() method.
@return array An array with the start and end numbers. | [
"Calculates",
"the",
"start",
"and",
"end",
"for",
"the",
"pagination",
"numbers",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/PaginatorHelper.php#L837-L863 |
211,402 | cakephp/cakephp | src/View/Helper/PaginatorHelper.php | PaginatorHelper._formatNumber | protected function _formatNumber($templater, $options)
{
$url = array_merge($options['url'], ['page' => $options['page']]);
$vars = [
'text' => $options['text'],
'url' => $this->generateUrl($url, $options['model']),
];
return $templater->format('number', $var... | php | protected function _formatNumber($templater, $options)
{
$url = array_merge($options['url'], ['page' => $options['page']]);
$vars = [
'text' => $options['text'],
'url' => $this->generateUrl($url, $options['model']),
];
return $templater->format('number', $var... | [
"protected",
"function",
"_formatNumber",
"(",
"$",
"templater",
",",
"$",
"options",
")",
"{",
"$",
"url",
"=",
"array_merge",
"(",
"$",
"options",
"[",
"'url'",
"]",
",",
"[",
"'page'",
"=>",
"$",
"options",
"[",
"'page'",
"]",
"]",
")",
";",
"$",
... | Formats a number for the paginator number output.
@param \Cake\View\StringTemplate $templater StringTemplate instance.
@param array $options Options from the numbers() method.
@return string | [
"Formats",
"a",
"number",
"for",
"the",
"paginator",
"number",
"output",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/PaginatorHelper.php#L872-L881 |
211,403 | cakephp/cakephp | src/View/Helper/PaginatorHelper.php | PaginatorHelper.meta | public function meta(array $options = [])
{
$options += [
'model' => null,
'block' => false,
'prev' => true,
'next' => true,
'first' => false,
'last' => false
];
$model = isset($options['mode... | php | public function meta(array $options = [])
{
$options += [
'model' => null,
'block' => false,
'prev' => true,
'next' => true,
'first' => false,
'last' => false
];
$model = isset($options['mode... | [
"public",
"function",
"meta",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'model'",
"=>",
"null",
",",
"'block'",
"=>",
"false",
",",
"'prev'",
"=>",
"true",
",",
"'next'",
"=>",
"true",
",",
"'first'",
"=>",
... | Returns the meta-links for a paginated result set.
```
echo $this->Paginator->meta();
```
Echos the links directly, will output nothing if there is neither a previous nor next page.
```
$this->Paginator->meta(['block' => true]);
```
Will append the output of the meta function to the named block - if true is passed ... | [
"Returns",
"the",
"meta",
"-",
"links",
"for",
"a",
"paginated",
"result",
"set",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/PaginatorHelper.php#L1175-L1219 |
211,404 | cakephp/cakephp | src/View/Helper/PaginatorHelper.php | PaginatorHelper.limitControl | public function limitControl(array $limits = [], $default = null, array $options = [])
{
$out = $this->Form->create(null, ['type' => 'get']);
if (empty($default) || !is_numeric($default)) {
$default = $this->param('perPage');
}
if (empty($limits)) {
$limits ... | php | public function limitControl(array $limits = [], $default = null, array $options = [])
{
$out = $this->Form->create(null, ['type' => 'get']);
if (empty($default) || !is_numeric($default)) {
$default = $this->param('perPage');
}
if (empty($limits)) {
$limits ... | [
"public",
"function",
"limitControl",
"(",
"array",
"$",
"limits",
"=",
"[",
"]",
",",
"$",
"default",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"out",
"=",
"$",
"this",
"->",
"Form",
"->",
"create",
"(",
"null",
",... | Dropdown select for pagination limit.
This will generate a wrapping form.
@param array $limits The options array.
@param int|null $default Default option for pagination limit. Defaults to `$this->param('perPage')`.
@param array $options Options for Select tag attributes like class, id or event
@return string html outp... | [
"Dropdown",
"select",
"for",
"pagination",
"limit",
".",
"This",
"will",
"generate",
"a",
"wrapping",
"form",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/PaginatorHelper.php#L1240-L1266 |
211,405 | cakephp/cakephp | src/Database/SqlDialectTrait.php | SqlDialectTrait.queryTranslator | public function queryTranslator($type)
{
return function ($query) use ($type) {
if ($this->isAutoQuotingEnabled()) {
$query = (new IdentifierQuoter($this))->quote($query);
}
/** @var \Cake\ORM\Query $query */
$query = $this->{'_' . $type . 'Qu... | php | public function queryTranslator($type)
{
return function ($query) use ($type) {
if ($this->isAutoQuotingEnabled()) {
$query = (new IdentifierQuoter($this))->quote($query);
}
/** @var \Cake\ORM\Query $query */
$query = $this->{'_' . $type . 'Qu... | [
"public",
"function",
"queryTranslator",
"(",
"$",
"type",
")",
"{",
"return",
"function",
"(",
"$",
"query",
")",
"use",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isAutoQuotingEnabled",
"(",
")",
")",
"{",
"$",
"query",
"=",
"(",
... | Returns a callable function that will be used to transform a passed Query object.
This function, in turn, will return an instance of a Query object that has been
transformed to accommodate any specificities of the SQL dialect in use.
@param string $type the type of query to be transformed
(select, insert, update, dele... | [
"Returns",
"a",
"callable",
"function",
"that",
"will",
"be",
"used",
"to",
"transform",
"a",
"passed",
"Query",
"object",
".",
"This",
"function",
"in",
"turn",
"will",
"return",
"an",
"instance",
"of",
"a",
"Query",
"object",
"that",
"has",
"been",
"tran... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/SqlDialectTrait.php#L91-L115 |
211,406 | cakephp/cakephp | src/Database/SqlDialectTrait.php | SqlDialectTrait._deleteQueryTranslator | protected function _deleteQueryTranslator($query)
{
$hadAlias = false;
$tables = [];
foreach ($query->clause('from') as $alias => $table) {
if (is_string($alias)) {
$hadAlias = true;
}
$tables[] = $table;
}
if ($hadAlias) {
... | php | protected function _deleteQueryTranslator($query)
{
$hadAlias = false;
$tables = [];
foreach ($query->clause('from') as $alias => $table) {
if (is_string($alias)) {
$hadAlias = true;
}
$tables[] = $table;
}
if ($hadAlias) {
... | [
"protected",
"function",
"_deleteQueryTranslator",
"(",
"$",
"query",
")",
"{",
"$",
"hadAlias",
"=",
"false",
";",
"$",
"tables",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"query",
"->",
"clause",
"(",
"'from'",
")",
"as",
"$",
"alias",
"=>",
"$",
"t... | Apply translation steps to delete queries.
Chops out aliases on delete query conditions as most database dialects do not
support aliases in delete queries. This also removes aliases
in table names as they frequently don't work either.
We are intentionally not supporting deletes with joins as they have even poorer sup... | [
"Apply",
"translation",
"steps",
"to",
"delete",
"queries",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/SqlDialectTrait.php#L169-L188 |
211,407 | cakephp/cakephp | src/Database/SqlDialectTrait.php | SqlDialectTrait._removeAliasesFromConditions | protected function _removeAliasesFromConditions($query)
{
if ($query->clause('join')) {
throw new \RuntimeException(
'Aliases are being removed from conditions for UPDATE/DELETE queries, ' .
'this can break references to joined tables.'
);
}
... | php | protected function _removeAliasesFromConditions($query)
{
if ($query->clause('join')) {
throw new \RuntimeException(
'Aliases are being removed from conditions for UPDATE/DELETE queries, ' .
'this can break references to joined tables.'
);
}
... | [
"protected",
"function",
"_removeAliasesFromConditions",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"clause",
"(",
"'join'",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Aliases are being removed from conditions for UPDATE/DELETE qu... | Removes aliases from the `WHERE` clause of a query.
@param \Cake\Database\Query $query The query to process.
@return \Cake\Database\Query The modified query.
@throws \RuntimeException In case the processed query contains any joins, as removing
aliases from the conditions can break references to the joined tables. | [
"Removes",
"aliases",
"from",
"the",
"WHERE",
"clause",
"of",
"a",
"query",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/SqlDialectTrait.php#L214-L243 |
211,408 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.add | public function add($alias, Association $association)
{
list(, $alias) = pluginSplit($alias);
return $this->_items[strtolower($alias)] = $association;
} | php | public function add($alias, Association $association)
{
list(, $alias) = pluginSplit($alias);
return $this->_items[strtolower($alias)] = $association;
} | [
"public",
"function",
"add",
"(",
"$",
"alias",
",",
"Association",
"$",
"association",
")",
"{",
"list",
"(",
",",
"$",
"alias",
")",
"=",
"pluginSplit",
"(",
"$",
"alias",
")",
";",
"return",
"$",
"this",
"->",
"_items",
"[",
"strtolower",
"(",
"$"... | Add an association to the collection
If the alias added contains a `.` the part preceding the `.` will be dropped.
This makes using plugins simpler as the Plugin.Class syntax is frequently used.
@param string $alias The association alias
@param \Cake\ORM\Association $association The association to add.
@return \Cake\... | [
"Add",
"an",
"association",
"to",
"the",
"collection"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L68-L73 |
211,409 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.load | public function load($className, $associated, array $options = [])
{
$options += [
'tableLocator' => $this->getTableLocator()
];
$association = new $className($associated, $options);
if (!$association instanceof Association) {
$message = sprintf('The associat... | php | public function load($className, $associated, array $options = [])
{
$options += [
'tableLocator' => $this->getTableLocator()
];
$association = new $className($associated, $options);
if (!$association instanceof Association) {
$message = sprintf('The associat... | [
"public",
"function",
"load",
"(",
"$",
"className",
",",
"$",
"associated",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'tableLocator'",
"=>",
"$",
"this",
"->",
"getTableLocator",
"(",
")",
"]",
";",
"$",
"ass... | Creates and adds the Association object to this collection.
@param string $className The name of association class.
@param string $associated The alias for the target table.
@param array $options List of options to configure the association definition.
@return \Cake\ORM\Association
@throws \InvalidArgumentException | [
"Creates",
"and",
"adds",
"the",
"Association",
"object",
"to",
"this",
"collection",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L84-L97 |
211,410 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.get | public function get($alias)
{
$alias = strtolower($alias);
if (isset($this->_items[$alias])) {
return $this->_items[$alias];
}
return null;
} | php | public function get($alias)
{
$alias = strtolower($alias);
if (isset($this->_items[$alias])) {
return $this->_items[$alias];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"alias",
")",
"{",
"$",
"alias",
"=",
"strtolower",
"(",
"$",
"alias",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_items",
"[",
"$",
"alias",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_... | Fetch an attached association by name.
@param string $alias The association alias to get.
@return \Cake\ORM\Association|null Either the association or null. | [
"Fetch",
"an",
"attached",
"association",
"by",
"name",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L105-L113 |
211,411 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.getByProperty | public function getByProperty($prop)
{
foreach ($this->_items as $assoc) {
if ($assoc->getProperty() === $prop) {
return $assoc;
}
}
return null;
} | php | public function getByProperty($prop)
{
foreach ($this->_items as $assoc) {
if ($assoc->getProperty() === $prop) {
return $assoc;
}
}
return null;
} | [
"public",
"function",
"getByProperty",
"(",
"$",
"prop",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_items",
"as",
"$",
"assoc",
")",
"{",
"if",
"(",
"$",
"assoc",
"->",
"getProperty",
"(",
")",
"===",
"$",
"prop",
")",
"{",
"return",
"$",
"asso... | Fetch an association by property name.
@param string $prop The property to find an association by.
@return \Cake\ORM\Association|null Either the association or null. | [
"Fetch",
"an",
"association",
"by",
"property",
"name",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L121-L130 |
211,412 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.getByType | public function getByType($class)
{
$class = array_map('strtolower', (array)$class);
$out = array_filter($this->_items, function ($assoc) use ($class) {
list(, $name) = namespaceSplit(get_class($assoc));
return in_array(strtolower($name), $class, true);
});
... | php | public function getByType($class)
{
$class = array_map('strtolower', (array)$class);
$out = array_filter($this->_items, function ($assoc) use ($class) {
list(, $name) = namespaceSplit(get_class($assoc));
return in_array(strtolower($name), $class, true);
});
... | [
"public",
"function",
"getByType",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"array_map",
"(",
"'strtolower'",
",",
"(",
"array",
")",
"$",
"class",
")",
";",
"$",
"out",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"_items",
",",
"function",
"... | Get an array of associations matching a specific type.
@param string|array $class The type of associations you want.
For example 'BelongsTo' or array like ['BelongsTo', 'HasOne']
@return array An array of Association objects.
@since 3.5.3 | [
"Get",
"an",
"array",
"of",
"associations",
"matching",
"a",
"specific",
"type",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L179-L190 |
211,413 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.saveParents | public function saveParents(Table $table, EntityInterface $entity, $associations, array $options = [])
{
if (empty($associations)) {
return true;
}
return $this->_saveAssociations($table, $entity, $associations, $options, false);
} | php | public function saveParents(Table $table, EntityInterface $entity, $associations, array $options = [])
{
if (empty($associations)) {
return true;
}
return $this->_saveAssociations($table, $entity, $associations, $options, false);
} | [
"public",
"function",
"saveParents",
"(",
"Table",
"$",
"table",
",",
"EntityInterface",
"$",
"entity",
",",
"$",
"associations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"associations",
")",
")",
"{",
"retur... | Save all the associations that are parents of the given entity.
Parent associations include any association where the given table
is the owning side.
@param \Cake\ORM\Table $table The table entity is for.
@param \Cake\Datasource\EntityInterface $entity The entity to save associated data for.
@param array $association... | [
"Save",
"all",
"the",
"associations",
"that",
"are",
"parents",
"of",
"the",
"given",
"entity",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L232-L239 |
211,414 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.saveChildren | public function saveChildren(Table $table, EntityInterface $entity, array $associations, array $options)
{
if (empty($associations)) {
return true;
}
return $this->_saveAssociations($table, $entity, $associations, $options, true);
} | php | public function saveChildren(Table $table, EntityInterface $entity, array $associations, array $options)
{
if (empty($associations)) {
return true;
}
return $this->_saveAssociations($table, $entity, $associations, $options, true);
} | [
"public",
"function",
"saveChildren",
"(",
"Table",
"$",
"table",
",",
"EntityInterface",
"$",
"entity",
",",
"array",
"$",
"associations",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"associations",
")",
")",
"{",
"return",
"tr... | Save all the associations that are children of the given entity.
Child associations include any association where the given table
is not the owning side.
@param \Cake\ORM\Table $table The table entity is for.
@param \Cake\Datasource\EntityInterface $entity The entity to save associated data for.
@param array $associa... | [
"Save",
"all",
"the",
"associations",
"that",
"are",
"children",
"of",
"the",
"given",
"entity",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L254-L261 |
211,415 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.cascadeDelete | public function cascadeDelete(EntityInterface $entity, array $options)
{
$noCascade = $this->_getNoCascadeItems($entity, $options);
foreach ($noCascade as $assoc) {
$assoc->cascadeDelete($entity, $options);
}
} | php | public function cascadeDelete(EntityInterface $entity, array $options)
{
$noCascade = $this->_getNoCascadeItems($entity, $options);
foreach ($noCascade as $assoc) {
$assoc->cascadeDelete($entity, $options);
}
} | [
"public",
"function",
"cascadeDelete",
"(",
"EntityInterface",
"$",
"entity",
",",
"array",
"$",
"options",
")",
"{",
"$",
"noCascade",
"=",
"$",
"this",
"->",
"_getNoCascadeItems",
"(",
"$",
"entity",
",",
"$",
"options",
")",
";",
"foreach",
"(",
"$",
... | Cascade a delete across the various associations.
Cascade first across associations for which cascadeCallbacks is true.
@param \Cake\Datasource\EntityInterface $entity The entity to delete associations for.
@param array $options The options used in the delete operation.
@return void | [
"Cascade",
"a",
"delete",
"across",
"the",
"various",
"associations",
".",
"Cascade",
"first",
"across",
"associations",
"for",
"which",
"cascadeCallbacks",
"is",
"true",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L332-L338 |
211,416 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection._getNoCascadeItems | protected function _getNoCascadeItems($entity, $options)
{
$noCascade = [];
foreach ($this->_items as $assoc) {
if (!$assoc->getCascadeCallbacks()) {
$noCascade[] = $assoc;
continue;
}
$assoc->cascadeDelete($entity, $options);
... | php | protected function _getNoCascadeItems($entity, $options)
{
$noCascade = [];
foreach ($this->_items as $assoc) {
if (!$assoc->getCascadeCallbacks()) {
$noCascade[] = $assoc;
continue;
}
$assoc->cascadeDelete($entity, $options);
... | [
"protected",
"function",
"_getNoCascadeItems",
"(",
"$",
"entity",
",",
"$",
"options",
")",
"{",
"$",
"noCascade",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_items",
"as",
"$",
"assoc",
")",
"{",
"if",
"(",
"!",
"$",
"assoc",
"->",
"... | Returns items that have no cascade callback.
@param \Cake\Datasource\EntityInterface $entity The entity to delete associations for.
@param array $options The options used in the delete operation.
@return \Cake\ORM\Association[] | [
"Returns",
"items",
"that",
"have",
"no",
"cascade",
"callback",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L347-L359 |
211,417 | cakephp/cakephp | src/ORM/AssociationCollection.php | AssociationCollection.normalizeKeys | public function normalizeKeys($keys)
{
if ($keys === true) {
$keys = $this->keys();
}
if (empty($keys)) {
return [];
}
return $this->_normalizeAssociations($keys);
} | php | public function normalizeKeys($keys)
{
if ($keys === true) {
$keys = $this->keys();
}
if (empty($keys)) {
return [];
}
return $this->_normalizeAssociations($keys);
} | [
"public",
"function",
"normalizeKeys",
"(",
"$",
"keys",
")",
"{",
"if",
"(",
"$",
"keys",
"===",
"true",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"keys",
"(",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"keys",
")",
")",
"{",
"return",
... | Returns an associative array of association names out a mixed
array. If true is passed, then it returns all association names
in this collection.
@param bool|array $keys the list of association names to normalize
@return array | [
"Returns",
"an",
"associative",
"array",
"of",
"association",
"names",
"out",
"a",
"mixed",
"array",
".",
"If",
"true",
"is",
"passed",
"then",
"it",
"returns",
"all",
"association",
"names",
"in",
"this",
"collection",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/AssociationCollection.php#L369-L380 |
211,418 | cakephp/cakephp | src/Database/Driver/Postgres.php | Postgres.setEncoding | public function setEncoding($encoding)
{
$this->connect();
$this->_connection->exec('SET NAMES ' . $this->_connection->quote($encoding));
} | php | public function setEncoding($encoding)
{
$this->connect();
$this->_connection->exec('SET NAMES ' . $this->_connection->quote($encoding));
} | [
"public",
"function",
"setEncoding",
"(",
"$",
"encoding",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"exec",
"(",
"'SET NAMES '",
".",
"$",
"this",
"->",
"_connection",
"->",
"quote",
"(",
"$",
"enco... | Sets connection encoding
@param string $encoding The encoding to use.
@return void | [
"Sets",
"connection",
"encoding"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Driver/Postgres.php#L107-L111 |
211,419 | cakephp/cakephp | src/Database/Driver/Postgres.php | Postgres.setSchema | public function setSchema($schema)
{
$this->connect();
$this->_connection->exec('SET search_path TO ' . $this->_connection->quote($schema));
} | php | public function setSchema($schema)
{
$this->connect();
$this->_connection->exec('SET search_path TO ' . $this->_connection->quote($schema));
} | [
"public",
"function",
"setSchema",
"(",
"$",
"schema",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"exec",
"(",
"'SET search_path TO '",
".",
"$",
"this",
"->",
"_connection",
"->",
"quote",
"(",
"$",
... | Sets connection default schema, if any relation defined in a query is not fully qualified
postgres will fallback to looking the relation into defined default schema
@param string $schema The schema names to set `search_path` to.
@return void | [
"Sets",
"connection",
"default",
"schema",
"if",
"any",
"relation",
"defined",
"in",
"a",
"query",
"is",
"not",
"fully",
"qualified",
"postgres",
"will",
"fallback",
"to",
"looking",
"the",
"relation",
"into",
"defined",
"default",
"schema"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Driver/Postgres.php#L120-L124 |
211,420 | cakephp/cakephp | src/Http/Middleware/EncryptedCookieMiddleware.php | EncryptedCookieMiddleware.decodeCookies | protected function decodeCookies(ServerRequestInterface $request)
{
$cookies = $request->getCookieParams();
foreach ($this->cookieNames as $name) {
if (isset($cookies[$name])) {
$cookies[$name] = $this->_decrypt($cookies[$name], $this->cipherType, $this->key);
... | php | protected function decodeCookies(ServerRequestInterface $request)
{
$cookies = $request->getCookieParams();
foreach ($this->cookieNames as $name) {
if (isset($cookies[$name])) {
$cookies[$name] = $this->_decrypt($cookies[$name], $this->cipherType, $this->key);
... | [
"protected",
"function",
"decodeCookies",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"cookies",
"=",
"$",
"request",
"->",
"getCookieParams",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"cookieNames",
"as",
"$",
"name",
")",
"{",
"... | Decode cookies from the request.
@param \Psr\Http\Message\ServerRequestInterface $request The request to decode cookies from.
@return \Psr\Http\Message\ServerRequestInterface Updated request with decoded cookies. | [
"Decode",
"cookies",
"from",
"the",
"request",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Middleware/EncryptedCookieMiddleware.php#L118-L128 |
211,421 | cakephp/cakephp | src/Http/Middleware/EncryptedCookieMiddleware.php | EncryptedCookieMiddleware.encodeCookies | protected function encodeCookies(Response $response)
{
$cookies = $response->getCookieCollection();
foreach ($cookies as $cookie) {
if (in_array($cookie->getName(), $this->cookieNames, true)) {
$value = $this->_encrypt($cookie->getValue(), $this->cipherType);
... | php | protected function encodeCookies(Response $response)
{
$cookies = $response->getCookieCollection();
foreach ($cookies as $cookie) {
if (in_array($cookie->getName(), $this->cookieNames, true)) {
$value = $this->_encrypt($cookie->getValue(), $this->cipherType);
... | [
"protected",
"function",
"encodeCookies",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"cookies",
"=",
"$",
"response",
"->",
"getCookieCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"cookies",
"as",
"$",
"cookie",
")",
"{",
"if",
"(",
"in_array",
... | Encode cookies from a response's CookieCollection.
@param \Cake\Http\Response $response The response to encode cookies in.
@return \Cake\Http\Response Updated response with encoded cookies. | [
"Encode",
"cookies",
"from",
"a",
"response",
"s",
"CookieCollection",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Middleware/EncryptedCookieMiddleware.php#L136-L147 |
211,422 | cakephp/cakephp | src/Http/Middleware/EncryptedCookieMiddleware.php | EncryptedCookieMiddleware.encodeSetCookieHeader | protected function encodeSetCookieHeader(ResponseInterface $response)
{
$cookies = CookieCollection::createFromHeader($response->getHeader('Set-Cookie'));
$header = [];
foreach ($cookies as $cookie) {
if (in_array($cookie->getName(), $this->cookieNames, true)) {
$... | php | protected function encodeSetCookieHeader(ResponseInterface $response)
{
$cookies = CookieCollection::createFromHeader($response->getHeader('Set-Cookie'));
$header = [];
foreach ($cookies as $cookie) {
if (in_array($cookie->getName(), $this->cookieNames, true)) {
$... | [
"protected",
"function",
"encodeSetCookieHeader",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"cookies",
"=",
"CookieCollection",
"::",
"createFromHeader",
"(",
"$",
"response",
"->",
"getHeader",
"(",
"'Set-Cookie'",
")",
")",
";",
"$",
"header",
... | Encode cookies from a response's Set-Cookie header
@param \Psr\Http\Message\ResponseInterface $response The response to encode cookies in.
@return \Psr\Http\Message\ResponseInterface Updated response with encoded cookies. | [
"Encode",
"cookies",
"from",
"a",
"response",
"s",
"Set",
"-",
"Cookie",
"header"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Middleware/EncryptedCookieMiddleware.php#L155-L168 |
211,423 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher.alias | public static function alias($short, $original = null)
{
$short = Inflector::camelize($short);
if ($original) {
static::$_aliases[$short] = $original;
}
return isset(static::$_aliases[$short]) ? static::$_aliases[$short] : false;
} | php | public static function alias($short, $original = null)
{
$short = Inflector::camelize($short);
if ($original) {
static::$_aliases[$short] = $original;
}
return isset(static::$_aliases[$short]) ? static::$_aliases[$short] : false;
} | [
"public",
"static",
"function",
"alias",
"(",
"$",
"short",
",",
"$",
"original",
"=",
"null",
")",
"{",
"$",
"short",
"=",
"Inflector",
"::",
"camelize",
"(",
"$",
"short",
")",
";",
"if",
"(",
"$",
"original",
")",
"{",
"static",
"::",
"$",
"_ali... | Add an alias for a shell command.
Aliases allow you to call shells by alternate names. This is most
useful when dealing with plugin shells that you want to have shorter
names for.
If you re-use an alias the last alias set will be the one available.
### Usage
Aliasing a shell named ClassName:
```
$this->alias('alia... | [
"Add",
"an",
"alias",
"for",
"a",
"shell",
"command",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L97-L105 |
211,424 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher._initEnvironment | protected function _initEnvironment()
{
if (!$this->_bootstrap()) {
$message = "Unable to load CakePHP core.\nMake sure Cake exists in " . CAKE_CORE_INCLUDE_PATH;
throw new Exception($message);
}
if (function_exists('ini_set')) {
ini_set('html_errors', '0... | php | protected function _initEnvironment()
{
if (!$this->_bootstrap()) {
$message = "Unable to load CakePHP core.\nMake sure Cake exists in " . CAKE_CORE_INCLUDE_PATH;
throw new Exception($message);
}
if (function_exists('ini_set')) {
ini_set('html_errors', '0... | [
"protected",
"function",
"_initEnvironment",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_bootstrap",
"(",
")",
")",
"{",
"$",
"message",
"=",
"\"Unable to load CakePHP core.\\nMake sure Cake exists in \"",
".",
"CAKE_CORE_INCLUDE_PATH",
";",
"throw",
"new",
... | Defines current working environment.
@return void
@throws \Cake\Core\Exception\Exception | [
"Defines",
"current",
"working",
"environment",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L137-L151 |
211,425 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher.dispatch | public function dispatch($extra = [])
{
try {
$result = $this->_dispatch($extra);
} catch (StopException $e) {
return $e->getCode();
}
if ($result === null || $result === true) {
return Shell::CODE_SUCCESS;
}
if (is_int($result)) {
... | php | public function dispatch($extra = [])
{
try {
$result = $this->_dispatch($extra);
} catch (StopException $e) {
return $e->getCode();
}
if ($result === null || $result === true) {
return Shell::CODE_SUCCESS;
}
if (is_int($result)) {
... | [
"public",
"function",
"dispatch",
"(",
"$",
"extra",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_dispatch",
"(",
"$",
"extra",
")",
";",
"}",
"catch",
"(",
"StopException",
"$",
"e",
")",
"{",
"return",
"$",
"e",... | Dispatches a CLI request
Converts a shell command result into an exit code. Null/True
are treated as success. All other return values are an error.
@param array $extra Extra parameters that you can manually pass to the Shell
to be dispatched.
Built-in extra parameter is :
- `requested` : if used, will prevent the She... | [
"Dispatches",
"a",
"CLI",
"request"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L179-L194 |
211,426 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher.addShortPluginAliases | public function addShortPluginAliases()
{
$plugins = Plugin::loaded();
$io = new ConsoleIo();
$task = new CommandTask($io);
$io->setLoggers(false);
$list = $task->getShellList() + ['app' => []];
$fixed = array_flip($list['app']) + array_flip($list['CORE']);
$... | php | public function addShortPluginAliases()
{
$plugins = Plugin::loaded();
$io = new ConsoleIo();
$task = new CommandTask($io);
$io->setLoggers(false);
$list = $task->getShellList() + ['app' => []];
$fixed = array_flip($list['app']) + array_flip($list['CORE']);
$... | [
"public",
"function",
"addShortPluginAliases",
"(",
")",
"{",
"$",
"plugins",
"=",
"Plugin",
"::",
"loaded",
"(",
")",
";",
"$",
"io",
"=",
"new",
"ConsoleIo",
"(",
")",
";",
"$",
"task",
"=",
"new",
"CommandTask",
"(",
"$",
"io",
")",
";",
"$",
"i... | For all loaded plugins, add a short alias
This permits a plugin which implements a shell of the same name to be accessed
Using the shell name alone
@return array the resultant list of aliases | [
"For",
"all",
"loaded",
"plugins",
"add",
"a",
"short",
"alias"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L241-L306 |
211,427 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher.findShell | public function findShell($shell)
{
$className = $this->_shellExists($shell);
if (!$className) {
$shell = $this->_handleAlias($shell);
$className = $this->_shellExists($shell);
}
if (!$className) {
throw new MissingShellException([
... | php | public function findShell($shell)
{
$className = $this->_shellExists($shell);
if (!$className) {
$shell = $this->_handleAlias($shell);
$className = $this->_shellExists($shell);
}
if (!$className) {
throw new MissingShellException([
... | [
"public",
"function",
"findShell",
"(",
"$",
"shell",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"_shellExists",
"(",
"$",
"shell",
")",
";",
"if",
"(",
"!",
"$",
"className",
")",
"{",
"$",
"shell",
"=",
"$",
"this",
"->",
"_handleAlias",
... | Get shell to use, either plugin shell or application shell
All paths in the loaded shell paths are searched, handles alias
dereferencing
@param string $shell Optionally the name of a plugin
@return \Cake\Console\Shell A shell instance.
@throws \Cake\Console\Exception\MissingShellException when errors are encountered. | [
"Get",
"shell",
"to",
"use",
"either",
"plugin",
"shell",
"or",
"application",
"shell"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L318-L333 |
211,428 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher._handleAlias | protected function _handleAlias($shell)
{
$aliased = static::alias($shell);
if ($aliased) {
$shell = $aliased;
}
$class = array_map('Cake\Utility\Inflector::camelize', explode('.', $shell));
return implode('.', $class);
} | php | protected function _handleAlias($shell)
{
$aliased = static::alias($shell);
if ($aliased) {
$shell = $aliased;
}
$class = array_map('Cake\Utility\Inflector::camelize', explode('.', $shell));
return implode('.', $class);
} | [
"protected",
"function",
"_handleAlias",
"(",
"$",
"shell",
")",
"{",
"$",
"aliased",
"=",
"static",
"::",
"alias",
"(",
"$",
"shell",
")",
";",
"if",
"(",
"$",
"aliased",
")",
"{",
"$",
"shell",
"=",
"$",
"aliased",
";",
"}",
"$",
"class",
"=",
... | If the input matches an alias, return the aliased shell name
@param string $shell Optionally the name of a plugin or alias
@return string Shell name with plugin prefix | [
"If",
"the",
"input",
"matches",
"an",
"alias",
"return",
"the",
"aliased",
"shell",
"name"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L341-L351 |
211,429 | cakephp/cakephp | src/Console/ShellDispatcher.php | ShellDispatcher._createShell | protected function _createShell($className, $shortName)
{
list($plugin) = pluginSplit($shortName);
$instance = new $className();
$instance->plugin = trim($plugin, '.');
return $instance;
} | php | protected function _createShell($className, $shortName)
{
list($plugin) = pluginSplit($shortName);
$instance = new $className();
$instance->plugin = trim($plugin, '.');
return $instance;
} | [
"protected",
"function",
"_createShell",
"(",
"$",
"className",
",",
"$",
"shortName",
")",
"{",
"list",
"(",
"$",
"plugin",
")",
"=",
"pluginSplit",
"(",
"$",
"shortName",
")",
";",
"$",
"instance",
"=",
"new",
"$",
"className",
"(",
")",
";",
"$",
... | Create the given shell name, and set the plugin property
@param string $className The class name to instantiate
@param string $shortName The plugin-prefixed shell name
@return \Cake\Console\Shell A shell instance. | [
"Create",
"the",
"given",
"shell",
"name",
"and",
"set",
"the",
"plugin",
"property"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Console/ShellDispatcher.php#L376-L383 |
211,430 | cakephp/cakephp | src/Cache/Engine/ApcuEngine.php | ApcuEngine.clear | public function clear($check)
{
if ($check) {
return true;
}
if (class_exists('APCuIterator', false)) {
$iterator = new APCuIterator(
'/^' . preg_quote($this->_config['prefix'], '/') . '/',
APC_ITER_NONE
);
apcu_... | php | public function clear($check)
{
if ($check) {
return true;
}
if (class_exists('APCuIterator', false)) {
$iterator = new APCuIterator(
'/^' . preg_quote($this->_config['prefix'], '/') . '/',
APC_ITER_NONE
);
apcu_... | [
"public",
"function",
"clear",
"(",
"$",
"check",
")",
"{",
"if",
"(",
"$",
"check",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"class_exists",
"(",
"'APCuIterator'",
",",
"false",
")",
")",
"{",
"$",
"iterator",
"=",
"new",
"APCuIterator",
"("... | Delete all keys from the cache. This will clear every cache config using APC.
@param bool $check If true, nothing will be cleared, as entries are removed
from APC as they expired. This flag is really only used by FileEngine.
@return bool True Returns true.
@link https://secure.php.net/manual/en/function.apcu-cache-inf... | [
"Delete",
"all",
"keys",
"from",
"the",
"cache",
".",
"This",
"will",
"clear",
"every",
"cache",
"config",
"using",
"APC",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/ApcuEngine.php#L135-L158 |
211,431 | cakephp/cakephp | src/Database/TypeMap.php | TypeMap.types | public function types(array $types = null)
{
deprecationWarning(
'TypeMap::types() is deprecated. ' .
'Use TypeMap::setTypes()/getTypes() instead.'
);
if ($types !== null) {
return $this->setTypes($types);
}
return $this->getTypes();
} | php | public function types(array $types = null)
{
deprecationWarning(
'TypeMap::types() is deprecated. ' .
'Use TypeMap::setTypes()/getTypes() instead.'
);
if ($types !== null) {
return $this->setTypes($types);
}
return $this->getTypes();
} | [
"public",
"function",
"types",
"(",
"array",
"$",
"types",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'TypeMap::types() is deprecated. '",
".",
"'Use TypeMap::setTypes()/getTypes() instead.'",
")",
";",
"if",
"(",
"$",
"types",
"!==",
"null",
")",
"{",
"re... | Sets a map of fields and their associated types for single-use.
If called with no arguments it will return the currently configured types.
### Example
```
$query->types(['created' => 'time']);
```
This method will replace all the existing type maps with the ones provided.
@deprecated 3.4.0 Use setTypes()/getTypes(... | [
"Sets",
"a",
"map",
"of",
"fields",
"and",
"their",
"associated",
"types",
"for",
"single",
"-",
"use",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/TypeMap.php#L185-L196 |
211,432 | cakephp/cakephp | src/Database/TypeMap.php | TypeMap.type | public function type($column)
{
if (isset($this->_types[$column])) {
return $this->_types[$column];
}
if (isset($this->_defaults[$column])) {
return $this->_defaults[$column];
}
return null;
} | php | public function type($column)
{
if (isset($this->_types[$column])) {
return $this->_types[$column];
}
if (isset($this->_defaults[$column])) {
return $this->_defaults[$column];
}
return null;
} | [
"public",
"function",
"type",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_types",
"[",
"$",
"column",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_types",
"[",
"$",
"column",
"]",
";",
"}",
"if",
"(",
"isse... | Returns the type of the given column. If there is no single use type is configured,
the column type will be looked for inside the default mapping. If neither exist,
null will be returned.
@param string $column The type for a given column
@return null|string | [
"Returns",
"the",
"type",
"of",
"the",
"given",
"column",
".",
"If",
"there",
"is",
"no",
"single",
"use",
"type",
"is",
"configured",
"the",
"column",
"type",
"will",
"be",
"looked",
"for",
"inside",
"the",
"default",
"mapping",
".",
"If",
"neither",
"e... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/TypeMap.php#L206-L216 |
211,433 | cakephp/cakephp | src/ORM/Association/DependentDeleteHelper.php | DependentDeleteHelper.cascadeDelete | public function cascadeDelete(Association $association, EntityInterface $entity, array $options = [])
{
if (!$association->getDependent()) {
return true;
}
$table = $association->getTarget();
$foreignKey = array_map([$association, 'aliasField'], (array)$association->getFo... | php | public function cascadeDelete(Association $association, EntityInterface $entity, array $options = [])
{
if (!$association->getDependent()) {
return true;
}
$table = $association->getTarget();
$foreignKey = array_map([$association, 'aliasField'], (array)$association->getFo... | [
"public",
"function",
"cascadeDelete",
"(",
"Association",
"$",
"association",
",",
"EntityInterface",
"$",
"entity",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"association",
"->",
"getDependent",
"(",
")",
")",
"{",
"re... | Cascade a delete to remove dependent records.
This method does nothing if the association is not dependent.
@param \Cake\ORM\Association $association The association callbacks are being cascaded on.
@param \Cake\Datasource\EntityInterface $entity The entity that started the cascaded delete.
@param array $options The ... | [
"Cascade",
"a",
"delete",
"to",
"remove",
"dependent",
"records",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/DependentDeleteHelper.php#L38-L58 |
211,434 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._assertFieldsPresent | protected function _assertFieldsPresent($fetchQuery, $key)
{
$select = $fetchQuery->aliasFields($fetchQuery->clause('select'));
if (empty($select)) {
return;
}
$missingKey = function ($fieldList, $key) {
foreach ($key as $keyField) {
if (!in_ar... | php | protected function _assertFieldsPresent($fetchQuery, $key)
{
$select = $fetchQuery->aliasFields($fetchQuery->clause('select'));
if (empty($select)) {
return;
}
$missingKey = function ($fieldList, $key) {
foreach ($key as $keyField) {
if (!in_ar... | [
"protected",
"function",
"_assertFieldsPresent",
"(",
"$",
"fetchQuery",
",",
"$",
"key",
")",
"{",
"$",
"select",
"=",
"$",
"fetchQuery",
"->",
"aliasFields",
"(",
"$",
"fetchQuery",
"->",
"clause",
"(",
"'select'",
")",
")",
";",
"if",
"(",
"empty",
"(... | Checks that the fetching query either has auto fields on or
has the foreignKey fields selected.
If the required fields are missing, throws an exception.
@param \Cake\ORM\Query $fetchQuery The association fetching query
@param array $key The foreign key fields to check
@return void
@throws \InvalidArgumentException | [
"Checks",
"that",
"the",
"fetching",
"query",
"either",
"has",
"auto",
"fields",
"on",
"or",
"has",
"the",
"foreignKey",
"fields",
"selected",
".",
"If",
"the",
"required",
"fields",
"are",
"missing",
"throws",
"an",
"exception",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L240-L271 |
211,435 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._addFilteringJoin | protected function _addFilteringJoin($query, $key, $subquery)
{
$filter = [];
$aliasedTable = $this->sourceAlias;
foreach ($subquery->clause('select') as $aliasedField => $field) {
if (is_int($aliasedField)) {
$filter[] = new IdentifierExpression($field);
... | php | protected function _addFilteringJoin($query, $key, $subquery)
{
$filter = [];
$aliasedTable = $this->sourceAlias;
foreach ($subquery->clause('select') as $aliasedField => $field) {
if (is_int($aliasedField)) {
$filter[] = new IdentifierExpression($field);
... | [
"protected",
"function",
"_addFilteringJoin",
"(",
"$",
"query",
",",
"$",
"key",
",",
"$",
"subquery",
")",
"{",
"$",
"filter",
"=",
"[",
"]",
";",
"$",
"aliasedTable",
"=",
"$",
"this",
"->",
"sourceAlias",
";",
"foreach",
"(",
"$",
"subquery",
"->",... | Appends any conditions required to load the relevant set of records in the
target table query given a filter key and some filtering values when the
filtering needs to be done using a subquery.
@param \Cake\ORM\Query $query Target table's query
@param string|array $key the fields that should be used for filtering
@para... | [
"Appends",
"any",
"conditions",
"required",
"to",
"load",
"the",
"relevant",
"set",
"of",
"records",
"in",
"the",
"target",
"table",
"query",
"given",
"a",
"filter",
"key",
"and",
"some",
"filtering",
"values",
"when",
"the",
"filtering",
"needs",
"to",
"be"... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L283-L310 |
211,436 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._addFilteringCondition | protected function _addFilteringCondition($query, $key, $filter)
{
if (is_array($key)) {
$conditions = $this->_createTupleCondition($query, $key, $filter, 'IN');
}
$conditions = isset($conditions) ? $conditions : [$key . ' IN' => $filter];
return $query->andWhere($condi... | php | protected function _addFilteringCondition($query, $key, $filter)
{
if (is_array($key)) {
$conditions = $this->_createTupleCondition($query, $key, $filter, 'IN');
}
$conditions = isset($conditions) ? $conditions : [$key . ' IN' => $filter];
return $query->andWhere($condi... | [
"protected",
"function",
"_addFilteringCondition",
"(",
"$",
"query",
",",
"$",
"key",
",",
"$",
"filter",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"conditions",
"=",
"$",
"this",
"->",
"_createTupleCondition",
"(",
"$",
"q... | Appends any conditions required to load the relevant set of records in the
target table query given a filter key and some filtering values.
@param \Cake\ORM\Query $query Target table's query
@param string|array $key The fields that should be used for filtering
@param mixed $filter The value that should be used to matc... | [
"Appends",
"any",
"conditions",
"required",
"to",
"load",
"the",
"relevant",
"set",
"of",
"records",
"in",
"the",
"target",
"table",
"query",
"given",
"a",
"filter",
"key",
"and",
"some",
"filtering",
"values",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L321-L330 |
211,437 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._buildSubquery | protected function _buildSubquery($query)
{
$filterQuery = clone $query;
$filterQuery->disableAutoFields();
$filterQuery->mapReduce(null, null, true);
$filterQuery->formatResults(null, true);
$filterQuery->contain([], true);
$filterQuery->setValueBinder(new ValueBinde... | php | protected function _buildSubquery($query)
{
$filterQuery = clone $query;
$filterQuery->disableAutoFields();
$filterQuery->mapReduce(null, null, true);
$filterQuery->formatResults(null, true);
$filterQuery->contain([], true);
$filterQuery->setValueBinder(new ValueBinde... | [
"protected",
"function",
"_buildSubquery",
"(",
"$",
"query",
")",
"{",
"$",
"filterQuery",
"=",
"clone",
"$",
"query",
";",
"$",
"filterQuery",
"->",
"disableAutoFields",
"(",
")",
";",
"$",
"filterQuery",
"->",
"mapReduce",
"(",
"null",
",",
"null",
",",... | Builds a query to be used as a condition for filtering records in the
target table, it is constructed by cloning the original query that was used
to load records in the source table.
@param \Cake\ORM\Query $query the original query used to load source records
@return \Cake\ORM\Query | [
"Builds",
"a",
"query",
"to",
"be",
"used",
"as",
"a",
"condition",
"for",
"filtering",
"records",
"in",
"the",
"target",
"table",
"it",
"is",
"constructed",
"by",
"cloning",
"the",
"original",
"query",
"that",
"was",
"used",
"to",
"load",
"records",
"in",... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L396-L415 |
211,438 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._subqueryFields | protected function _subqueryFields($query)
{
$keys = (array)$this->bindingKey;
if ($this->associationType === Association::MANY_TO_ONE) {
$keys = (array)$this->foreignKey;
}
$fields = $query->aliasFields($keys, $this->sourceAlias);
$group = $fields = array_value... | php | protected function _subqueryFields($query)
{
$keys = (array)$this->bindingKey;
if ($this->associationType === Association::MANY_TO_ONE) {
$keys = (array)$this->foreignKey;
}
$fields = $query->aliasFields($keys, $this->sourceAlias);
$group = $fields = array_value... | [
"protected",
"function",
"_subqueryFields",
"(",
"$",
"query",
")",
"{",
"$",
"keys",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"bindingKey",
";",
"if",
"(",
"$",
"this",
"->",
"associationType",
"===",
"Association",
"::",
"MANY_TO_ONE",
")",
"{",
"$",... | Calculate the fields that need to participate in a subquery.
Normally this includes the binding key columns. If there is a an ORDER BY,
those columns are also included as the fields may be calculated or constant values,
that need to be present to ensure the correct association data is loaded.
@param \Cake\ORM\Query $... | [
"Calculate",
"the",
"fields",
"that",
"need",
"to",
"participate",
"in",
"a",
"subquery",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L427-L449 |
211,439 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._resultInjector | protected function _resultInjector($fetchQuery, $resultMap, $options)
{
$keys = $this->associationType === Association::MANY_TO_ONE ?
$this->foreignKey :
$this->bindingKey;
$sourceKeys = [];
foreach ((array)$keys as $key) {
$f = $fetchQuery->aliasField($k... | php | protected function _resultInjector($fetchQuery, $resultMap, $options)
{
$keys = $this->associationType === Association::MANY_TO_ONE ?
$this->foreignKey :
$this->bindingKey;
$sourceKeys = [];
foreach ((array)$keys as $key) {
$f = $fetchQuery->aliasField($k... | [
"protected",
"function",
"_resultInjector",
"(",
"$",
"fetchQuery",
",",
"$",
"resultMap",
",",
"$",
"options",
")",
"{",
"$",
"keys",
"=",
"$",
"this",
"->",
"associationType",
"===",
"Association",
"::",
"MANY_TO_ONE",
"?",
"$",
"this",
"->",
"foreignKey",... | Returns a callable to be used for each row in a query result set
for injecting the eager loaded rows
@param \Cake\ORM\Query $fetchQuery the Query used to fetch results
@param array $resultMap an array with the foreignKey as keys and
the corresponding target table results as value.
@param array $options The options pas... | [
"Returns",
"a",
"callable",
"to",
"be",
"used",
"for",
"each",
"row",
"in",
"a",
"query",
"result",
"set",
"for",
"injecting",
"the",
"eager",
"loaded",
"rows"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L493-L519 |
211,440 | cakephp/cakephp | src/ORM/Association/Loader/SelectLoader.php | SelectLoader._multiKeysInjector | protected function _multiKeysInjector($resultMap, $sourceKeys, $nestKey)
{
return function ($row) use ($resultMap, $sourceKeys, $nestKey) {
$values = [];
foreach ($sourceKeys as $key) {
$values[] = $row[$key];
}
$key = implode(';', $values);
... | php | protected function _multiKeysInjector($resultMap, $sourceKeys, $nestKey)
{
return function ($row) use ($resultMap, $sourceKeys, $nestKey) {
$values = [];
foreach ($sourceKeys as $key) {
$values[] = $row[$key];
}
$key = implode(';', $values);
... | [
"protected",
"function",
"_multiKeysInjector",
"(",
"$",
"resultMap",
",",
"$",
"sourceKeys",
",",
"$",
"nestKey",
")",
"{",
"return",
"function",
"(",
"$",
"row",
")",
"use",
"(",
"$",
"resultMap",
",",
"$",
"sourceKeys",
",",
"$",
"nestKey",
")",
"{",
... | Returns a callable to be used for each row in a query result set
for injecting the eager loaded rows when the matching needs to
be done with multiple foreign keys
@param array $resultMap A keyed arrays containing the target table
@param array $sourceKeys An array with aliased keys to match
@param string $nestKey The k... | [
"Returns",
"a",
"callable",
"to",
"be",
"used",
"for",
"each",
"row",
"in",
"a",
"query",
"result",
"set",
"for",
"injecting",
"the",
"eager",
"loaded",
"rows",
"when",
"the",
"matching",
"needs",
"to",
"be",
"done",
"with",
"multiple",
"foreign",
"keys"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Association/Loader/SelectLoader.php#L531-L546 |
211,441 | cakephp/cakephp | src/Http/Session.php | Session._defaultConfig | protected static function _defaultConfig($name)
{
$defaults = [
'php' => [
'cookie' => 'CAKEPHP',
'ini' => [
'session.use_trans_sid' => 0,
]
],
'cake' => [
'cookie' => 'CAKEPHP',
... | php | protected static function _defaultConfig($name)
{
$defaults = [
'php' => [
'cookie' => 'CAKEPHP',
'ini' => [
'session.use_trans_sid' => 0,
]
],
'cake' => [
'cookie' => 'CAKEPHP',
... | [
"protected",
"static",
"function",
"_defaultConfig",
"(",
"$",
"name",
")",
"{",
"$",
"defaults",
"=",
"[",
"'php'",
"=>",
"[",
"'cookie'",
"=>",
"'CAKEPHP'",
",",
"'ini'",
"=>",
"[",
"'session.use_trans_sid'",
"=>",
"0",
",",
"]",
"]",
",",
"'cake'",
"=... | Get one of the prebaked default session configurations.
@param string $name Config name.
@return bool|array | [
"Get",
"one",
"of",
"the",
"prebaked",
"default",
"session",
"configurations",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L138-L188 |
211,442 | cakephp/cakephp | src/Http/Session.php | Session.engine | public function engine($class = null, array $options = [])
{
if ($class === null) {
return $this->_engine;
}
if ($class instanceof SessionHandlerInterface) {
return $this->setEngine($class);
}
$className = App::className($class, 'Http/Session');
... | php | public function engine($class = null, array $options = [])
{
if ($class === null) {
return $this->_engine;
}
if ($class instanceof SessionHandlerInterface) {
return $this->setEngine($class);
}
$className = App::className($class, 'Http/Session');
... | [
"public",
"function",
"engine",
"(",
"$",
"class",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"class",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_engine",
";",
"}",
"if",
"(",
"$",
"class",
... | Sets the session handler instance to use for this session.
If a string is passed for the first argument, it will be treated as the
class name and the second argument will be passed as the first argument
in the constructor.
If an instance of a SessionHandlerInterface is provided as the first argument,
the handler will ... | [
"Sets",
"the",
"session",
"handler",
"instance",
"to",
"use",
"for",
"this",
"session",
".",
"If",
"a",
"string",
"is",
"passed",
"for",
"the",
"first",
"argument",
"it",
"will",
"be",
"treated",
"as",
"the",
"class",
"name",
"and",
"the",
"second",
"arg... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L253-L283 |
211,443 | cakephp/cakephp | src/Http/Session.php | Session.setEngine | protected function setEngine(SessionHandlerInterface $handler)
{
if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE) {
session_set_save_handler($handler, false);
}
return $this->_engine = $handler;
} | php | protected function setEngine(SessionHandlerInterface $handler)
{
if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE) {
session_set_save_handler($handler, false);
}
return $this->_engine = $handler;
} | [
"protected",
"function",
"setEngine",
"(",
"SessionHandlerInterface",
"$",
"handler",
")",
"{",
"if",
"(",
"!",
"headers_sent",
"(",
")",
"&&",
"session_status",
"(",
")",
"!==",
"\\",
"PHP_SESSION_ACTIVE",
")",
"{",
"session_set_save_handler",
"(",
"$",
"handle... | Set the engine property and update the session handler in PHP.
@param \SessionHandlerInterface $handler The handler to set
@return \SessionHandlerInterface | [
"Set",
"the",
"engine",
"property",
"and",
"update",
"the",
"session",
"handler",
"in",
"PHP",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L291-L298 |
211,444 | cakephp/cakephp | src/Http/Session.php | Session.close | public function close()
{
if (!$this->_started) {
return true;
}
if (!session_write_close()) {
throw new RuntimeException('Could not close the session');
}
$this->_started = false;
return true;
} | php | public function close()
{
if (!$this->_started) {
return true;
}
if (!session_write_close()) {
throw new RuntimeException('Could not close the session');
}
$this->_started = false;
return true;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_started",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"session_write_close",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'Could not close the s... | Write data and close the session
@return bool True if session was started | [
"Write",
"data",
"and",
"close",
"the",
"session"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L376-L389 |
211,445 | cakephp/cakephp | src/Http/Session.php | Session.check | public function check($name = null)
{
if ($this->_hasSession() && !$this->started()) {
$this->start();
}
if (!isset($_SESSION)) {
return false;
}
return Hash::get($_SESSION, $name) !== null;
} | php | public function check($name = null)
{
if ($this->_hasSession() && !$this->started()) {
$this->start();
}
if (!isset($_SESSION)) {
return false;
}
return Hash::get($_SESSION, $name) !== null;
} | [
"public",
"function",
"check",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_hasSession",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"started",
"(",
")",
")",
"{",
"$",
"this",
"->",
"start",
"(",
")",
";",
"}",
"if",
... | Returns true if given variable name is set in session.
@param string|null $name Variable name to check for
@return bool True if variable is there | [
"Returns",
"true",
"if",
"given",
"variable",
"name",
"is",
"set",
"in",
"session",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L407-L418 |
211,446 | cakephp/cakephp | src/Http/Session.php | Session.consume | public function consume($name)
{
if (empty($name)) {
return null;
}
$value = $this->read($name);
if ($value !== null) {
$this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
}
return $value;
} | php | public function consume($name)
{
if (empty($name)) {
return null;
}
$value = $this->read($name);
if ($value !== null) {
$this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
}
return $value;
} | [
"public",
"function",
"consume",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"value",
"=",
"$",
"this",
"->",
"read",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"value",
"... | Reads and deletes a variable from session.
@param string $name The key to read and remove (or a path as sent to Hash.extract).
@return mixed The value of the session variable, null if session not available,
session not started, or provided name not found in the session. | [
"Reads",
"and",
"deletes",
"a",
"variable",
"from",
"session",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L451-L462 |
211,447 | cakephp/cakephp | src/Http/Session.php | Session.write | public function write($name, $value = null)
{
if (!$this->started()) {
$this->start();
}
$write = $name;
if (!is_array($name)) {
$write = [$name => $value];
}
$data = isset($_SESSION) ? $_SESSION : [];
foreach ($write as $key => $val)... | php | public function write($name, $value = null)
{
if (!$this->started()) {
$this->start();
}
$write = $name;
if (!is_array($name)) {
$write = [$name => $value];
}
$data = isset($_SESSION) ? $_SESSION : [];
foreach ($write as $key => $val)... | [
"public",
"function",
"write",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
"(",
")",
")",
"{",
"$",
"this",
"->",
"start",
"(",
")",
";",
"}",
"$",
"write",
"=",
"$",
"name",
";",
... | Writes value to given session variable name.
@param string|array $name Name of variable
@param mixed $value Value to write
@return void | [
"Writes",
"value",
"to",
"given",
"session",
"variable",
"name",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L471-L488 |
211,448 | cakephp/cakephp | src/Http/Session.php | Session.delete | public function delete($name)
{
if ($this->check($name)) {
$this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
}
} | php | public function delete($name)
{
if ($this->check($name)) {
$this->_overwrite($_SESSION, Hash::remove($_SESSION, $name));
}
} | [
"public",
"function",
"delete",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"_overwrite",
"(",
"$",
"_SESSION",
",",
"Hash",
"::",
"remove",
"(",
"$",
"_SESSION",
",",
"$"... | Removes a variable from session.
@param string $name Session variable to remove
@return void | [
"Removes",
"a",
"variable",
"from",
"session",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L519-L524 |
211,449 | cakephp/cakephp | src/Http/Session.php | Session._overwrite | protected function _overwrite(&$old, $new)
{
if (!empty($old)) {
foreach ($old as $key => $var) {
if (!isset($new[$key])) {
unset($old[$key]);
}
}
}
foreach ($new as $key => $var) {
$old[$key] = $var;
... | php | protected function _overwrite(&$old, $new)
{
if (!empty($old)) {
foreach ($old as $key => $var) {
if (!isset($new[$key])) {
unset($old[$key]);
}
}
}
foreach ($new as $key => $var) {
$old[$key] = $var;
... | [
"protected",
"function",
"_overwrite",
"(",
"&",
"$",
"old",
",",
"$",
"new",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"old",
")",
")",
"{",
"foreach",
"(",
"$",
"old",
"as",
"$",
"key",
"=>",
"$",
"var",
")",
"{",
"if",
"(",
"!",
"isset"... | Used to write new data to _SESSION, since PHP doesn't like us setting the _SESSION var itself.
@param array $old Set of old variables => values
@param array $new New set of variable => value
@return void | [
"Used",
"to",
"write",
"new",
"data",
"to",
"_SESSION",
"since",
"PHP",
"doesn",
"t",
"like",
"us",
"setting",
"the",
"_SESSION",
"var",
"itself",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L533-L545 |
211,450 | cakephp/cakephp | src/Http/Session.php | Session.destroy | public function destroy()
{
if ($this->_hasSession() && !$this->started()) {
$this->start();
}
if (!$this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) {
session_destroy();
}
$_SESSION = [];
$this->_started = false;
} | php | public function destroy()
{
if ($this->_hasSession() && !$this->started()) {
$this->start();
}
if (!$this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) {
session_destroy();
}
$_SESSION = [];
$this->_started = false;
} | [
"public",
"function",
"destroy",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_hasSession",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"started",
"(",
")",
")",
"{",
"$",
"this",
"->",
"start",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"... | Helper method to destroy invalid sessions.
@return void | [
"Helper",
"method",
"to",
"destroy",
"invalid",
"sessions",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L552-L564 |
211,451 | cakephp/cakephp | src/Http/Session.php | Session._hasSession | protected function _hasSession()
{
return !ini_get('session.use_cookies')
|| isset($_COOKIE[session_name()])
|| $this->_isCLI
|| (ini_get('session.use_trans_sid') && isset($_GET[session_name()]));
} | php | protected function _hasSession()
{
return !ini_get('session.use_cookies')
|| isset($_COOKIE[session_name()])
|| $this->_isCLI
|| (ini_get('session.use_trans_sid') && isset($_GET[session_name()]));
} | [
"protected",
"function",
"_hasSession",
"(",
")",
"{",
"return",
"!",
"ini_get",
"(",
"'session.use_cookies'",
")",
"||",
"isset",
"(",
"$",
"_COOKIE",
"[",
"session_name",
"(",
")",
"]",
")",
"||",
"$",
"this",
"->",
"_isCLI",
"||",
"(",
"ini_get",
"(",... | Returns whether a session exists
@return bool | [
"Returns",
"whether",
"a",
"session",
"exists"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L587-L593 |
211,452 | cakephp/cakephp | src/Http/Session.php | Session.renew | public function renew()
{
if (!$this->_hasSession() || $this->_isCLI) {
return;
}
$this->start();
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params['path'],
$p... | php | public function renew()
{
if (!$this->_hasSession() || $this->_isCLI) {
return;
}
$this->start();
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params['path'],
$p... | [
"public",
"function",
"renew",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_hasSession",
"(",
")",
"||",
"$",
"this",
"->",
"_isCLI",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"start",
"(",
")",
";",
"$",
"params",
"=",
"session_get... | Restarts this session.
@return void | [
"Restarts",
"this",
"session",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L600-L621 |
211,453 | cakephp/cakephp | src/Http/Session.php | Session._timedOut | protected function _timedOut()
{
$time = $this->read('Config.time');
$result = false;
$checkTime = $time !== null && $this->_lifetime > 0;
if ($checkTime && (time() - (int)$time > $this->_lifetime)) {
$result = true;
}
$this->write('Config.time', time())... | php | protected function _timedOut()
{
$time = $this->read('Config.time');
$result = false;
$checkTime = $time !== null && $this->_lifetime > 0;
if ($checkTime && (time() - (int)$time > $this->_lifetime)) {
$result = true;
}
$this->write('Config.time', time())... | [
"protected",
"function",
"_timedOut",
"(",
")",
"{",
"$",
"time",
"=",
"$",
"this",
"->",
"read",
"(",
"'Config.time'",
")",
";",
"$",
"result",
"=",
"false",
";",
"$",
"checkTime",
"=",
"$",
"time",
"!==",
"null",
"&&",
"$",
"this",
"->",
"_lifetime... | Returns true if the session is no longer valid because the last time it was
accessed was after the configured timeout.
@return bool | [
"Returns",
"true",
"if",
"the",
"session",
"is",
"no",
"longer",
"valid",
"because",
"the",
"last",
"time",
"it",
"was",
"accessed",
"was",
"after",
"the",
"configured",
"timeout",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Session.php#L629-L642 |
211,454 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.addCrumb | public function addCrumb($name, $link = null, array $options = [])
{
deprecationWarning(
'HtmlHelper::addCrumb() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$this->_crumbs[] = [$name, $link, $options];
return $this;
} | php | public function addCrumb($name, $link = null, array $options = [])
{
deprecationWarning(
'HtmlHelper::addCrumb() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$this->_crumbs[] = [$name, $link, $options];
return $this;
} | [
"public",
"function",
"addCrumb",
"(",
"$",
"name",
",",
"$",
"link",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"deprecationWarning",
"(",
"'HtmlHelper::addCrumb() is deprecated. '",
".",
"'Use the BreadcrumbsHelper instead.'",
")",
";",
... | Adds a link to the breadcrumbs array.
@param string $name Text for link
@param string|array|null $link URL for link (if empty it won't be a link)
@param array $options Link attributes e.g. ['id' => 'selected']
@return $this
@see \Cake\View\Helper\HtmlHelper::link() for details on $options that can be used.
@link https... | [
"Adds",
"a",
"link",
"to",
"the",
"breadcrumbs",
"array",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L160-L170 |
211,455 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.docType | public function docType($type = 'html5')
{
if (isset($this->_docTypes[$type])) {
return $this->_docTypes[$type];
}
return null;
} | php | public function docType($type = 'html5')
{
if (isset($this->_docTypes[$type])) {
return $this->_docTypes[$type];
}
return null;
} | [
"public",
"function",
"docType",
"(",
"$",
"type",
"=",
"'html5'",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_docTypes",
"[",
"$",
"type",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_docTypes",
"[",
"$",
"type",
"]",
";",
"}",... | Returns a doctype string.
Possible doctypes:
- html4-strict: HTML4 Strict.
- html4-trans: HTML4 Transitional.
- html4-frame: HTML4 Frameset.
- html5: HTML5. Default value.
- xhtml-strict: XHTML1 Strict.
- xhtml-trans: XHTML1 Transitional.
- xhtml-frame: XHTML1 Frameset.
- xhtml11: XHTML1.1.
@param string $type Do... | [
"Returns",
"a",
"doctype",
"string",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L190-L197 |
211,456 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.charset | public function charset($charset = null)
{
if (empty($charset)) {
$charset = strtolower(Configure::read('App.encoding'));
}
return $this->formatTemplate('charset', [
'charset' => !empty($charset) ? $charset : 'utf-8'
]);
} | php | public function charset($charset = null)
{
if (empty($charset)) {
$charset = strtolower(Configure::read('App.encoding'));
}
return $this->formatTemplate('charset', [
'charset' => !empty($charset) ? $charset : 'utf-8'
]);
} | [
"public",
"function",
"charset",
"(",
"$",
"charset",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"charset",
")",
")",
"{",
"$",
"charset",
"=",
"strtolower",
"(",
"Configure",
"::",
"read",
"(",
"'App.encoding'",
")",
")",
";",
"}",
"return... | Returns a charset META-tag.
@param string|null $charset The character set to be used in the meta tag. If empty,
The App.encoding value will be used. Example: "utf-8".
@return string A meta tag containing the specified character set.
@link https://book.cakephp.org/3.0/en/views/helpers/html.html#creating-charset-tags | [
"Returns",
"a",
"charset",
"META",
"-",
"tag",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L316-L325 |
211,457 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.css | public function css($path, array $options = [])
{
$options += ['once' => true, 'block' => null, 'rel' => 'stylesheet'];
if (is_array($path)) {
$out = '';
foreach ($path as $i) {
$out .= "\n\t" . $this->css($i, $options);
}
if (empty($o... | php | public function css($path, array $options = [])
{
$options += ['once' => true, 'block' => null, 'rel' => 'stylesheet'];
if (is_array($path)) {
$out = '';
foreach ($path as $i) {
$out .= "\n\t" . $this->css($i, $options);
}
if (empty($o... | [
"public",
"function",
"css",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'once'",
"=>",
"true",
",",
"'block'",
"=>",
"null",
",",
"'rel'",
"=>",
"'stylesheet'",
"]",
";",
"if",
"(",
"is_arra... | Creates a link element for CSS stylesheets.
### Usage
Include one CSS file:
```
echo $this->Html->css('styles.css');
```
Include multiple CSS files:
```
echo $this->Html->css(['one.css', 'two.css']);
```
Add the stylesheet to view block "css":
```
$this->Html->css('styles.css', ['block' => true]);
```
Add the s... | [
"Creates",
"a",
"link",
"element",
"for",
"CSS",
"stylesheets",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L445-L495 |
211,458 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.scriptEnd | public function scriptEnd()
{
$buffer = ob_get_clean();
$options = $this->_scriptBlockOptions;
$this->_scriptBlockOptions = [];
return $this->scriptBlock($buffer, $options);
} | php | public function scriptEnd()
{
$buffer = ob_get_clean();
$options = $this->_scriptBlockOptions;
$this->_scriptBlockOptions = [];
return $this->scriptBlock($buffer, $options);
} | [
"public",
"function",
"scriptEnd",
"(",
")",
"{",
"$",
"buffer",
"=",
"ob_get_clean",
"(",
")",
";",
"$",
"options",
"=",
"$",
"this",
"->",
"_scriptBlockOptions",
";",
"$",
"this",
"->",
"_scriptBlockOptions",
"=",
"[",
"]",
";",
"return",
"$",
"this",
... | End a Buffered section of JavaScript capturing.
Generates a script tag inline or appends to specified view block depending on
the settings used when the scriptBlock was started
@return string|null Depending on the settings of scriptStart() either a script tag or null
@link https://book.cakephp.org/3.0/en/views/helpers... | [
"End",
"a",
"Buffered",
"section",
"of",
"JavaScript",
"capturing",
".",
"Generates",
"a",
"script",
"tag",
"inline",
"or",
"appends",
"to",
"specified",
"view",
"block",
"depending",
"on",
"the",
"settings",
"used",
"when",
"the",
"scriptBlock",
"was",
"start... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L646-L653 |
211,459 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.style | public function style(array $data, $oneLine = true)
{
$out = [];
foreach ($data as $key => $value) {
$out[] = $key . ':' . $value . ';';
}
if ($oneLine) {
return implode(' ', $out);
}
return implode("\n", $out);
} | php | public function style(array $data, $oneLine = true)
{
$out = [];
foreach ($data as $key => $value) {
$out[] = $key . ':' . $value . ';';
}
if ($oneLine) {
return implode(' ', $out);
}
return implode("\n", $out);
} | [
"public",
"function",
"style",
"(",
"array",
"$",
"data",
",",
"$",
"oneLine",
"=",
"true",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"out",
"[",
"]",
"=",
"$",... | Builds CSS style data from an array of CSS properties
### Usage:
```
echo $this->Html->style(['margin' => '10px', 'padding' => '10px'], true);
// creates
'margin:10px;padding:10px;'
```
@param array $data Style data array, keys will be used as property names, values as property values.
@param bool $oneLine Whether ... | [
"Builds",
"CSS",
"style",
"data",
"from",
"an",
"array",
"of",
"CSS",
"properties"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L672-L683 |
211,460 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.getCrumbs | public function getCrumbs($separator = '»', $startText = false)
{
deprecationWarning(
'HtmlHelper::getCrumbs() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$crumbs = $this->_prepareCrumbs($startText);
if (!empty($crumbs)) {
$ou... | php | public function getCrumbs($separator = '»', $startText = false)
{
deprecationWarning(
'HtmlHelper::getCrumbs() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$crumbs = $this->_prepareCrumbs($startText);
if (!empty($crumbs)) {
$ou... | [
"public",
"function",
"getCrumbs",
"(",
"$",
"separator",
"=",
"'»'",
",",
"$",
"startText",
"=",
"false",
")",
"{",
"deprecationWarning",
"(",
"'HtmlHelper::getCrumbs() is deprecated. '",
".",
"'Use the BreadcrumbsHelper instead.'",
")",
";",
"$",
"crumbs",
"="... | Returns the breadcrumb trail as a sequence of »-separated links.
If `$startText` is an array, the accepted keys are:
- `text` Define the text/content for the link.
- `url` Define the target of the created link.
All other keys will be passed to HtmlHelper::link() as the `$options` parameter.
@param string $sep... | [
"Returns",
"the",
"breadcrumb",
"trail",
"as",
"a",
"sequence",
"of",
"»",
";",
"-",
"separated",
"links",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L702-L724 |
211,461 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper._prepareCrumbs | protected function _prepareCrumbs($startText, $escape = true)
{
deprecationWarning(
'HtmlHelper::_prepareCrumbs() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$crumbs = $this->_crumbs;
if ($startText) {
if (!is_array($startText)) {
... | php | protected function _prepareCrumbs($startText, $escape = true)
{
deprecationWarning(
'HtmlHelper::_prepareCrumbs() is deprecated. ' .
'Use the BreadcrumbsHelper instead.'
);
$crumbs = $this->_crumbs;
if ($startText) {
if (!is_array($startText)) {
... | [
"protected",
"function",
"_prepareCrumbs",
"(",
"$",
"startText",
",",
"$",
"escape",
"=",
"true",
")",
"{",
"deprecationWarning",
"(",
"'HtmlHelper::_prepareCrumbs() is deprecated. '",
".",
"'Use the BreadcrumbsHelper instead.'",
")",
";",
"$",
"crumbs",
"=",
"$",
"t... | Prepends startText to crumbs array if set
@param string|array|bool $startText Text to prepend
@param bool $escape If the output should be escaped or not
@return array Crumb list including startText (if provided)
@deprecated 3.3.6 Use the BreadcrumbsHelper instead | [
"Prepends",
"startText",
"to",
"crumbs",
"array",
"if",
"set"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L804-L826 |
211,462 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.tableHeaders | public function tableHeaders(array $names, array $trOptions = null, array $thOptions = null)
{
$out = [];
foreach ($names as $arg) {
if (!is_array($arg)) {
$out[] = $this->formatTemplate('tableheader', [
'attrs' => $this->templater()->formatAttributes(... | php | public function tableHeaders(array $names, array $trOptions = null, array $thOptions = null)
{
$out = [];
foreach ($names as $arg) {
if (!is_array($arg)) {
$out[] = $this->formatTemplate('tableheader', [
'attrs' => $this->templater()->formatAttributes(... | [
"public",
"function",
"tableHeaders",
"(",
"array",
"$",
"names",
",",
"array",
"$",
"trOptions",
"=",
"null",
",",
"array",
"$",
"thOptions",
"=",
"null",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"names",
"as",
"$",
"arg",
")... | Returns a row of formatted and named TABLE headers.
@param array $names Array of tablenames. Each tablename also can be a key that points to an array with a set
of attributes to its specific tag
@param array|null $trOptions HTML options for TR elements.
@param array|null $thOptions HTML options for TH elements.
@retur... | [
"Returns",
"a",
"row",
"of",
"formatted",
"and",
"named",
"TABLE",
"headers",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L901-L919 |
211,463 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper._renderCells | protected function _renderCells($line, $useCount = false)
{
$i = 0;
$cellsOut = [];
foreach ($line as $cell) {
$cellOptions = [];
if (is_array($cell)) {
$cellOptions = $cell[1];
$cell = $cell[0];
}
if ($useCoun... | php | protected function _renderCells($line, $useCount = false)
{
$i = 0;
$cellsOut = [];
foreach ($line as $cell) {
$cellOptions = [];
if (is_array($cell)) {
$cellOptions = $cell[1];
$cell = $cell[0];
}
if ($useCoun... | [
"protected",
"function",
"_renderCells",
"(",
"$",
"line",
",",
"$",
"useCount",
"=",
"false",
")",
"{",
"$",
"i",
"=",
"0",
";",
"$",
"cellsOut",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"line",
"as",
"$",
"cell",
")",
"{",
"$",
"cellOptions",
"... | Renders cells for a row of a table.
This is a helper method for tableCells(). Overload this method as you
need to change the behavior of the cell rendering.
@param array $line Line data to render.
@param bool $useCount Renders the count into the row. Default is false.
@return string[] | [
"Renders",
"cells",
"for",
"a",
"row",
"of",
"a",
"table",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L976-L1001 |
211,464 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.div | public function div($class = null, $text = null, array $options = [])
{
if (!empty($class)) {
$options['class'] = $class;
}
return $this->tag('div', $text, $options);
} | php | public function div($class = null, $text = null, array $options = [])
{
if (!empty($class)) {
$options['class'] = $class;
}
return $this->tag('div', $text, $options);
} | [
"public",
"function",
"div",
"(",
"$",
"class",
"=",
"null",
",",
"$",
"text",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"class",
")",
")",
"{",
"$",
"options",
"[",
"'class'",
"]",
... | Returns a formatted DIV tag for HTML FORMs.
### Options
- `escape` Whether or not the contents should be html_entity escaped.
@param string|null $class CSS class name of the div element.
@param string|null $text String content that will appear inside the div element.
If null, only a start tag will be printed
@param ... | [
"Returns",
"a",
"formatted",
"DIV",
"tag",
"for",
"HTML",
"FORMs",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L1081-L1088 |
211,465 | cakephp/cakephp | src/View/Helper/HtmlHelper.php | HtmlHelper.para | public function para($class, $text, array $options = [])
{
if (!empty($options['escape'])) {
$text = h($text);
}
if ($class && !empty($class)) {
$options['class'] = $class;
}
$tag = 'para';
if ($text === null) {
$tag = 'parastart';
... | php | public function para($class, $text, array $options = [])
{
if (!empty($options['escape'])) {
$text = h($text);
}
if ($class && !empty($class)) {
$options['class'] = $class;
}
$tag = 'para';
if ($text === null) {
$tag = 'parastart';
... | [
"public",
"function",
"para",
"(",
"$",
"class",
",",
"$",
"text",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'escape'",
"]",
")",
")",
"{",
"$",
"text",
"=",
"h",
"(",
"$",
"tex... | Returns a formatted P tag.
### Options
- `escape` Whether or not the contents should be html_entity escaped.
@param string $class CSS class name of the p element.
@param string $text String content that will appear inside the p element.
@param array $options Additional HTML attributes of the P tag
@return string The... | [
"Returns",
"a",
"formatted",
"P",
"tag",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Helper/HtmlHelper.php#L1102-L1119 |
211,466 | cakephp/cakephp | src/View/View.php | View.autoLayout | public function autoLayout($autoLayout = null)
{
deprecationWarning(
'View::autoLayout() is deprecated. ' .
'Use isAutoLayoutEnabled()/enableAutoLayout() instead.'
);
if ($autoLayout === null) {
return $this->autoLayout;
}
$this->autoLayo... | php | public function autoLayout($autoLayout = null)
{
deprecationWarning(
'View::autoLayout() is deprecated. ' .
'Use isAutoLayoutEnabled()/enableAutoLayout() instead.'
);
if ($autoLayout === null) {
return $this->autoLayout;
}
$this->autoLayo... | [
"public",
"function",
"autoLayout",
"(",
"$",
"autoLayout",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'View::autoLayout() is deprecated. '",
".",
"'Use isAutoLayoutEnabled()/enableAutoLayout() instead.'",
")",
";",
"if",
"(",
"$",
"autoLayout",
"===",
"null",
"... | Turns on or off CakePHP's conventional mode of applying layout files.
On by default. Setting to off means that layouts will not be
automatically applied to rendered templates.
@deprecated 3.5.0 Use isAutoLayoutEnabled()/enableAutoLayout() instead.
@param bool|null $autoLayout Boolean to turn on/off. If null returns cu... | [
"Turns",
"on",
"or",
"off",
"CakePHP",
"s",
"conventional",
"mode",
"of",
"applying",
"layout",
"files",
".",
"On",
"by",
"default",
".",
"Setting",
"to",
"off",
"means",
"that",
"layouts",
"will",
"not",
"be",
"automatically",
"applied",
"to",
"rendered",
... | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L589-L601 |
211,467 | cakephp/cakephp | src/View/View.php | View.theme | public function theme($theme = null)
{
deprecationWarning(
'View::theme() is deprecated. ' .
'Use getTheme()/setTheme() instead.'
);
if ($theme === null) {
return $this->theme;
}
$this->theme = $theme;
} | php | public function theme($theme = null)
{
deprecationWarning(
'View::theme() is deprecated. ' .
'Use getTheme()/setTheme() instead.'
);
if ($theme === null) {
return $this->theme;
}
$this->theme = $theme;
} | [
"public",
"function",
"theme",
"(",
"$",
"theme",
"=",
"null",
")",
"{",
"deprecationWarning",
"(",
"'View::theme() is deprecated. '",
".",
"'Use getTheme()/setTheme() instead.'",
")",
";",
"if",
"(",
"$",
"theme",
"===",
"null",
")",
"{",
"return",
"$",
"this",... | The view theme to use.
@deprecated 3.5.0 Use getTheme()/setTheme() instead.
@param string|null $theme Theme name. If null returns current theme.
@return string|null | [
"The",
"view",
"theme",
"to",
"use",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L633-L645 |
211,468 | cakephp/cakephp | src/View/View.php | View.element | public function element($name, array $data = [], array $options = [])
{
$options += ['callbacks' => false, 'cache' => null, 'plugin' => null];
if (isset($options['cache'])) {
$options['cache'] = $this->_elementCache($name, $data, $options);
}
$pluginCheck = $options['plu... | php | public function element($name, array $data = [], array $options = [])
{
$options += ['callbacks' => false, 'cache' => null, 'plugin' => null];
if (isset($options['cache'])) {
$options['cache'] = $this->_elementCache($name, $data, $options);
}
$pluginCheck = $options['plu... | [
"public",
"function",
"element",
"(",
"$",
"name",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'callbacks'",
"=>",
"false",
",",
"'cache'",
"=>",
"null",
",",
"'plugin... | Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
This realizes the concept of Elements, (or "partial layouts") and the $params array is used to send
data to be used in the element. Elements can be cached improving performance by using the `cache` option.
@param string $name ... | [
"Renders",
"a",
"piece",
"of",
"PHP",
"with",
"provided",
"parameters",
"and",
"returns",
"HTML",
"XML",
"or",
"any",
"other",
"string",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L768-L792 |
211,469 | cakephp/cakephp | src/View/View.php | View.cache | public function cache(callable $block, array $options = [])
{
$options += ['key' => '', 'config' => $this->elementCache];
if (empty($options['key'])) {
throw new RuntimeException('Cannot cache content with an empty key');
}
$result = Cache::read($options['key'], $options[... | php | public function cache(callable $block, array $options = [])
{
$options += ['key' => '', 'config' => $this->elementCache];
if (empty($options['key'])) {
throw new RuntimeException('Cannot cache content with an empty key');
}
$result = Cache::read($options['key'], $options[... | [
"public",
"function",
"cache",
"(",
"callable",
"$",
"block",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"[",
"'key'",
"=>",
"''",
",",
"'config'",
"=>",
"$",
"this",
"->",
"elementCache",
"]",
";",
"if",
"(",
"emp... | Create a cached block of view logic.
This allows you to cache a block of view output into the cache
defined in `elementCache`.
This method will attempt to read the cache first. If the cache
is empty, the $block will be run and the output stored.
@param callable $block The block of code that you want to cache the out... | [
"Create",
"a",
"cached",
"block",
"of",
"view",
"logic",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L808-L825 |
211,470 | cakephp/cakephp | src/View/View.php | View.append | public function append($name, $value = null)
{
$this->Blocks->concat($name, $value);
return $this;
} | php | public function append($name, $value = null)
{
$this->Blocks->concat($name, $value);
return $this;
} | [
"public",
"function",
"append",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"Blocks",
"->",
"concat",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Append to an existing or new block.
Appending to a new block will create the block.
@param string $name Name of the block
@param mixed $value The content for the block. Value will be type cast
to string.
@return $this
@see \Cake\View\ViewBlock::concat() | [
"Append",
"to",
"an",
"existing",
"or",
"new",
"block",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1013-L1018 |
211,471 | cakephp/cakephp | src/View/View.php | View.prepend | public function prepend($name, $value)
{
$this->Blocks->concat($name, $value, ViewBlock::PREPEND);
return $this;
} | php | public function prepend($name, $value)
{
$this->Blocks->concat($name, $value, ViewBlock::PREPEND);
return $this;
} | [
"public",
"function",
"prepend",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"Blocks",
"->",
"concat",
"(",
"$",
"name",
",",
"$",
"value",
",",
"ViewBlock",
"::",
"PREPEND",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Prepend to an existing or new block.
Prepending to a new block will create the block.
@param string $name Name of the block
@param mixed $value The content for the block. Value will be type cast
to string.
@return $this
@see \Cake\View\ViewBlock::concat() | [
"Prepend",
"to",
"an",
"existing",
"or",
"new",
"block",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1031-L1036 |
211,472 | cakephp/cakephp | src/View/View.php | View.uuid | public function uuid($object, $url)
{
deprecationWarning('View::uuid() is deprecated and will be removed in 4.0.0.');
$c = 1;
$url = Router::url($url);
$hash = $object . substr(md5($object . $url), 0, 10);
while (in_array($hash, $this->uuids)) {
$hash = $object .... | php | public function uuid($object, $url)
{
deprecationWarning('View::uuid() is deprecated and will be removed in 4.0.0.');
$c = 1;
$url = Router::url($url);
$hash = $object . substr(md5($object . $url), 0, 10);
while (in_array($hash, $this->uuids)) {
$hash = $object .... | [
"public",
"function",
"uuid",
"(",
"$",
"object",
",",
"$",
"url",
")",
"{",
"deprecationWarning",
"(",
"'View::uuid() is deprecated and will be removed in 4.0.0.'",
")",
";",
"$",
"c",
"=",
"1",
";",
"$",
"url",
"=",
"Router",
"::",
"url",
"(",
"$",
"url",
... | Generates a unique, non-random DOM ID for an object, based on the object type and the target URL.
@param string $object Type of object, i.e. 'form' or 'link'
@param string $url The object's target URL
@return string
@deprecated 3.7.0 This method is deprecated and will be removed in 4.0.0. | [
"Generates",
"a",
"unique",
"non",
"-",
"random",
"DOM",
"ID",
"for",
"an",
"object",
"based",
"on",
"the",
"object",
"type",
"and",
"the",
"target",
"URL",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1163-L1177 |
211,473 | cakephp/cakephp | src/View/View.php | View.loadHelpers | public function loadHelpers()
{
$registry = $this->helpers();
$helpers = $registry->normalizeArray($this->helpers);
foreach ($helpers as $properties) {
$this->loadHelper($properties['class'], $properties['config']);
}
return $this;
} | php | public function loadHelpers()
{
$registry = $this->helpers();
$helpers = $registry->normalizeArray($this->helpers);
foreach ($helpers as $properties) {
$this->loadHelper($properties['class'], $properties['config']);
}
return $this;
} | [
"public",
"function",
"loadHelpers",
"(",
")",
"{",
"$",
"registry",
"=",
"$",
"this",
"->",
"helpers",
"(",
")",
";",
"$",
"helpers",
"=",
"$",
"registry",
"->",
"normalizeArray",
"(",
"$",
"this",
"->",
"helpers",
")",
";",
"foreach",
"(",
"$",
"he... | Interact with the HelperRegistry to load all the helpers.
@return $this | [
"Interact",
"with",
"the",
"HelperRegistry",
"to",
"load",
"all",
"the",
"helpers",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1347-L1356 |
211,474 | cakephp/cakephp | src/View/View.php | View.helpers | public function helpers()
{
if ($this->_helpers === null) {
$this->_helpers = new HelperRegistry($this);
}
return $this->_helpers;
} | php | public function helpers()
{
if ($this->_helpers === null) {
$this->_helpers = new HelperRegistry($this);
}
return $this->_helpers;
} | [
"public",
"function",
"helpers",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_helpers",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_helpers",
"=",
"new",
"HelperRegistry",
"(",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"_helpers",
... | Get the helper registry in use by this View class.
@return \Cake\View\HelperRegistry | [
"Get",
"the",
"helper",
"registry",
"in",
"use",
"by",
"this",
"View",
"class",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1429-L1436 |
211,475 | cakephp/cakephp | src/View/View.php | View._checkFilePath | protected function _checkFilePath($file, $path)
{
if (strpos($file, '..') === false) {
return $file;
}
$absolute = realpath($file);
if (strpos($absolute, $path) !== 0) {
throw new InvalidArgumentException(sprintf(
'Cannot use "%s" as a template... | php | protected function _checkFilePath($file, $path)
{
if (strpos($file, '..') === false) {
return $file;
}
$absolute = realpath($file);
if (strpos($absolute, $path) !== 0) {
throw new InvalidArgumentException(sprintf(
'Cannot use "%s" as a template... | [
"protected",
"function",
"_checkFilePath",
"(",
"$",
"file",
",",
"$",
"path",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"file",
",",
"'..'",
")",
"===",
"false",
")",
"{",
"return",
"$",
"file",
";",
"}",
"$",
"absolute",
"=",
"realpath",
"(",
"$",... | Check that a view file path does not go outside of the defined template paths.
Only paths that contain `..` will be checked, as they are the ones most likely to
have the ability to resolve to files outside of the template paths.
@param string $file The path to the template file.
@param string $path Base path that $fi... | [
"Check",
"that",
"a",
"view",
"file",
"path",
"does",
"not",
"go",
"outside",
"of",
"the",
"defined",
"template",
"paths",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1607-L1621 |
211,476 | cakephp/cakephp | src/View/View.php | View._getLayoutFileName | protected function _getLayoutFileName($name = null)
{
if ($name === null) {
$name = $this->layout;
}
$subDir = null;
if ($this->layoutPath) {
$subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
}
list($plugin, $name) = $this->pluginSplit($name)... | php | protected function _getLayoutFileName($name = null)
{
if ($name === null) {
$name = $this->layout;
}
$subDir = null;
if ($this->layoutPath) {
$subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
}
list($plugin, $name) = $this->pluginSplit($name)... | [
"protected",
"function",
"_getLayoutFileName",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"layout",
";",
"}",
"$",
"subDir",
"=",
"null",
";",
"if",
"(",
"$",
"th... | Returns layout filename for this template as a string.
@param string|null $name The name of the layout to find.
@return string Filename for layout file (.ctp).
@throws \Cake\View\Exception\MissingLayoutException when a layout cannot be located | [
"Returns",
"layout",
"filename",
"for",
"this",
"template",
"as",
"a",
"string",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1654-L1679 |
211,477 | cakephp/cakephp | src/View/View.php | View._getElementFileName | protected function _getElementFileName($name, $pluginCheck = true)
{
list($plugin, $name) = $this->pluginSplit($name, $pluginCheck);
$paths = $this->_paths($plugin);
$elementPaths = $this->_getSubPaths(static::NAME_ELEMENT);
foreach ($paths as $path) {
foreach ($element... | php | protected function _getElementFileName($name, $pluginCheck = true)
{
list($plugin, $name) = $this->pluginSplit($name, $pluginCheck);
$paths = $this->_paths($plugin);
$elementPaths = $this->_getSubPaths(static::NAME_ELEMENT);
foreach ($paths as $path) {
foreach ($element... | [
"protected",
"function",
"_getElementFileName",
"(",
"$",
"name",
",",
"$",
"pluginCheck",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"plugin",
",",
"$",
"name",
")",
"=",
"$",
"this",
"->",
"pluginSplit",
"(",
"$",
"name",
",",
"$",
"pluginCheck",
")",
... | Finds an element filename, returns false on failure.
@param string $name The name of the element to find.
@param bool $pluginCheck - if false will ignore the request's plugin if parsed plugin is not loaded
@return string|false Either a string to the element filename or false when one can't be found. | [
"Finds",
"an",
"element",
"filename",
"returns",
"false",
"on",
"failure",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1688-L1704 |
211,478 | cakephp/cakephp | src/View/View.php | View._paths | protected function _paths($plugin = null, $cached = true)
{
if ($cached === true) {
if ($plugin === null && !empty($this->_paths)) {
return $this->_paths;
}
if ($plugin !== null && isset($this->_pathsForPlugin[$plugin])) {
return $this->_pa... | php | protected function _paths($plugin = null, $cached = true)
{
if ($cached === true) {
if ($plugin === null && !empty($this->_paths)) {
return $this->_paths;
}
if ($plugin !== null && isset($this->_pathsForPlugin[$plugin])) {
return $this->_pa... | [
"protected",
"function",
"_paths",
"(",
"$",
"plugin",
"=",
"null",
",",
"$",
"cached",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"cached",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"plugin",
"===",
"null",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",... | Return all possible paths to find view files in order
@param string|null $plugin Optional plugin name to scan for view files.
@param bool $cached Set to false to force a refresh of view paths. Default true.
@return array paths | [
"Return",
"all",
"possible",
"paths",
"to",
"find",
"view",
"files",
"in",
"order"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1743-L1784 |
211,479 | cakephp/cakephp | src/View/View.php | View._elementCache | protected function _elementCache($name, $data, $options)
{
if (isset($options['cache']['key'], $options['cache']['config'])) {
$cache = $options['cache'];
$cache['key'] = 'element_' . $cache['key'];
return $cache;
}
$plugin = null;
list($plugin, ... | php | protected function _elementCache($name, $data, $options)
{
if (isset($options['cache']['key'], $options['cache']['config'])) {
$cache = $options['cache'];
$cache['key'] = 'element_' . $cache['key'];
return $cache;
}
$plugin = null;
list($plugin, ... | [
"protected",
"function",
"_elementCache",
"(",
"$",
"name",
",",
"$",
"data",
",",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'cache'",
"]",
"[",
"'key'",
"]",
",",
"$",
"options",
"[",
"'cache'",
"]",
"[",
"'config'",
... | Generate the cache configuration options for an element.
@param string $name Element name
@param array $data Data
@param array $options Element options
@return array Element Cache configuration. | [
"Generate",
"the",
"cache",
"configuration",
"options",
"for",
"an",
"element",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1794-L1832 |
211,480 | cakephp/cakephp | src/View/View.php | View._renderElement | protected function _renderElement($file, $data, $options)
{
$current = $this->_current;
$restore = $this->_currentType;
$this->_currentType = static::TYPE_ELEMENT;
if ($options['callbacks']) {
$this->dispatchEvent('View.beforeRender', [$file]);
}
$elemen... | php | protected function _renderElement($file, $data, $options)
{
$current = $this->_current;
$restore = $this->_currentType;
$this->_currentType = static::TYPE_ELEMENT;
if ($options['callbacks']) {
$this->dispatchEvent('View.beforeRender', [$file]);
}
$elemen... | [
"protected",
"function",
"_renderElement",
"(",
"$",
"file",
",",
"$",
"data",
",",
"$",
"options",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"_current",
";",
"$",
"restore",
"=",
"$",
"this",
"->",
"_currentType",
";",
"$",
"this",
"->",
"_c... | Renders an element and fires the before and afterRender callbacks for it
and writes to the cache if a cache is used
@param string $file Element file path
@param array $data Data to render
@param array $options Element options
@return string
@triggers View.beforeRender $this, [$file]
@triggers View.afterRender $this, [... | [
"Renders",
"an",
"element",
"and",
"fires",
"the",
"before",
"and",
"afterRender",
"callbacks",
"for",
"it",
"and",
"writes",
"to",
"the",
"cache",
"if",
"a",
"cache",
"is",
"used"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/View.php#L1845-L1865 |
211,481 | cakephp/cakephp | src/View/Form/ContextFactory.php | ContextFactory.createWithDefaults | public static function createWithDefaults(array $providers = [])
{
$providers = [
[
'type' => 'orm',
'callable' => function ($request, $data) {
if (is_array($data['entity']) || $data['entity'] instanceof Traversable) {
$... | php | public static function createWithDefaults(array $providers = [])
{
$providers = [
[
'type' => 'orm',
'callable' => function ($request, $data) {
if (is_array($data['entity']) || $data['entity'] instanceof Traversable) {
$... | [
"public",
"static",
"function",
"createWithDefaults",
"(",
"array",
"$",
"providers",
"=",
"[",
"]",
")",
"{",
"$",
"providers",
"=",
"[",
"[",
"'type'",
"=>",
"'orm'",
",",
"'callable'",
"=>",
"function",
"(",
"$",
"request",
",",
"$",
"data",
")",
"{... | Create factory instance with providers "array", "form" and "orm".
@param array $providers Array of provider callables. Each element should
be of form `['type' => 'a-string', 'callable' => ..]`
@return \Cake\View\Form\ContextFactory | [
"Create",
"factory",
"instance",
"with",
"providers",
"array",
"form",
"and",
"orm",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Form/ContextFactory.php#L56-L95 |
211,482 | cakephp/cakephp | src/View/Form/ContextFactory.php | ContextFactory.addProvider | public function addProvider($type, callable $check)
{
$this->providers = [$type => ['type' => $type, 'callable' => $check]]
+ $this->providers;
return $this;
} | php | public function addProvider($type, callable $check)
{
$this->providers = [$type => ['type' => $type, 'callable' => $check]]
+ $this->providers;
return $this;
} | [
"public",
"function",
"addProvider",
"(",
"$",
"type",
",",
"callable",
"$",
"check",
")",
"{",
"$",
"this",
"->",
"providers",
"=",
"[",
"$",
"type",
"=>",
"[",
"'type'",
"=>",
"$",
"type",
",",
"'callable'",
"=>",
"$",
"check",
"]",
"]",
"+",
"$"... | Add a new context type.
Form context types allow FormHelper to interact with
data providers that come from outside CakePHP. For example
if you wanted to use an alternative ORM like Doctrine you could
create and connect a new context class to allow FormHelper to
read metadata from doctrine.
@param string $type The typ... | [
"Add",
"a",
"new",
"context",
"type",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Form/ContextFactory.php#L112-L118 |
211,483 | cakephp/cakephp | src/View/Form/ContextFactory.php | ContextFactory.get | public function get(ServerRequest $request, array $data = [])
{
$data += ['entity' => null];
foreach ($this->providers as $provider) {
$check = $provider['callable'];
$context = $check($request, $data);
if ($context) {
break;
}
... | php | public function get(ServerRequest $request, array $data = [])
{
$data += ['entity' => null];
foreach ($this->providers as $provider) {
$check = $provider['callable'];
$context = $check($request, $data);
if ($context) {
break;
}
... | [
"public",
"function",
"get",
"(",
"ServerRequest",
"$",
"request",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"+=",
"[",
"'entity'",
"=>",
"null",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"providers",
"as",
"$",
"provider",
... | Find the matching context for the data.
If no type can be matched a NullContext will be returned.
@param \Cake\Http\ServerRequest $request Request instance.
@param array $data The data to get a context provider for.
@return \Cake\View\Form\ContextInterface Context provider.
@throws \RuntimeException when the context ... | [
"Find",
"the",
"matching",
"context",
"for",
"the",
"data",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Form/ContextFactory.php#L131-L154 |
211,484 | cakephp/cakephp | src/Database/Schema/TableSchema.php | TableSchema.hasAutoincrement | public function hasAutoincrement()
{
foreach ($this->_columns as $column) {
if (isset($column['autoIncrement']) && $column['autoIncrement']) {
return true;
}
}
return false;
} | php | public function hasAutoincrement()
{
foreach ($this->_columns as $column) {
if (isset($column['autoIncrement']) && $column['autoIncrement']) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasAutoincrement",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_columns",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"column",
"[",
"'autoIncrement'",
"]",
")",
"&&",
"$",
"column",
"[",
"'autoIncrement'",
... | Check whether or not a table has an autoIncrement column defined.
@return bool | [
"Check",
"whether",
"or",
"not",
"a",
"table",
"has",
"an",
"autoIncrement",
"column",
"defined",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Schema/TableSchema.php#L648-L657 |
211,485 | cakephp/cakephp | src/Shell/SchemaCacheShell.php | SchemaCacheShell._getSchemaCache | protected function _getSchemaCache()
{
try {
$connection = ConnectionManager::get($this->params['connection']);
return new SchemaCache($connection);
} catch (RuntimeException $e) {
$this->abort($e->getMessage());
}
} | php | protected function _getSchemaCache()
{
try {
$connection = ConnectionManager::get($this->params['connection']);
return new SchemaCache($connection);
} catch (RuntimeException $e) {
$this->abort($e->getMessage());
}
} | [
"protected",
"function",
"_getSchemaCache",
"(",
")",
"{",
"try",
"{",
"$",
"connection",
"=",
"ConnectionManager",
"::",
"get",
"(",
"$",
"this",
"->",
"params",
"[",
"'connection'",
"]",
")",
";",
"return",
"new",
"SchemaCache",
"(",
"$",
"connection",
"... | Gets the Schema Cache instance
@return \Cake\Database\SchemaCache | [
"Gets",
"the",
"Schema",
"Cache",
"instance"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/SchemaCacheShell.php#L79-L88 |
211,486 | cakephp/cakephp | src/Cache/CacheEngine.php | CacheEngine.init | public function init(array $config = [])
{
$this->setConfig($config);
if (!empty($this->_config['groups'])) {
sort($this->_config['groups']);
$this->_groupPrefix = str_repeat('%s_', count($this->_config['groups']));
}
if (!is_numeric($this->_config['duration'... | php | public function init(array $config = [])
{
$this->setConfig($config);
if (!empty($this->_config['groups'])) {
sort($this->_config['groups']);
$this->_groupPrefix = str_repeat('%s_', count($this->_config['groups']));
}
if (!is_numeric($this->_config['duration'... | [
"public",
"function",
"init",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"setConfig",
"(",
"$",
"config",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_config",
"[",
"'groups'",
"]",
")",
")",
"{",
"... | Initialize the cache engine
Called automatically by the cache frontend. Merge the runtime config with the defaults
before use.
@param array $config Associative array of parameters for the engine
@return bool True if the engine has been successfully initialized, false if not | [
"Initialize",
"the",
"cache",
"engine"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/CacheEngine.php#L68-L81 |
211,487 | cakephp/cakephp | src/Cache/CacheEngine.php | CacheEngine.writeMany | public function writeMany($data)
{
$return = [];
foreach ($data as $key => $value) {
$return[$key] = $this->write($key, $value);
}
return $return;
} | php | public function writeMany($data)
{
$return = [];
foreach ($data as $key => $value) {
$return[$key] = $this->write($key, $value);
}
return $return;
} | [
"public",
"function",
"writeMany",
"(",
"$",
"data",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"return",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"write",... | Write data for many keys into cache
@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",
"data",
"for",
"many",
"keys",
"into",
"cache"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/CacheEngine.php#L110-L118 |
211,488 | cakephp/cakephp | src/Cache/CacheEngine.php | CacheEngine._key | protected function _key($key)
{
$key = $this->key($key);
if ($key === false) {
throw new InvalidArgumentException('An empty value is not valid as a cache key');
}
return $this->_config['prefix'] . $key;
} | php | protected function _key($key)
{
$key = $this->key($key);
if ($key === false) {
throw new InvalidArgumentException('An empty value is not valid as a cache key');
}
return $this->_config['prefix'] . $key;
} | [
"protected",
"function",
"_key",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"key",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"key",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'An empty value is not ... | Generates a safe key, taking account of the configured key prefix
@param string $key the key passed over
@return mixed string $key or false
@throws \InvalidArgumentException If key's value is empty | [
"Generates",
"a",
"safe",
"key",
"taking",
"account",
"of",
"the",
"configured",
"key",
"prefix"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/CacheEngine.php#L270-L278 |
211,489 | cakephp/cakephp | src/Shell/I18nShell.php | I18nShell.init | public function init($language = null)
{
if (!$language) {
$language = $this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.');
}
if (strlen($language) < 2) {
$this->abort('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
}
... | php | public function init($language = null)
{
if (!$language) {
$language = $this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.');
}
if (strlen($language) < 2) {
$this->abort('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
}
... | [
"public",
"function",
"init",
"(",
"$",
"language",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"language",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"in",
"(",
"'Please specify language code, e.g. `en`, `eng`, `en_US` etc.'",
")",
";",
"}",
"if",
... | Inits PO file from POT file.
@param string|null $language Language code to use.
@return void
@throws \Cake\Console\Exception\StopException | [
"Inits",
"PO",
"file",
"from",
"POT",
"file",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Shell/I18nShell.php#L89-L126 |
211,490 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream.createResponses | public function createResponses($headers, $content)
{
$indexes = $responses = [];
foreach ($headers as $i => $header) {
if (strtoupper(substr($header, 0, 5)) === 'HTTP/') {
$indexes[] = $i;
}
}
$last = count($indexes) - 1;
foreach ($ind... | php | public function createResponses($headers, $content)
{
$indexes = $responses = [];
foreach ($headers as $i => $header) {
if (strtoupper(substr($header, 0, 5)) === 'HTTP/') {
$indexes[] = $i;
}
}
$last = count($indexes) - 1;
foreach ($ind... | [
"public",
"function",
"createResponses",
"(",
"$",
"headers",
",",
"$",
"content",
")",
"{",
"$",
"indexes",
"=",
"$",
"responses",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"i",
"=>",
"$",
"header",
")",
"{",
"if",
"(",
"strto... | Create the response list based on the headers & content
Creates one or many response objects based on the number
of redirects that occurred.
@param array $headers The list of headers from the request(s)
@param string $content The response content.
@return \Cake\Http\Client\Response[] The list of responses from the re... | [
"Create",
"the",
"response",
"list",
"based",
"on",
"the",
"headers",
"&",
"content"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L92-L109 |
211,491 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._buildContext | protected function _buildContext(Request $request, $options)
{
$this->_buildContent($request, $options);
$this->_buildHeaders($request, $options);
$this->_buildOptions($request, $options);
$url = $request->getUri();
$scheme = parse_url($url, PHP_URL_SCHEME);
if ($sch... | php | protected function _buildContext(Request $request, $options)
{
$this->_buildContent($request, $options);
$this->_buildHeaders($request, $options);
$this->_buildOptions($request, $options);
$url = $request->getUri();
$scheme = parse_url($url, PHP_URL_SCHEME);
if ($sch... | [
"protected",
"function",
"_buildContext",
"(",
"Request",
"$",
"request",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"_buildContent",
"(",
"$",
"request",
",",
"$",
"options",
")",
";",
"$",
"this",
"->",
"_buildHeaders",
"(",
"$",
"request",
",",... | Build the stream context out of the request object.
@param \Cake\Http\Client\Request $request The request to build context from.
@param array $options Additional request options.
@return void | [
"Build",
"the",
"stream",
"context",
"out",
"of",
"the",
"request",
"object",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L118-L133 |
211,492 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._buildHeaders | protected function _buildHeaders(Request $request, $options)
{
$headers = [];
foreach ($request->getHeaders() as $name => $values) {
$headers[] = sprintf('%s: %s', $name, implode(', ', $values));
}
$this->_contextOptions['header'] = implode("\r\n", $headers);
} | php | protected function _buildHeaders(Request $request, $options)
{
$headers = [];
foreach ($request->getHeaders() as $name => $values) {
$headers[] = sprintf('%s: %s', $name, implode(', ', $values));
}
$this->_contextOptions['header'] = implode("\r\n", $headers);
} | [
"protected",
"function",
"_buildHeaders",
"(",
"Request",
"$",
"request",
",",
"$",
"options",
")",
"{",
"$",
"headers",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"request",
"->",
"getHeaders",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{... | Build the header context for the request.
Creates cookies & headers.
@param \Cake\Http\Client\Request $request The request being sent.
@param array $options Array of options to use.
@return void | [
"Build",
"the",
"header",
"context",
"for",
"the",
"request",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L144-L151 |
211,493 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._buildContent | protected function _buildContent(Request $request, $options)
{
$body = $request->getBody();
if (empty($body)) {
$this->_contextOptions['content'] = '';
return;
}
$body->rewind();
$this->_contextOptions['content'] = $body->getContents();
} | php | protected function _buildContent(Request $request, $options)
{
$body = $request->getBody();
if (empty($body)) {
$this->_contextOptions['content'] = '';
return;
}
$body->rewind();
$this->_contextOptions['content'] = $body->getContents();
} | [
"protected",
"function",
"_buildContent",
"(",
"Request",
"$",
"request",
",",
"$",
"options",
")",
"{",
"$",
"body",
"=",
"$",
"request",
"->",
"getBody",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"body",
")",
")",
"{",
"$",
"this",
"->",
"_con... | Builds the request content based on the request object.
If the $request->body() is a string, it will be used as is.
Array data will be processed with Cake\Http\Client\FormData
@param \Cake\Http\Client\Request $request The request being sent.
@param array $options Array of options to use.
@return void | [
"Builds",
"the",
"request",
"content",
"based",
"on",
"the",
"request",
"object",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L163-L173 |
211,494 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._buildOptions | protected function _buildOptions(Request $request, $options)
{
$this->_contextOptions['method'] = $request->getMethod();
$this->_contextOptions['protocol_version'] = $request->getProtocolVersion();
$this->_contextOptions['ignore_errors'] = true;
if (isset($options['timeout'])) {
... | php | protected function _buildOptions(Request $request, $options)
{
$this->_contextOptions['method'] = $request->getMethod();
$this->_contextOptions['protocol_version'] = $request->getProtocolVersion();
$this->_contextOptions['ignore_errors'] = true;
if (isset($options['timeout'])) {
... | [
"protected",
"function",
"_buildOptions",
"(",
"Request",
"$",
"request",
",",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"_contextOptions",
"[",
"'method'",
"]",
"=",
"$",
"request",
"->",
"getMethod",
"(",
")",
";",
"$",
"this",
"->",
"_contextOptions"... | Build miscellaneous options for the request.
@param \Cake\Http\Client\Request $request The request being sent.
@param array $options Array of options to use.
@return void | [
"Build",
"miscellaneous",
"options",
"for",
"the",
"request",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L182-L198 |
211,495 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._buildSslContext | protected function _buildSslContext(Request $request, $options)
{
$sslOptions = [
'ssl_verify_peer',
'ssl_verify_peer_name',
'ssl_verify_depth',
'ssl_allow_self_signed',
'ssl_cafile',
'ssl_local_cert',
'ssl_passphrase',
... | php | protected function _buildSslContext(Request $request, $options)
{
$sslOptions = [
'ssl_verify_peer',
'ssl_verify_peer_name',
'ssl_verify_depth',
'ssl_allow_self_signed',
'ssl_cafile',
'ssl_local_cert',
'ssl_passphrase',
... | [
"protected",
"function",
"_buildSslContext",
"(",
"Request",
"$",
"request",
",",
"$",
"options",
")",
"{",
"$",
"sslOptions",
"=",
"[",
"'ssl_verify_peer'",
",",
"'ssl_verify_peer_name'",
",",
"'ssl_verify_depth'",
",",
"'ssl_allow_self_signed'",
",",
"'ssl_cafile'",... | Build SSL options for the request.
@param \Cake\Http\Client\Request $request The request being sent.
@param array $options Array of options to use.
@return void | [
"Build",
"SSL",
"options",
"for",
"the",
"request",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L207-L232 |
211,496 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._send | protected function _send(Request $request)
{
$deadline = false;
if (isset($this->_contextOptions['timeout']) && $this->_contextOptions['timeout'] > 0) {
$deadline = time() + $this->_contextOptions['timeout'];
}
$url = $request->getUri();
$this->_open($url);
... | php | protected function _send(Request $request)
{
$deadline = false;
if (isset($this->_contextOptions['timeout']) && $this->_contextOptions['timeout'] > 0) {
$deadline = time() + $this->_contextOptions['timeout'];
}
$url = $request->getUri();
$this->_open($url);
... | [
"protected",
"function",
"_send",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"deadline",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_contextOptions",
"[",
"'timeout'",
"]",
")",
"&&",
"$",
"this",
"->",
"_contextOptions",
"[",
... | Open the stream and send the request.
@param \Cake\Http\Client\Request $request The request object.
@return array Array of populated Response objects
@throws \Cake\Http\Exception\HttpException | [
"Open",
"the",
"stream",
"and",
"send",
"the",
"request",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L241-L279 |
211,497 | cakephp/cakephp | src/Http/Client/Adapter/Stream.php | Stream._open | protected function _open($url)
{
set_error_handler(function ($code, $message) {
$this->_connectionErrors[] = $message;
});
try {
$this->_stream = fopen($url, 'rb', false, $this->_context);
} finally {
restore_error_handler();
}
if ... | php | protected function _open($url)
{
set_error_handler(function ($code, $message) {
$this->_connectionErrors[] = $message;
});
try {
$this->_stream = fopen($url, 'rb', false, $this->_context);
} finally {
restore_error_handler();
}
if ... | [
"protected",
"function",
"_open",
"(",
"$",
"url",
")",
"{",
"set_error_handler",
"(",
"function",
"(",
"$",
"code",
",",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"_connectionErrors",
"[",
"]",
"=",
"$",
"message",
";",
"}",
")",
";",
"try",
"{",... | Open the socket and handle any connection errors.
@param string $url The url to connect to.
@return void
@throws \Cake\Core\Exception\Exception | [
"Open",
"the",
"socket",
"and",
"handle",
"any",
"connection",
"errors",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Client/Adapter/Stream.php#L301-L315 |
211,498 | cakephp/cakephp | src/View/SerializedView.php | SerializedView.render | public function render($view = null, $layout = null)
{
$serialize = false;
if (isset($this->viewVars['_serialize'])) {
$serialize = $this->viewVars['_serialize'];
}
if ($serialize !== false) {
$result = $this->_serialize($serialize);
if ($result =... | php | public function render($view = null, $layout = null)
{
$serialize = false;
if (isset($this->viewVars['_serialize'])) {
$serialize = $this->viewVars['_serialize'];
}
if ($serialize !== false) {
$result = $this->_serialize($serialize);
if ($result =... | [
"public",
"function",
"render",
"(",
"$",
"view",
"=",
"null",
",",
"$",
"layout",
"=",
"null",
")",
"{",
"$",
"serialize",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"viewVars",
"[",
"'_serialize'",
"]",
")",
")",
"{",
"$",
"... | Render view template or return serialized data.
### Special parameters
`_serialize` To convert a set of view variables into a serialized form.
Its value can be a string for single variable name or array for multiple
names. If true all view variables will be serialized. If unset normal
view template will be rendered.
... | [
"Render",
"view",
"template",
"or",
"return",
"serialized",
"data",
"."
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/SerializedView.php#L89-L107 |
211,499 | cakephp/cakephp | src/Cache/Engine/XcacheEngine.php | XcacheEngine.increment | public function increment($key, $offset = 1)
{
$key = $this->_key($key);
return xcache_inc($key, $offset);
} | php | public function increment($key, $offset = 1)
{
$key = $this->_key($key);
return xcache_inc($key, $offset);
} | [
"public",
"function",
"increment",
"(",
"$",
"key",
",",
"$",
"offset",
"=",
"1",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"_key",
"(",
"$",
"key",
")",
";",
"return",
"xcache_inc",
"(",
"$",
"key",
",",
"$",
"offset",
")",
";",
"}"
] | Increments the value of an integer cached key
If the cache key is not an integer it will be treated as 0
@param string $key Identifier for the data
@param int $offset How much to increment
@return bool|int New incremented value, false otherwise | [
"Increments",
"the",
"value",
"of",
"an",
"integer",
"cached",
"key",
"If",
"the",
"cache",
"key",
"is",
"not",
"an",
"integer",
"it",
"will",
"be",
"treated",
"as",
"0"
] | 5f6c9d65dcbbfc093410d1dbbb207a17f4cde540 | https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/Engine/XcacheEngine.php#L130-L135 |
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.