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
210,700
cakephp/cakephp
src/Event/Decorator/ConditionDecorator.php
ConditionDecorator._evaluateCondition
protected function _evaluateCondition($condition, Event $event) { if (!isset($this->_options[$condition])) { return $condition !== 'unless'; } if (!is_callable($this->_options[$condition])) { throw new RuntimeException(self::class . ' the `' . $condition . '` conditio...
php
protected function _evaluateCondition($condition, Event $event) { if (!isset($this->_options[$condition])) { return $condition !== 'unless'; } if (!is_callable($this->_options[$condition])) { throw new RuntimeException(self::class . ' the `' . $condition . '` conditio...
[ "protected", "function", "_evaluateCondition", "(", "$", "condition", ",", "Event", "$", "event", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_options", "[", "$", "condition", "]", ")", ")", "{", "return", "$", "condition", "!==", "'unl...
Evaluates the filter conditions @param string $condition Condition type @param \Cake\Event\Event $event Event object @return bool
[ "Evaluates", "the", "filter", "conditions" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Event/Decorator/ConditionDecorator.php#L63-L73
210,701
cakephp/cakephp
src/Auth/Storage/SessionStorage.php
SessionStorage.read
public function read() { if ($this->_user !== null) { return $this->_user ?: null; } $this->_user = $this->_session->read($this->_config['key']) ?: false; return $this->_user ?: null; }
php
public function read() { if ($this->_user !== null) { return $this->_user ?: null; } $this->_user = $this->_session->read($this->_config['key']) ?: false; return $this->_user ?: null; }
[ "public", "function", "read", "(", ")", "{", "if", "(", "$", "this", "->", "_user", "!==", "null", ")", "{", "return", "$", "this", "->", "_user", "?", ":", "null", ";", "}", "$", "this", "->", "_user", "=", "$", "this", "->", "_session", "->", ...
Read user record from session. @return array|null User record if available else null.
[ "Read", "user", "record", "from", "session", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Auth/Storage/SessionStorage.php#L78-L87
210,702
cakephp/cakephp
src/Auth/Storage/SessionStorage.php
SessionStorage.write
public function write($user) { $this->_user = $user; $this->_session->renew(); $this->_session->write($this->_config['key'], $user); }
php
public function write($user) { $this->_user = $user; $this->_session->renew(); $this->_session->write($this->_config['key'], $user); }
[ "public", "function", "write", "(", "$", "user", ")", "{", "$", "this", "->", "_user", "=", "$", "user", ";", "$", "this", "->", "_session", "->", "renew", "(", ")", ";", "$", "this", "->", "_session", "->", "write", "(", "$", "this", "->", "_con...
Write user record to session. The session id is also renewed to help mitigate issues with session replays. @param array|\ArrayAccess $user User record. @return void
[ "Write", "user", "record", "to", "session", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Auth/Storage/SessionStorage.php#L97-L103
210,703
cakephp/cakephp
src/Auth/Storage/SessionStorage.php
SessionStorage.delete
public function delete() { $this->_user = false; $this->_session->delete($this->_config['key']); $this->_session->renew(); }
php
public function delete() { $this->_user = false; $this->_session->delete($this->_config['key']); $this->_session->renew(); }
[ "public", "function", "delete", "(", ")", "{", "$", "this", "->", "_user", "=", "false", ";", "$", "this", "->", "_session", "->", "delete", "(", "$", "this", "->", "_config", "[", "'key'", "]", ")", ";", "$", "this", "->", "_session", "->", "renew...
Delete user record from session. The session id is also renewed to help mitigate issues with session replays. @return void
[ "Delete", "user", "record", "from", "session", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Auth/Storage/SessionStorage.php#L112-L118
210,704
cakephp/cakephp
src/Routing/DispatcherFactory.php
DispatcherFactory.add
public static function add($filter, array $options = []) { if (is_string($filter)) { $filter = static::_createFilter($filter, $options); } static::$_stack[] = $filter; return $filter; }
php
public static function add($filter, array $options = []) { if (is_string($filter)) { $filter = static::_createFilter($filter, $options); } static::$_stack[] = $filter; return $filter; }
[ "public", "static", "function", "add", "(", "$", "filter", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "is_string", "(", "$", "filter", ")", ")", "{", "$", "filter", "=", "static", "::", "_createFilter", "(", "$", "filter", ",...
Add a new middleware object to the stack of middleware that will be executed. Instances of filters will be re-used across all sub-requests in a request. @param string|\Cake\Routing\DispatcherFilter $filter Either the classname of the filter or an instance to use. @param array $options Constructor arguments/options fo...
[ "Add", "a", "new", "middleware", "object", "to", "the", "stack", "of", "middleware", "that", "will", "be", "executed", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/DispatcherFactory.php#L50-L58
210,705
cakephp/cakephp
src/Routing/DispatcherFactory.php
DispatcherFactory._createFilter
protected static function _createFilter($name, $options) { $className = App::className($name, 'Routing/Filter', 'Filter'); if (!$className) { $msg = sprintf('Cannot locate dispatcher filter named "%s".', $name); throw new MissingDispatcherFilterException($msg); } ...
php
protected static function _createFilter($name, $options) { $className = App::className($name, 'Routing/Filter', 'Filter'); if (!$className) { $msg = sprintf('Cannot locate dispatcher filter named "%s".', $name); throw new MissingDispatcherFilterException($msg); } ...
[ "protected", "static", "function", "_createFilter", "(", "$", "name", ",", "$", "options", ")", "{", "$", "className", "=", "App", "::", "className", "(", "$", "name", ",", "'Routing/Filter'", ",", "'Filter'", ")", ";", "if", "(", "!", "$", "className", ...
Create an instance of a filter. @param string $name The name of the filter to build. @param array $options Constructor arguments/options for the filter. @return \Cake\Routing\DispatcherFilter @throws \Cake\Routing\Exception\MissingDispatcherFilterException When filters cannot be found.
[ "Create", "an", "instance", "of", "a", "filter", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/DispatcherFactory.php#L68-L77
210,706
cakephp/cakephp
src/Routing/DispatcherFactory.php
DispatcherFactory.create
public static function create() { $dispatcher = new Dispatcher(); foreach (static::$_stack as $middleware) { $dispatcher->addFilter($middleware); } return $dispatcher; }
php
public static function create() { $dispatcher = new Dispatcher(); foreach (static::$_stack as $middleware) { $dispatcher->addFilter($middleware); } return $dispatcher; }
[ "public", "static", "function", "create", "(", ")", "{", "$", "dispatcher", "=", "new", "Dispatcher", "(", ")", ";", "foreach", "(", "static", "::", "$", "_stack", "as", "$", "middleware", ")", "{", "$", "dispatcher", "->", "addFilter", "(", "$", "midd...
Create a dispatcher that has all the configured middleware applied. @return \Cake\Routing\Dispatcher
[ "Create", "a", "dispatcher", "that", "has", "all", "the", "configured", "middleware", "applied", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/DispatcherFactory.php#L84-L92
210,707
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.toHeaderValue
public function toHeaderValue() { $value = $this->value; if ($this->isExpanded) { $value = $this->_flatten($this->value); } $headerValue[] = sprintf('%s=%s', $this->name, rawurlencode($value)); if ($this->expiresAt) { $headerValue[] = sprintf('expires...
php
public function toHeaderValue() { $value = $this->value; if ($this->isExpanded) { $value = $this->_flatten($this->value); } $headerValue[] = sprintf('%s=%s', $this->name, rawurlencode($value)); if ($this->expiresAt) { $headerValue[] = sprintf('expires...
[ "public", "function", "toHeaderValue", "(", ")", "{", "$", "value", "=", "$", "this", "->", "value", ";", "if", "(", "$", "this", "->", "isExpanded", ")", "{", "$", "value", "=", "$", "this", "->", "_flatten", "(", "$", "this", "->", "value", ")", ...
Returns a header value as string @return string
[ "Returns", "a", "header", "value", "as", "string" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L159-L184
210,708
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.validateName
protected function validateName($name) { if (preg_match("/[=,;\t\r\n\013\014]/", $name)) { throw new InvalidArgumentException( sprintf('The cookie name `%s` contains invalid characters.', $name) ); } if (empty($name)) { throw new InvalidAr...
php
protected function validateName($name) { if (preg_match("/[=,;\t\r\n\013\014]/", $name)) { throw new InvalidArgumentException( sprintf('The cookie name `%s` contains invalid characters.', $name) ); } if (empty($name)) { throw new InvalidAr...
[ "protected", "function", "validateName", "(", "$", "name", ")", "{", "if", "(", "preg_match", "(", "\"/[=,;\\t\\r\\n\\013\\014]/\"", ",", "$", "name", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "sprintf", "(", "'The cookie name `%s` contains inv...
Validates the cookie name @param string $name Name of the cookie @return void @throws \InvalidArgumentException @link https://tools.ietf.org/html/rfc2616#section-2.2 Rules for naming cookies.
[ "Validates", "the", "cookie", "name" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L222-L233
210,709
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.check
public function check($path) { if ($this->isExpanded === false) { $this->value = $this->_expand($this->value); } return Hash::check($this->value, $path); }
php
public function check($path) { if ($this->isExpanded === false) { $this->value = $this->_expand($this->value); } return Hash::check($this->value, $path); }
[ "public", "function", "check", "(", "$", "path", ")", "{", "if", "(", "$", "this", "->", "isExpanded", "===", "false", ")", "{", "$", "this", "->", "value", "=", "$", "this", "->", "_expand", "(", "$", "this", "->", "value", ")", ";", "}", "retur...
Checks if a value exists in the cookie data. This method will expand serialized complex data, on first use. @param string $path Path to check @return bool
[ "Checks", "if", "a", "value", "exists", "in", "the", "cookie", "data", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L479-L486
210,710
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.withAddedValue
public function withAddedValue($path, $value) { $new = clone $this; if ($new->isExpanded === false) { $new->value = $new->_expand($new->value); } $new->value = Hash::insert($new->value, $path, $value); return $new; }
php
public function withAddedValue($path, $value) { $new = clone $this; if ($new->isExpanded === false) { $new->value = $new->_expand($new->value); } $new->value = Hash::insert($new->value, $path, $value); return $new; }
[ "public", "function", "withAddedValue", "(", "$", "path", ",", "$", "value", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "if", "(", "$", "new", "->", "isExpanded", "===", "false", ")", "{", "$", "new", "->", "value", "=", "$", "new", "-...
Create a new cookie with updated data. @param string $path Path to write to @param mixed $value Value to write @return static
[ "Create", "a", "new", "cookie", "with", "updated", "data", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L495-L504
210,711
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.withoutAddedValue
public function withoutAddedValue($path) { $new = clone $this; if ($new->isExpanded === false) { $new->value = $new->_expand($new->value); } $new->value = Hash::remove($new->value, $path); return $new; }
php
public function withoutAddedValue($path) { $new = clone $this; if ($new->isExpanded === false) { $new->value = $new->_expand($new->value); } $new->value = Hash::remove($new->value, $path); return $new; }
[ "public", "function", "withoutAddedValue", "(", "$", "path", ")", "{", "$", "new", "=", "clone", "$", "this", ";", "if", "(", "$", "new", "->", "isExpanded", "===", "false", ")", "{", "$", "new", "->", "value", "=", "$", "new", "->", "_expand", "("...
Create a new cookie without a specific path @param string $path Path to remove @return static
[ "Create", "a", "new", "cookie", "without", "a", "specific", "path" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L512-L521
210,712
cakephp/cakephp
src/Http/Cookie/Cookie.php
Cookie.read
public function read($path = null) { if ($this->isExpanded === false) { $this->value = $this->_expand($this->value); } if ($path === null) { return $this->value; } return Hash::get($this->value, $path); }
php
public function read($path = null) { if ($this->isExpanded === false) { $this->value = $this->_expand($this->value); } if ($path === null) { return $this->value; } return Hash::get($this->value, $path); }
[ "public", "function", "read", "(", "$", "path", "=", "null", ")", "{", "if", "(", "$", "this", "->", "isExpanded", "===", "false", ")", "{", "$", "this", "->", "value", "=", "$", "this", "->", "_expand", "(", "$", "this", "->", "value", ")", ";",...
Read data from the cookie This method will expand serialized complex data, on first use. @param string $path Path to read the data from @return mixed
[ "Read", "data", "from", "the", "cookie" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Cookie/Cookie.php#L532-L543
210,713
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._yearSelect
protected function _yearSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'start' => date('Y', strtotime('-5 years')), 'end' => date('Y', strtotime('+5 years')), 'order' => 'desc', 'templateVars' => [], ...
php
protected function _yearSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'start' => date('Y', strtotime('-5 years')), 'end' => date('Y', strtotime('+5 years')), 'order' => 'desc', 'templateVars' => [], ...
[ "protected", "function", "_yearSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'start'", "=>", "date", "(", "'Y'", ",", "strtotime", "(", "'-5 years'", ")",...
Generates a year select @param array $options Options list. @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "year", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L317-L342
210,714
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._monthSelect
protected function _monthSelect($options, $context) { $options += [ 'name' => '', 'names' => false, 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars' => [], ]; if (empty($options['opti...
php
protected function _monthSelect($options, $context) { $options += [ 'name' => '', 'names' => false, 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars' => [], ]; if (empty($options['opti...
[ "protected", "function", "_monthSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'names'", "=>", "false", ",", "'val'", "=>", "null", ",", "'leadingZeroKey'", "=>", "true", ",", "'leading...
Generates a month select @param array $options The options to build the month select with @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "month", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L351-L375
210,715
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._daySelect
protected function _daySelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars' => [], ]; $options['options'] = $this->_generateNumbers(1, 31, $opt...
php
protected function _daySelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars' => [], ]; $options['options'] = $this->_generateNumbers(1, 31, $opt...
[ "protected", "function", "_daySelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'leadingZeroKey'", "=>", "true", ",", "'leadingZeroValue'", "=>", "false", ",", ...
Generates a day select @param array $options The options to generate a day select with. @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "day", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L384-L398
210,716
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._hourSelect
protected function _hourSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'format' => 24, 'start' => null, 'end' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars...
php
protected function _hourSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'format' => 24, 'start' => null, 'end' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => false, 'templateVars...
[ "protected", "function", "_hourSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'format'", "=>", "24", ",", "'start'", "=>", "null", ",", "'end'", "=>", "n...
Generates a hour select @param array $options The options to generate an hour select with @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "hour", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L407-L454
210,717
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._minuteSelect
protected function _minuteSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'interval' => 1, 'round' => 'up', 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'templateVars' => [], ]; ...
php
protected function _minuteSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'interval' => 1, 'round' => 'up', 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'templateVars' => [], ]; ...
[ "protected", "function", "_minuteSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'interval'", "=>", "1", ",", "'round'", "=>", "'up'", ",", "'leadingZeroKey'"...
Generates a minute select @param array $options The options to generate a minute select with. @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "minute", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L463-L487
210,718
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._secondSelect
protected function _secondSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'options' => $this->_generateNumbers(0, 59), 'templateVars' => [], ]; ...
php
protected function _secondSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'options' => $this->_generateNumbers(0, 59), 'templateVars' => [], ]; ...
[ "protected", "function", "_secondSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'leadingZeroKey'", "=>", "true", ",", "'leadingZeroValue'", "=>", "true", ",", ...
Generates a second select @param array $options The options to generate a second select with @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "second", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L496-L510
210,719
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._meridianSelect
protected function _meridianSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'options' => ['am' => 'am', 'pm' => 'pm'], 'templateVars' => [], ]; return $this->_select->render($options, $context); }
php
protected function _meridianSelect($options, $context) { $options += [ 'name' => '', 'val' => null, 'options' => ['am' => 'am', 'pm' => 'pm'], 'templateVars' => [], ]; return $this->_select->render($options, $context); }
[ "protected", "function", "_meridianSelect", "(", "$", "options", ",", "$", "context", ")", "{", "$", "options", "+=", "[", "'name'", "=>", "''", ",", "'val'", "=>", "null", ",", "'options'", "=>", "[", "'am'", "=>", "'am'", ",", "'pm'", "=>", "'pm'", ...
Generates a meridian select @param array $options The options to generate a meridian select with. @param \Cake\View\Form\ContextInterface $context The current form context. @return string
[ "Generates", "a", "meridian", "select" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L519-L529
210,720
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._getMonthNames
protected function _getMonthNames($leadingZero = false) { $months = [ '01' => __d('cake', 'January'), '02' => __d('cake', 'February'), '03' => __d('cake', 'March'), '04' => __d('cake', 'April'), '05' => __d('cake', 'May'), '06' => __d('...
php
protected function _getMonthNames($leadingZero = false) { $months = [ '01' => __d('cake', 'January'), '02' => __d('cake', 'February'), '03' => __d('cake', 'March'), '04' => __d('cake', 'April'), '05' => __d('cake', 'May'), '06' => __d('...
[ "protected", "function", "_getMonthNames", "(", "$", "leadingZero", "=", "false", ")", "{", "$", "months", "=", "[", "'01'", "=>", "__d", "(", "'cake'", ",", "'January'", ")", ",", "'02'", "=>", "__d", "(", "'cake'", ",", "'February'", ")", ",", "'03'"...
Returns a translated list of month names @param bool $leadingZero Whether to generate month keys with leading zero. @return array
[ "Returns", "a", "translated", "list", "of", "month", "names" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L537-L563
210,721
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget._generateNumbers
protected function _generateNumbers($start, $end, $options = []) { $options += [ 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'interval' => 1 ]; $numbers = []; $i = $start; while ($i <= $end) { $key = (string)$i; ...
php
protected function _generateNumbers($start, $end, $options = []) { $options += [ 'leadingZeroKey' => true, 'leadingZeroValue' => true, 'interval' => 1 ]; $numbers = []; $i = $start; while ($i <= $end) { $key = (string)$i; ...
[ "protected", "function", "_generateNumbers", "(", "$", "start", ",", "$", "end", ",", "$", "options", "=", "[", "]", ")", "{", "$", "options", "+=", "[", "'leadingZeroKey'", "=>", "true", ",", "'leadingZeroValue'", "=>", "true", ",", "'interval'", "=>", ...
Generates a range of numbers ### Options - leadingZeroKey - Set to true to add a leading 0 to single digit keys. - leadingZeroValue - Set to true to add a leading 0 to single digit values. - interval - The interval to generate numbers for. Defaults to 1. @param int $start Start of the range of numbers to generate @p...
[ "Generates", "a", "range", "of", "numbers" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L579-L603
210,722
cakephp/cakephp
src/View/Widget/DateTimeWidget.php
DateTimeWidget.secureFields
public function secureFields(array $data) { $data = $this->_normalizeData($data); $fields = []; foreach ($this->_selects as $select) { if ($data[$select] === false || $data[$select] === null) { continue; } $fields[] = $data['name'] . '[' ...
php
public function secureFields(array $data) { $data = $this->_normalizeData($data); $fields = []; foreach ($this->_selects as $select) { if ($data[$select] === false || $data[$select] === null) { continue; } $fields[] = $data['name'] . '[' ...
[ "public", "function", "secureFields", "(", "array", "$", "data", ")", "{", "$", "data", "=", "$", "this", "->", "_normalizeData", "(", "$", "data", ")", ";", "$", "fields", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_selects", "as", "$...
Returns a list of fields that need to be secured for this widget. When the hour picker is in 24hr mode (null or format=24) the meridian picker will be omitted. @param array $data The data to render. @return array Array of fields to secure.
[ "Returns", "a", "list", "of", "fields", "that", "need", "to", "be", "secured", "for", "this", "widget", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/DateTimeWidget.php#L614-L628
210,723
cakephp/cakephp
src/View/Widget/MultiCheckboxWidget.php
MultiCheckboxWidget.render
public function render(array $data, ContextInterface $context) { $data += [ 'name' => '', 'escape' => true, 'options' => [], 'disabled' => null, 'val' => null, 'idPrefix' => null, 'templateVars' => [], 'label' =>...
php
public function render(array $data, ContextInterface $context) { $data += [ 'name' => '', 'escape' => true, 'options' => [], 'disabled' => null, 'val' => null, 'idPrefix' => null, 'templateVars' => [], 'label' =>...
[ "public", "function", "render", "(", "array", "$", "data", ",", "ContextInterface", "$", "context", ")", "{", "$", "data", "+=", "[", "'name'", "=>", "''", ",", "'escape'", "=>", "true", ",", "'options'", "=>", "[", "]", ",", "'disabled'", "=>", "null"...
Render multi-checkbox widget. Data supports the following options. - `name` The name attribute of the inputs to create. `[]` will be appended to the name. - `options` An array of options to create checkboxes out of. - `val` Either a string/integer or array of values that should be checked. Can also be a complex optio...
[ "Render", "multi", "-", "checkbox", "widget", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/MultiCheckboxWidget.php#L106-L122
210,724
cakephp/cakephp
src/View/Widget/MultiCheckboxWidget.php
MultiCheckboxWidget._renderInputs
protected function _renderInputs($data, $context) { $out = []; foreach ($data['options'] as $key => $val) { // Grouped inputs in a fieldset. if (is_string($key) && is_array($val) && !isset($val['text'], $val['value'])) { $inputs = $this->_renderInputs(['option...
php
protected function _renderInputs($data, $context) { $out = []; foreach ($data['options'] as $key => $val) { // Grouped inputs in a fieldset. if (is_string($key) && is_array($val) && !isset($val['text'], $val['value'])) { $inputs = $this->_renderInputs(['option...
[ "protected", "function", "_renderInputs", "(", "$", "data", ",", "$", "context", ")", "{", "$", "out", "=", "[", "]", ";", "foreach", "(", "$", "data", "[", "'options'", "]", "as", "$", "key", "=>", "$", "val", ")", "{", "// Grouped inputs in a fieldse...
Render the checkbox inputs. @param array $data The data array defining the checkboxes. @param \Cake\View\Form\ContextInterface $context The current form context. @return array An array of rendered inputs.
[ "Render", "the", "checkbox", "inputs", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/MultiCheckboxWidget.php#L131-L173
210,725
cakephp/cakephp
src/View/Widget/MultiCheckboxWidget.php
MultiCheckboxWidget._renderInput
protected function _renderInput($checkbox, $context) { $input = $this->_templates->format('checkbox', [ 'name' => $checkbox['name'] . '[]', 'value' => $checkbox['escape'] ? h($checkbox['value']) : $checkbox['value'], 'templateVars' => $checkbox['templateVars'], ...
php
protected function _renderInput($checkbox, $context) { $input = $this->_templates->format('checkbox', [ 'name' => $checkbox['name'] . '[]', 'value' => $checkbox['escape'] ? h($checkbox['value']) : $checkbox['value'], 'templateVars' => $checkbox['templateVars'], ...
[ "protected", "function", "_renderInput", "(", "$", "checkbox", ",", "$", "context", ")", "{", "$", "input", "=", "$", "this", "->", "_templates", "->", "format", "(", "'checkbox'", ",", "[", "'name'", "=>", "$", "checkbox", "[", "'name'", "]", ".", "'[...
Render a single checkbox & wrapper. @param array $checkbox An array containing checkbox key/value option pairs @param \Cake\View\Form\ContextInterface $context Context object. @return string
[ "Render", "a", "single", "checkbox", "&", "wrapper", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/View/Widget/MultiCheckboxWidget.php#L182-L218
210,726
cakephp/cakephp
src/Error/BaseErrorHandler.php
BaseErrorHandler.increaseMemoryLimit
public function increaseMemoryLimit($additionalKb) { $limit = ini_get('memory_limit'); if (!strlen($limit) || $limit === '-1') { return; } $limit = trim($limit); $units = strtoupper(substr($limit, -1)); $current = (int)substr($limit, 0, strlen($limit) - 1)...
php
public function increaseMemoryLimit($additionalKb) { $limit = ini_get('memory_limit'); if (!strlen($limit) || $limit === '-1') { return; } $limit = trim($limit); $units = strtoupper(substr($limit, -1)); $current = (int)substr($limit, 0, strlen($limit) - 1)...
[ "public", "function", "increaseMemoryLimit", "(", "$", "additionalKb", ")", "{", "$", "limit", "=", "ini_get", "(", "'memory_limit'", ")", ";", "if", "(", "!", "strlen", "(", "$", "limit", ")", "||", "$", "limit", "===", "'-1'", ")", "{", "return", ";"...
Increases the PHP "memory_limit" ini setting by the specified amount in kilobytes @param int $additionalKb Number in kilobytes @return void
[ "Increases", "the", "PHP", "memory_limit", "ini", "setting", "by", "the", "specified", "amount", "in", "kilobytes" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Error/BaseErrorHandler.php#L243-L264
210,727
cakephp/cakephp
src/Error/BaseErrorHandler.php
BaseErrorHandler._getMessage
protected function _getMessage(Exception $exception) { $message = $this->getMessageForException($exception); $request = Router::getRequest(); if ($request) { $message .= $this->_requestContext($request); } return $message; }
php
protected function _getMessage(Exception $exception) { $message = $this->getMessageForException($exception); $request = Router::getRequest(); if ($request) { $message .= $this->_requestContext($request); } return $message; }
[ "protected", "function", "_getMessage", "(", "Exception", "$", "exception", ")", "{", "$", "message", "=", "$", "this", "->", "getMessageForException", "(", "$", "exception", ")", ";", "$", "request", "=", "Router", "::", "getRequest", "(", ")", ";", "if",...
Generates a formatted error message @param \Exception $exception Exception instance @return string Formatted message
[ "Generates", "a", "formatted", "error", "message" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Error/BaseErrorHandler.php#L356-L366
210,728
cakephp/cakephp
src/Error/BaseErrorHandler.php
BaseErrorHandler.mapErrorCode
public static function mapErrorCode($code) { $levelMap = [ E_PARSE => 'error', E_ERROR => 'error', E_CORE_ERROR => 'error', E_COMPILE_ERROR => 'error', E_USER_ERROR => 'error', E_WARNING => 'warning', E_USER_WARNING => 'warn...
php
public static function mapErrorCode($code) { $levelMap = [ E_PARSE => 'error', E_ERROR => 'error', E_CORE_ERROR => 'error', E_COMPILE_ERROR => 'error', E_USER_ERROR => 'error', E_WARNING => 'warning', E_USER_WARNING => 'warn...
[ "public", "static", "function", "mapErrorCode", "(", "$", "code", ")", "{", "$", "levelMap", "=", "[", "E_PARSE", "=>", "'error'", ",", "E_ERROR", "=>", "'error'", ",", "E_CORE_ERROR", "=>", "'error'", ",", "E_COMPILE_ERROR", "=>", "'error'", ",", "E_USER_ER...
Map an error code into an Error word, and log location. @param int $code Error code to map @return array Array of error word, and log location.
[ "Map", "an", "error", "code", "into", "an", "Error", "word", "and", "log", "location", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Error/BaseErrorHandler.php#L417-L447
210,729
cakephp/cakephp
src/Database/Expression/BetweenExpression.php
BetweenExpression._bindValue
protected function _bindValue($value, $generator, $type) { $placeholder = $generator->placeholder('c'); $generator->bind($placeholder, $value, $type); return $placeholder; }
php
protected function _bindValue($value, $generator, $type) { $placeholder = $generator->placeholder('c'); $generator->bind($placeholder, $value, $type); return $placeholder; }
[ "protected", "function", "_bindValue", "(", "$", "value", ",", "$", "generator", ",", "$", "type", ")", "{", "$", "placeholder", "=", "$", "generator", "->", "placeholder", "(", "'c'", ")", ";", "$", "generator", "->", "bind", "(", "$", "placeholder", ...
Registers a value in the placeholder generator and returns the generated placeholder @param mixed $value The value to bind @param \Cake\Database\ValueBinder $generator The value binder to use @param string $type The type of $value @return string generated placeholder
[ "Registers", "a", "value", "in", "the", "placeholder", "generator", "and", "returns", "the", "generated", "placeholder" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Database/Expression/BetweenExpression.php#L122-L128
210,730
cakephp/cakephp
src/Http/Server.php
Server.bootstrap
protected function bootstrap() { $this->app->bootstrap(); if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginBootstrap(); } }
php
protected function bootstrap() { $this->app->bootstrap(); if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginBootstrap(); } }
[ "protected", "function", "bootstrap", "(", ")", "{", "$", "this", "->", "app", "->", "bootstrap", "(", ")", ";", "if", "(", "$", "this", "->", "app", "instanceof", "PluginApplicationInterface", ")", "{", "$", "this", "->", "app", "->", "pluginBootstrap", ...
Application bootstrap wrapper. Calls `bootstrap()` and `events()` if application implements `EventApplicationInterface`. After the application is bootstrapped and events are attached, plugins are bootstrapped and have their events attached. @return void
[ "Application", "bootstrap", "wrapper", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Server.php#L119-L126
210,731
cakephp/cakephp
src/Http/Server.php
Server.emit
public function emit(ResponseInterface $response, EmitterInterface $emitter = null) { if (!$emitter) { $emitter = new ResponseEmitter(); } $emitter->emit($response); }
php
public function emit(ResponseInterface $response, EmitterInterface $emitter = null) { if (!$emitter) { $emitter = new ResponseEmitter(); } $emitter->emit($response); }
[ "public", "function", "emit", "(", "ResponseInterface", "$", "response", ",", "EmitterInterface", "$", "emitter", "=", "null", ")", "{", "if", "(", "!", "$", "emitter", ")", "{", "$", "emitter", "=", "new", "ResponseEmitter", "(", ")", ";", "}", "$", "...
Emit the response using the PHP SAPI. @param \Psr\Http\Message\ResponseInterface $response The response to emit @param \Zend\Diactoros\Response\EmitterInterface|null $emitter The emitter to use. When null, a SAPI Stream Emitter will be used. @return void
[ "Emit", "the", "response", "using", "the", "PHP", "SAPI", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Server.php#L136-L142
210,732
cakephp/cakephp
src/Auth/BaseAuthenticate.php
BaseAuthenticate._findUser
protected function _findUser($username, $password = null) { $result = $this->_query($username)->first(); if (empty($result)) { // Waste time hashing the password, to prevent // timing side-channels. However, don't hash // null passwords as authentication systems ...
php
protected function _findUser($username, $password = null) { $result = $this->_query($username)->first(); if (empty($result)) { // Waste time hashing the password, to prevent // timing side-channels. However, don't hash // null passwords as authentication systems ...
[ "protected", "function", "_findUser", "(", "$", "username", ",", "$", "password", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "_query", "(", "$", "username", ")", "->", "first", "(", ")", ";", "if", "(", "empty", "(", "$", "result...
Find a user record using the username and password provided. Input passwords will be hashed even when a user doesn't exist. This helps mitigate timing attacks that are attempting to find valid usernames. @param string $username The username/identifier. @param string|null $password The password, if not provided passwo...
[ "Find", "a", "user", "record", "using", "the", "username", "and", "password", "provided", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Auth/BaseAuthenticate.php#L112-L149
210,733
cakephp/cakephp
src/Core/Plugin.php
Plugin.load
public static function load($plugin, array $config = []) { deprecationWarning( 'Plugin::load() is deprecated. ' . 'Use Application::addPlugin() instead. ' . 'This method will be removed in 4.0.0.' ); if (is_array($plugin)) { foreach ($plugin a...
php
public static function load($plugin, array $config = []) { deprecationWarning( 'Plugin::load() is deprecated. ' . 'Use Application::addPlugin() instead. ' . 'This method will be removed in 4.0.0.' ); if (is_array($plugin)) { foreach ($plugin a...
[ "public", "static", "function", "load", "(", "$", "plugin", ",", "array", "$", "config", "=", "[", "]", ")", "{", "deprecationWarning", "(", "'Plugin::load() is deprecated. '", ".", "'Use Application::addPlugin() instead. '", ".", "'This method will be removed in 4.0.0.'"...
Loads a plugin and optionally loads bootstrapping, routing files or runs an initialization function. Plugins only need to be loaded if you want bootstrapping/routes/cli commands to be exposed. If your plugin does not expose any of these features you do not need to load them. This method does not configure any autoloa...
[ "Loads", "a", "plugin", "and", "optionally", "loads", "bootstrapping", "routing", "files", "or", "runs", "an", "initialization", "function", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L113-L175
210,734
cakephp/cakephp
src/Core/Plugin.php
Plugin.loadAll
public static function loadAll(array $options = []) { $plugins = []; foreach (App::path('Plugin') as $path) { if (!is_dir($path)) { continue; } $dir = new DirectoryIterator($path); foreach ($dir as $dirPath) { if ($dirPa...
php
public static function loadAll(array $options = []) { $plugins = []; foreach (App::path('Plugin') as $path) { if (!is_dir($path)) { continue; } $dir = new DirectoryIterator($path); foreach ($dir as $dirPath) { if ($dirPa...
[ "public", "static", "function", "loadAll", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "plugins", "=", "[", "]", ";", "foreach", "(", "App", "::", "path", "(", "'Plugin'", ")", "as", "$", "path", ")", "{", "if", "(", "!", "is_dir"...
Will load all the plugins located in the default plugin folder. If passed an options array, it will be used as a common default for all plugins to be loaded It is possible to set specific defaults for each plugins in the options array. Examples: ``` Plugin::loadAll([ ['bootstrap' => true], 'DebugKit' => ['routes' => ...
[ "Will", "load", "all", "the", "plugins", "located", "in", "the", "default", "plugin", "folder", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L200-L230
210,735
cakephp/cakephp
src/Core/Plugin.php
Plugin.bootstrap
public static function bootstrap($name) { deprecationWarning( 'Plugin::bootstrap() is deprecated. ' . 'This method will be removed in 4.0.0.' ); $plugin = static::getCollection()->get($name); if (!$plugin->isEnabled('bootstrap')) { return false; ...
php
public static function bootstrap($name) { deprecationWarning( 'Plugin::bootstrap() is deprecated. ' . 'This method will be removed in 4.0.0.' ); $plugin = static::getCollection()->get($name); if (!$plugin->isEnabled('bootstrap')) { return false; ...
[ "public", "static", "function", "bootstrap", "(", "$", "name", ")", "{", "deprecationWarning", "(", "'Plugin::bootstrap() is deprecated. '", ".", "'This method will be removed in 4.0.0.'", ")", ";", "$", "plugin", "=", "static", "::", "getCollection", "(", ")", "->", ...
Loads the bootstrapping files for a plugin, or calls the initialization setup in the configuration @param string $name name of the plugin @return mixed @see \Cake\Core\Plugin::load() for examples of bootstrap configuration @deprecated 3.7.0 This method will be removed in 4.0.0.
[ "Loads", "the", "bootstrapping", "files", "for", "a", "plugin", "or", "calls", "the", "initialization", "setup", "in", "the", "configuration" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L282-L300
210,736
cakephp/cakephp
src/Core/Plugin.php
Plugin.routes
public static function routes($name = null) { deprecationWarning( 'You no longer need to call `Plugin::routes()` after upgrading to use Http\Server. ' . 'See https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' . ...
php
public static function routes($name = null) { deprecationWarning( 'You no longer need to call `Plugin::routes()` after upgrading to use Http\Server. ' . 'See https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-http-stack-to-an-existing-application ' . ...
[ "public", "static", "function", "routes", "(", "$", "name", "=", "null", ")", "{", "deprecationWarning", "(", "'You no longer need to call `Plugin::routes()` after upgrading to use Http\\Server. '", ".", "'See https://book.cakephp.org/3.0/en/development/application.html#adding-the-new-...
Loads the routes file for a plugin, or all plugins configured to load their respective routes file. If you need fine grained control over how routes are loaded for plugins, you can use {@see Cake\Routing\RouteBuilder::loadPlugin()} @param string|null $name name of the plugin, if null will operate on all plugins havin...
[ "Loads", "the", "routes", "file", "for", "a", "plugin", "or", "all", "plugins", "configured", "to", "load", "their", "respective", "routes", "file", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L314-L337
210,737
cakephp/cakephp
src/Core/Plugin.php
Plugin.loaded
public static function loaded($plugin = null) { if ($plugin !== null) { deprecationWarning( 'Checking a single plugin with Plugin::loaded() is deprecated. ' . 'Use Plugin::isLoaded() instead.' ); return static::getCollection()->has($plugin...
php
public static function loaded($plugin = null) { if ($plugin !== null) { deprecationWarning( 'Checking a single plugin with Plugin::loaded() is deprecated. ' . 'Use Plugin::isLoaded() instead.' ); return static::getCollection()->has($plugin...
[ "public", "static", "function", "loaded", "(", "$", "plugin", "=", "null", ")", "{", "if", "(", "$", "plugin", "!==", "null", ")", "{", "deprecationWarning", "(", "'Checking a single plugin with Plugin::loaded() is deprecated. '", ".", "'Use Plugin::isLoaded() instead.'...
Return a list of loaded plugins. If a plugin name is provided, the return value will be a bool indicating whether or not the named plugin is loaded. This usage is deprecated. Instead you should use Plugin::isLoaded($name) @param string|null $plugin Plugin name. @return bool|array Boolean true if $plugin is already lo...
[ "Return", "a", "list", "of", "loaded", "plugins", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L362-L379
210,738
cakephp/cakephp
src/Core/Plugin.php
Plugin.unload
public static function unload($plugin = null) { deprecationWarning('Plugin::unload() will be removed in 4.0. Use PluginCollection::remove() or clear()'); if ($plugin === null) { static::getCollection()->clear(); } else { static::getCollection()->remove($plugin); ...
php
public static function unload($plugin = null) { deprecationWarning('Plugin::unload() will be removed in 4.0. Use PluginCollection::remove() or clear()'); if ($plugin === null) { static::getCollection()->clear(); } else { static::getCollection()->remove($plugin); ...
[ "public", "static", "function", "unload", "(", "$", "plugin", "=", "null", ")", "{", "deprecationWarning", "(", "'Plugin::unload() will be removed in 4.0. Use PluginCollection::remove() or clear()'", ")", ";", "if", "(", "$", "plugin", "===", "null", ")", "{", "static...
Forgets a loaded plugin or all of them if first parameter is null @param string|null $plugin name of the plugin to forget @deprecated 3.7.0 This method will be removed in 4.0.0. Use PluginCollection::remove() or clear() instead. @return void
[ "Forgets", "a", "loaded", "plugin", "or", "all", "of", "them", "if", "first", "parameter", "is", "null" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Core/Plugin.php#L388-L396
210,739
cakephp/cakephp
src/Routing/Middleware/RoutingMiddleware.php
RoutingMiddleware.buildRouteCollection
protected function buildRouteCollection() { if (Cache::enabled() && $this->cacheConfig !== null) { return Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () { return $this->prepareRouteCollection(); }, $this->cacheConfig); } return $this-...
php
protected function buildRouteCollection() { if (Cache::enabled() && $this->cacheConfig !== null) { return Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () { return $this->prepareRouteCollection(); }, $this->cacheConfig); } return $this-...
[ "protected", "function", "buildRouteCollection", "(", ")", "{", "if", "(", "Cache", "::", "enabled", "(", ")", "&&", "$", "this", "->", "cacheConfig", "!==", "null", ")", "{", "return", "Cache", "::", "remember", "(", "static", "::", "ROUTE_COLLECTION_CACHE_...
Check if route cache is enabled and use the configured Cache to 'remember' the route collection @return \Cake\Routing\RouteCollection
[ "Check", "if", "route", "cache", "is", "enabled", "and", "use", "the", "configured", "Cache", "to", "remember", "the", "route", "collection" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/Middleware/RoutingMiddleware.php#L96-L105
210,740
cakephp/cakephp
src/Routing/Middleware/RoutingMiddleware.php
RoutingMiddleware.prepareRouteCollection
protected function prepareRouteCollection() { $builder = Router::createRouteBuilder('/'); $this->app->routes($builder); if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginRoutes($builder); } return Router::getRouteCollection(); }
php
protected function prepareRouteCollection() { $builder = Router::createRouteBuilder('/'); $this->app->routes($builder); if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginRoutes($builder); } return Router::getRouteCollection(); }
[ "protected", "function", "prepareRouteCollection", "(", ")", "{", "$", "builder", "=", "Router", "::", "createRouteBuilder", "(", "'/'", ")", ";", "$", "this", "->", "app", "->", "routes", "(", "$", "builder", ")", ";", "if", "(", "$", "this", "->", "a...
Generate the route collection using the builder @return \Cake\Routing\RouteCollection
[ "Generate", "the", "route", "collection", "using", "the", "builder" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Routing/Middleware/RoutingMiddleware.php#L112-L121
210,741
cakephp/cakephp
src/Collection/Iterator/NestIterator.php
NestIterator.getChildren
public function getChildren() { $property = $this->_propertyExtractor($this->_nestKey); return new static($property($this->current()), $this->_nestKey); }
php
public function getChildren() { $property = $this->_propertyExtractor($this->_nestKey); return new static($property($this->current()), $this->_nestKey); }
[ "public", "function", "getChildren", "(", ")", "{", "$", "property", "=", "$", "this", "->", "_propertyExtractor", "(", "$", "this", "->", "_nestKey", ")", ";", "return", "new", "static", "(", "$", "property", "(", "$", "this", "->", "current", "(", ")...
Returns a traversable containing the children for the current item @return \Traversable
[ "Returns", "a", "traversable", "containing", "the", "children", "for", "the", "current", "item" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Collection/Iterator/NestIterator.php#L53-L58
210,742
cakephp/cakephp
src/Collection/Iterator/NestIterator.php
NestIterator.hasChildren
public function hasChildren() { $property = $this->_propertyExtractor($this->_nestKey); $children = $property($this->current()); if (is_array($children)) { return !empty($children); } return $children instanceof Traversable; }
php
public function hasChildren() { $property = $this->_propertyExtractor($this->_nestKey); $children = $property($this->current()); if (is_array($children)) { return !empty($children); } return $children instanceof Traversable; }
[ "public", "function", "hasChildren", "(", ")", "{", "$", "property", "=", "$", "this", "->", "_propertyExtractor", "(", "$", "this", "->", "_nestKey", ")", ";", "$", "children", "=", "$", "property", "(", "$", "this", "->", "current", "(", ")", ")", ...
Returns true if there is an array or a traversable object stored under the configured nestKey for the current item @return bool
[ "Returns", "true", "if", "there", "is", "an", "array", "or", "a", "traversable", "object", "stored", "under", "the", "configured", "nestKey", "for", "the", "current", "item" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Collection/Iterator/NestIterator.php#L66-L76
210,743
cakephp/cakephp
src/Http/BaseApplication.php
BaseApplication.makePlugin
protected function makePlugin($name, array $config) { $className = $name; if (strpos($className, '\\') === false) { $className = str_replace('/', '\\', $className) . '\\' . 'Plugin'; } if (class_exists($className)) { return new $className($config); } ...
php
protected function makePlugin($name, array $config) { $className = $name; if (strpos($className, '\\') === false) { $className = str_replace('/', '\\', $className) . '\\' . 'Plugin'; } if (class_exists($className)) { return new $className($config); } ...
[ "protected", "function", "makePlugin", "(", "$", "name", ",", "array", "$", "config", ")", "{", "$", "className", "=", "$", "name", ";", "if", "(", "strpos", "(", "$", "className", ",", "'\\\\'", ")", "===", "false", ")", "{", "$", "className", "=", ...
Create a plugin instance from a classname and configuration @param string $name The plugin classname @param array $config Configuration options for the plugin @return \Cake\Core\PluginInterface
[ "Create", "a", "plugin", "instance", "from", "a", "classname", "and", "configuration" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/BaseApplication.php#L129-L145
210,744
cakephp/cakephp
src/Http/Middleware/BodyParserMiddleware.php
BodyParserMiddleware.addParser
public function addParser(array $types, callable $parser) { foreach ($types as $type) { $type = strtolower($type); $this->parsers[$type] = $parser; } return $this; }
php
public function addParser(array $types, callable $parser) { foreach ($types as $type) { $type = strtolower($type); $this->parsers[$type] = $parser; } return $this; }
[ "public", "function", "addParser", "(", "array", "$", "types", ",", "callable", "$", "parser", ")", "{", "foreach", "(", "$", "types", "as", "$", "type", ")", "{", "$", "type", "=", "strtolower", "(", "$", "type", ")", ";", "$", "this", "->", "pars...
Add a parser. Map a set of content-type header values to be parsed by the $parser. ### Example An naive CSV request body parser could be built like so: ``` $parser->addParser(['text/csv'], function ($body) { return str_getcsv($body); }); ``` @param array $types An array of content-type header values to match. eg. ...
[ "Add", "a", "parser", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Middleware/BodyParserMiddleware.php#L112-L120
210,745
cakephp/cakephp
src/Http/Middleware/BodyParserMiddleware.php
BodyParserMiddleware.decodeXml
protected function decodeXml($body) { try { $xml = Xml::build($body, ['return' => 'domdocument', 'readFile' => false]); // We might not get child nodes if there are nested inline entities. if ((int)$xml->childNodes->length > 0) { return Xml::toArray($xml);...
php
protected function decodeXml($body) { try { $xml = Xml::build($body, ['return' => 'domdocument', 'readFile' => false]); // We might not get child nodes if there are nested inline entities. if ((int)$xml->childNodes->length > 0) { return Xml::toArray($xml);...
[ "protected", "function", "decodeXml", "(", "$", "body", ")", "{", "try", "{", "$", "xml", "=", "Xml", "::", "build", "(", "$", "body", ",", "[", "'return'", "=>", "'domdocument'", ",", "'readFile'", "=>", "false", "]", ")", ";", "// We might not get chil...
Decode XML into an array. @param string $body The request body to decode @return array
[ "Decode", "XML", "into", "an", "array", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Http/Middleware/BodyParserMiddleware.php#L170-L183
210,746
cakephp/cakephp
src/Log/Engine/FileLog.php
FileLog._rotateFile
protected function _rotateFile($filename) { $filePath = $this->_path . $filename; clearstatcache(true, $filePath); if (!file_exists($filePath) || filesize($filePath) < $this->_size ) { return null; } $rotate = $this->_config['rotate']; ...
php
protected function _rotateFile($filename) { $filePath = $this->_path . $filename; clearstatcache(true, $filePath); if (!file_exists($filePath) || filesize($filePath) < $this->_size ) { return null; } $rotate = $this->_config['rotate']; ...
[ "protected", "function", "_rotateFile", "(", "$", "filename", ")", "{", "$", "filePath", "=", "$", "this", "->", "_path", ".", "$", "filename", ";", "clearstatcache", "(", "true", ",", "$", "filePath", ")", ";", "if", "(", "!", "file_exists", "(", "$",...
Rotate log file if size specified in config is reached. Also if `rotate` count is reached oldest file is removed. @param string $filename Log file name @return bool|null True if rotated successfully or false in case of error. Null if file doesn't need to be rotated.
[ "Rotate", "log", "file", "if", "size", "specified", "in", "config", "is", "reached", ".", "Also", "if", "rotate", "count", "is", "reached", "oldest", "file", "is", "removed", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Log/Engine/FileLog.php#L183-L211
210,747
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.contain
public function contain($associations = [], callable $queryBuilder = null) { if (empty($associations)) { deprecationWarning( 'Using EagerLoader::contain() as getter is deprecated. ' . 'Use getContain() instead.' ); return $this->getContain...
php
public function contain($associations = [], callable $queryBuilder = null) { if (empty($associations)) { deprecationWarning( 'Using EagerLoader::contain() as getter is deprecated. ' . 'Use getContain() instead.' ); return $this->getContain...
[ "public", "function", "contain", "(", "$", "associations", "=", "[", "]", ",", "callable", "$", "queryBuilder", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "associations", ")", ")", "{", "deprecationWarning", "(", "'Using EagerLoader::contain() as get...
Sets the list of associations that should be eagerly loaded along for a specific table using when a query is provided. The list of associated tables passed to this method must have been previously set as associations using the Table API. Associations can be arbitrarily nested using dot notation or nested arrays, this ...
[ "Sets", "the", "list", "of", "associations", "that", "should", "be", "eagerly", "loaded", "along", "for", "a", "specific", "table", "using", "when", "a", "query", "is", "provided", ".", "The", "list", "of", "associated", "tables", "passed", "to", "this", "...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L136-L168
210,748
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.clearContain
public function clearContain() { $this->_containments = []; $this->_normalized = null; $this->_loadExternal = []; $this->_aliasList = []; }
php
public function clearContain() { $this->_containments = []; $this->_normalized = null; $this->_loadExternal = []; $this->_aliasList = []; }
[ "public", "function", "clearContain", "(", ")", "{", "$", "this", "->", "_containments", "=", "[", "]", ";", "$", "this", "->", "_normalized", "=", "null", ";", "$", "this", "->", "_loadExternal", "=", "[", "]", ";", "$", "this", "->", "_aliasList", ...
Remove any existing non-matching based containments. This will reset/clear out any contained associations that were not added via matching(). @return void
[ "Remove", "any", "existing", "non", "-", "matching", "based", "containments", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L191-L197
210,749
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.normalized
public function normalized(Table $repository) { if ($this->_normalized !== null || empty($this->_containments)) { return (array)$this->_normalized; } $contain = []; foreach ($this->_containments as $alias => $options) { if (!empty($options['instance'])) { ...
php
public function normalized(Table $repository) { if ($this->_normalized !== null || empty($this->_containments)) { return (array)$this->_normalized; } $contain = []; foreach ($this->_containments as $alias => $options) { if (!empty($options['instance'])) { ...
[ "public", "function", "normalized", "(", "Table", "$", "repository", ")", "{", "if", "(", "$", "this", "->", "_normalized", "!==", "null", "||", "empty", "(", "$", "this", "->", "_containments", ")", ")", "{", "return", "(", "array", ")", "$", "this", ...
Returns the fully normalized array of associations that should be eagerly loaded for a table. The normalized array will restructure the original array by sorting all associations under one key and special options under another. Each of the levels of the associations tree will converted to a Cake\ORM\EagerLoadable obje...
[ "Returns", "the", "fully", "normalized", "array", "of", "associations", "that", "should", "be", "eagerly", "loaded", "for", "a", "table", ".", "The", "normalized", "array", "will", "restructure", "the", "original", "array", "by", "sorting", "all", "associations"...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L361-L382
210,750
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader._reformatContain
protected function _reformatContain($associations, $original) { $result = $original; foreach ((array)$associations as $table => $options) { $pointer =& $result; if (is_int($table)) { $table = $options; $options = []; } ...
php
protected function _reformatContain($associations, $original) { $result = $original; foreach ((array)$associations as $table => $options) { $pointer =& $result; if (is_int($table)) { $table = $options; $options = []; } ...
[ "protected", "function", "_reformatContain", "(", "$", "associations", ",", "$", "original", ")", "{", "$", "result", "=", "$", "original", ";", "foreach", "(", "(", "array", ")", "$", "associations", "as", "$", "table", "=>", "$", "options", ")", "{", ...
Formats the containments array so that associations are always set as keys in the array. This function merges the original associations array with the new associations provided @param array $associations user provided containments array @param array $original The original containments array to merge with the new one @...
[ "Formats", "the", "containments", "array", "so", "that", "associations", "are", "always", "set", "as", "keys", "in", "the", "array", ".", "This", "function", "merges", "the", "original", "associations", "array", "with", "the", "new", "associations", "provided" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L394-L457
210,751
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.attachAssociations
public function attachAssociations(Query $query, Table $repository, $includeFields) { if (empty($this->_containments) && $this->_matching === null) { return; } $attachable = $this->attachableAssociations($repository); $processed = []; do { foreach ($a...
php
public function attachAssociations(Query $query, Table $repository, $includeFields) { if (empty($this->_containments) && $this->_matching === null) { return; } $attachable = $this->attachableAssociations($repository); $processed = []; do { foreach ($a...
[ "public", "function", "attachAssociations", "(", "Query", "$", "query", ",", "Table", "$", "repository", ",", "$", "includeFields", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "_containments", ")", "&&", "$", "this", "->", "_matching", "===", "...
Modifies the passed query to apply joins or any other transformation required in order to eager load the associations described in the `contain` array. This method will not modify the query for loading external associations, i.e. those that cannot be loaded without executing a separate query. @param \Cake\ORM\Query $q...
[ "Modifies", "the", "passed", "query", "to", "apply", "joins", "or", "any", "other", "transformation", "required", "in", "order", "to", "eager", "load", "the", "associations", "described", "in", "the", "contain", "array", ".", "This", "method", "will", "not", ...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L472-L494
210,752
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.attachableAssociations
public function attachableAssociations(Table $repository) { $contain = $this->normalized($repository); $matching = $this->_matching ? $this->_matching->normalized($repository) : []; $this->_fixStrategies(); $this->_loadExternal = []; return $this->_resolveJoins($contain, $ma...
php
public function attachableAssociations(Table $repository) { $contain = $this->normalized($repository); $matching = $this->_matching ? $this->_matching->normalized($repository) : []; $this->_fixStrategies(); $this->_loadExternal = []; return $this->_resolveJoins($contain, $ma...
[ "public", "function", "attachableAssociations", "(", "Table", "$", "repository", ")", "{", "$", "contain", "=", "$", "this", "->", "normalized", "(", "$", "repository", ")", ";", "$", "matching", "=", "$", "this", "->", "_matching", "?", "$", "this", "->...
Returns an array with the associations that can be fetched using a single query, the array keys are the association aliases and the values will contain an array with Cake\ORM\EagerLoadable objects. @param \Cake\ORM\Table $repository The table containing the associations to be attached @return array
[ "Returns", "an", "array", "with", "the", "associations", "that", "can", "be", "fetched", "using", "a", "single", "query", "the", "array", "keys", "are", "the", "association", "aliases", "and", "the", "values", "will", "contain", "an", "array", "with", "Cake"...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L505-L513
210,753
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.externalAssociations
public function externalAssociations(Table $repository) { if ($this->_loadExternal) { return $this->_loadExternal; } $this->attachableAssociations($repository); return $this->_loadExternal; }
php
public function externalAssociations(Table $repository) { if ($this->_loadExternal) { return $this->_loadExternal; } $this->attachableAssociations($repository); return $this->_loadExternal; }
[ "public", "function", "externalAssociations", "(", "Table", "$", "repository", ")", "{", "if", "(", "$", "this", "->", "_loadExternal", ")", "{", "return", "$", "this", "->", "_loadExternal", ";", "}", "$", "this", "->", "attachableAssociations", "(", "$", ...
Returns an array with the associations that need to be fetched using a separate query, each array value will contain a Cake\ORM\EagerLoadable object. @param \Cake\ORM\Table $repository The table containing the associations to be loaded @return \Cake\ORM\EagerLoadable[]
[ "Returns", "an", "array", "with", "the", "associations", "that", "need", "to", "be", "fetched", "using", "a", "separate", "query", "each", "array", "value", "will", "contain", "a", "Cake", "\\", "ORM", "\\", "EagerLoadable", "object", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L523-L532
210,754
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader._fixStrategies
protected function _fixStrategies() { foreach ($this->_aliasList as $aliases) { foreach ($aliases as $configs) { if (count($configs) < 2) { continue; } /* @var \Cake\ORM\EagerLoadable $loadable */ foreach ($confi...
php
protected function _fixStrategies() { foreach ($this->_aliasList as $aliases) { foreach ($aliases as $configs) { if (count($configs) < 2) { continue; } /* @var \Cake\ORM\EagerLoadable $loadable */ foreach ($confi...
[ "protected", "function", "_fixStrategies", "(", ")", "{", "foreach", "(", "$", "this", "->", "_aliasList", "as", "$", "aliases", ")", "{", "foreach", "(", "$", "aliases", "as", "$", "configs", ")", "{", "if", "(", "count", "(", "$", "configs", ")", "...
Iterates over the joinable aliases list and corrects the fetching strategies in order to avoid aliases collision in the generated queries. This function operates on the array references that were generated by the _normalizeContain() function. @return void
[ "Iterates", "over", "the", "joinable", "aliases", "list", "and", "corrects", "the", "fetching", "strategies", "in", "order", "to", "avoid", "aliases", "collision", "in", "the", "generated", "queries", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L601-L616
210,755
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader._correctStrategy
protected function _correctStrategy($loadable) { $config = $loadable->getConfig(); $currentStrategy = isset($config['strategy']) ? $config['strategy'] : 'join'; if (!$loadable->canBeJoined() || $currentStrategy !== 'join') { return; } $co...
php
protected function _correctStrategy($loadable) { $config = $loadable->getConfig(); $currentStrategy = isset($config['strategy']) ? $config['strategy'] : 'join'; if (!$loadable->canBeJoined() || $currentStrategy !== 'join') { return; } $co...
[ "protected", "function", "_correctStrategy", "(", "$", "loadable", ")", "{", "$", "config", "=", "$", "loadable", "->", "getConfig", "(", ")", ";", "$", "currentStrategy", "=", "isset", "(", "$", "config", "[", "'strategy'", "]", ")", "?", "$", "config",...
Changes the association fetching strategy if required because of duplicate under the same direct associations chain @param \Cake\ORM\EagerLoadable $loadable The association config @return void
[ "Changes", "the", "association", "fetching", "strategy", "if", "required", "because", "of", "duplicate", "under", "the", "same", "direct", "associations", "chain" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L625-L639
210,756
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader._resolveJoins
protected function _resolveJoins($associations, $matching = []) { $result = []; foreach ($matching as $table => $loadable) { $result[$table] = $loadable; $result += $this->_resolveJoins($loadable->associations(), []); } foreach ($associations as $table => $loa...
php
protected function _resolveJoins($associations, $matching = []) { $result = []; foreach ($matching as $table => $loadable) { $result[$table] = $loadable; $result += $this->_resolveJoins($loadable->associations(), []); } foreach ($associations as $table => $loa...
[ "protected", "function", "_resolveJoins", "(", "$", "associations", ",", "$", "matching", "=", "[", "]", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "matching", "as", "$", "table", "=>", "$", "loadable", ")", "{", "$", "result",...
Helper function used to compile a list of all associations that can be joined in the query. @param array $associations list of associations from which to obtain joins. @param array $matching list of associations that should be forcibly joined. @return array
[ "Helper", "function", "used", "to", "compile", "a", "list", "of", "all", "associations", "that", "can", "be", "joined", "in", "the", "query", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L649-L673
210,757
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.loadExternal
public function loadExternal($query, $statement) { $external = $this->externalAssociations($query->getRepository()); if (empty($external)) { return $statement; } $driver = $query->getConnection()->getDriver(); list($collected, $statement) = $this->_collectKeys($e...
php
public function loadExternal($query, $statement) { $external = $this->externalAssociations($query->getRepository()); if (empty($external)) { return $statement; } $driver = $query->getConnection()->getDriver(); list($collected, $statement) = $this->_collectKeys($e...
[ "public", "function", "loadExternal", "(", "$", "query", ",", "$", "statement", ")", "{", "$", "external", "=", "$", "this", "->", "externalAssociations", "(", "$", "query", "->", "getRepository", "(", ")", ")", ";", "if", "(", "empty", "(", "$", "exte...
Decorates the passed statement object in order to inject data from associations that cannot be joined directly. @param \Cake\ORM\Query $query The query for which to eager load external associations @param \Cake\Database\StatementInterface $statement The statement created after executing the $query @return \Cake\Databa...
[ "Decorates", "the", "passed", "statement", "object", "in", "order", "to", "inject", "data", "from", "associations", "that", "cannot", "be", "joined", "directly", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L684-L719
210,758
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.associationsMap
public function associationsMap($table) { $map = []; if (!$this->getMatching() && !$this->getContain() && empty($this->_joinsMap)) { return $map; } $map = $this->_buildAssociationsMap($map, $this->_matching->normalized($table), true); $map = $this->_buildAssocia...
php
public function associationsMap($table) { $map = []; if (!$this->getMatching() && !$this->getContain() && empty($this->_joinsMap)) { return $map; } $map = $this->_buildAssociationsMap($map, $this->_matching->normalized($table), true); $map = $this->_buildAssocia...
[ "public", "function", "associationsMap", "(", "$", "table", ")", "{", "$", "map", "=", "[", "]", ";", "if", "(", "!", "$", "this", "->", "getMatching", "(", ")", "&&", "!", "$", "this", "->", "getContain", "(", ")", "&&", "empty", "(", "$", "this...
Returns an array having as keys a dotted path of associations that participate in this eager loader. The values of the array will contain the following keys - alias: The association alias - instance: The association instance - canBeJoined: Whether or not the association will be loaded using a JOIN - entityClass: The e...
[ "Returns", "an", "array", "having", "as", "keys", "a", "dotted", "path", "of", "associations", "that", "participate", "in", "this", "eager", "loader", ".", "The", "values", "of", "the", "array", "will", "contain", "the", "following", "keys" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L736-L749
210,759
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader.addToJoinsMap
public function addToJoinsMap($alias, Association $assoc, $asMatching = false, $targetProperty = null) { $this->_joinsMap[$alias] = new EagerLoadable($alias, [ 'aliasPath' => $alias, 'instance' => $assoc, 'canBeJoined' => true, 'forMatching' => $asMatching, ...
php
public function addToJoinsMap($alias, Association $assoc, $asMatching = false, $targetProperty = null) { $this->_joinsMap[$alias] = new EagerLoadable($alias, [ 'aliasPath' => $alias, 'instance' => $assoc, 'canBeJoined' => true, 'forMatching' => $asMatching, ...
[ "public", "function", "addToJoinsMap", "(", "$", "alias", ",", "Association", "$", "assoc", ",", "$", "asMatching", "=", "false", ",", "$", "targetProperty", "=", "null", ")", "{", "$", "this", "->", "_joinsMap", "[", "$", "alias", "]", "=", "new", "Ea...
Registers a table alias, typically loaded as a join in a query, as belonging to an association. This helps hydrators know what to do with the columns coming from such joined table. @param string $alias The table alias as it appears in the query. @param \Cake\ORM\Association $assoc The association object the alias repr...
[ "Registers", "a", "table", "alias", "typically", "loaded", "as", "a", "join", "in", "a", "query", "as", "belonging", "to", "an", "association", ".", "This", "helps", "hydrators", "know", "what", "to", "do", "with", "the", "columns", "coming", "from", "such...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L799-L808
210,760
cakephp/cakephp
src/ORM/EagerLoader.php
EagerLoader._collectKeys
protected function _collectKeys($external, $query, $statement) { $collectKeys = []; /* @var \Cake\ORM\EagerLoadable $meta */ foreach ($external as $meta) { $instance = $meta->instance(); if (!$instance->requiresKeys($meta->getConfig())) { continue; ...
php
protected function _collectKeys($external, $query, $statement) { $collectKeys = []; /* @var \Cake\ORM\EagerLoadable $meta */ foreach ($external as $meta) { $instance = $meta->instance(); if (!$instance->requiresKeys($meta->getConfig())) { continue; ...
[ "protected", "function", "_collectKeys", "(", "$", "external", ",", "$", "query", ",", "$", "statement", ")", "{", "$", "collectKeys", "=", "[", "]", ";", "/* @var \\Cake\\ORM\\EagerLoadable $meta */", "foreach", "(", "$", "external", "as", "$", "meta", ")", ...
Helper function used to return the keys from the query records that will be used to eagerly load associations. @param array $external the list of external associations to be loaded @param \Cake\ORM\Query $query The query from which the results where generated @param \Cake\Database\Statement\BufferedStatement $statemen...
[ "Helper", "function", "used", "to", "return", "the", "keys", "from", "the", "query", "records", "that", "will", "be", "used", "to", "eagerly", "load", "associations", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/EagerLoader.php#L819-L851
210,761
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.repository
public function repository(RepositoryInterface $table = null) { if ($table === null) { deprecationWarning( 'Using Query::repository() as getter is deprecated. ' . 'Use getRepository() instead.' ); return $this->getRepository(); } ...
php
public function repository(RepositoryInterface $table = null) { if ($table === null) { deprecationWarning( 'Using Query::repository() as getter is deprecated. ' . 'Use getRepository() instead.' ); return $this->getRepository(); } ...
[ "public", "function", "repository", "(", "RepositoryInterface", "$", "table", "=", "null", ")", "{", "if", "(", "$", "table", "===", "null", ")", "{", "deprecationWarning", "(", "'Using Query::repository() as getter is deprecated. '", ".", "'Use getRepository() instead....
Returns the default table object that will be used by this query, that is, the table that will appear in the from clause. When called with a Table argument, the default table object will be set and this query object will be returned for chaining. @param \Cake\Datasource\RepositoryInterface|null $table The default tab...
[ "Returns", "the", "default", "table", "object", "that", "will", "be", "used", "by", "this", "query", "that", "is", "the", "table", "that", "will", "appear", "in", "the", "from", "clause", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L93-L107
210,762
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.cache
public function cache($key, $config = 'default') { if ($key === false) { $this->_cache = null; return $this; } $this->_cache = new QueryCacher($key, $config); return $this; }
php
public function cache($key, $config = 'default') { if ($key === false) { $this->_cache = null; return $this; } $this->_cache = new QueryCacher($key, $config); return $this; }
[ "public", "function", "cache", "(", "$", "key", ",", "$", "config", "=", "'default'", ")", "{", "if", "(", "$", "key", "===", "false", ")", "{", "$", "this", "->", "_cache", "=", "null", ";", "return", "$", "this", ";", "}", "$", "this", "->", ...
Enable result caching for this query. If a query has caching enabled, it will do the following when executed: - Check the cache for $key. If there are results no SQL will be executed. Instead the cached results will be returned. - When the cached data is stale/missing the result set will be cached as the query is exe...
[ "Enable", "result", "caching", "for", "this", "query", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L188-L198
210,763
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.eagerLoaded
public function eagerLoaded($value = null) { if ($value === null) { deprecationWarning( 'Using ' . get_called_class() . '::eagerLoaded() as a getter is deprecated. ' . 'Use isEagerLoaded() instead.' ); return $this->_eagerLoaded; }...
php
public function eagerLoaded($value = null) { if ($value === null) { deprecationWarning( 'Using ' . get_called_class() . '::eagerLoaded() as a getter is deprecated. ' . 'Use isEagerLoaded() instead.' ); return $this->_eagerLoaded; }...
[ "public", "function", "eagerLoaded", "(", "$", "value", "=", "null", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "deprecationWarning", "(", "'Using '", ".", "get_called_class", "(", ")", ".", "'::eagerLoaded() as a getter is deprecated. '", ".", ...
Sets the query instance to be an eager loaded query. If no argument is passed, the current configured query `_eagerLoaded` value is returned. @deprecated 3.5.0 Use isEagerLoaded() for the getter part instead. @param bool|null $value Whether or not to eager load. @return $this|bool
[ "Sets", "the", "query", "instance", "to", "be", "an", "eager", "loaded", "query", ".", "If", "no", "argument", "is", "passed", "the", "current", "configured", "query", "_eagerLoaded", "value", "is", "returned", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L218-L231
210,764
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.all
public function all() { if ($this->_results !== null) { return $this->_results; } if ($this->_cache) { $results = $this->_cache->fetch($this); } if (!isset($results)) { $results = $this->_decorateResults($this->_execute()); if ...
php
public function all() { if ($this->_results !== null) { return $this->_results; } if ($this->_cache) { $results = $this->_cache->fetch($this); } if (!isset($results)) { $results = $this->_decorateResults($this->_execute()); if ...
[ "public", "function", "all", "(", ")", "{", "if", "(", "$", "this", "->", "_results", "!==", "null", ")", "{", "return", "$", "this", "->", "_results", ";", "}", "if", "(", "$", "this", "->", "_cache", ")", "{", "$", "results", "=", "$", "this", ...
Fetch the results for this query. Will return either the results set through setResult(), or execute this query and return the ResultSetDecorator object ready for streaming of results. ResultSetDecorator is a traversable object that implements the methods found on Cake\Collection\Collection. @return \Cake\Datasource...
[ "Fetch", "the", "results", "for", "this", "query", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L299-L317
210,765
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.mapReduce
public function mapReduce(callable $mapper = null, callable $reducer = null, $overwrite = false) { if ($overwrite) { $this->_mapReduce = []; } if ($mapper === null) { if (!$overwrite) { deprecationWarning( 'Using QueryTrait::mapRedu...
php
public function mapReduce(callable $mapper = null, callable $reducer = null, $overwrite = false) { if ($overwrite) { $this->_mapReduce = []; } if ($mapper === null) { if (!$overwrite) { deprecationWarning( 'Using QueryTrait::mapRedu...
[ "public", "function", "mapReduce", "(", "callable", "$", "mapper", "=", "null", ",", "callable", "$", "reducer", "=", "null", ",", "$", "overwrite", "=", "false", ")", "{", "if", "(", "$", "overwrite", ")", "{", "$", "this", "->", "_mapReduce", "=", ...
Register a new MapReduce routine to be executed on top of the database results Both the mapper and caller callable should be invokable objects. The MapReduce routing will only be run when the query is executed and the first result is attempted to be fetched. If the first argument is set to null, it will return the li...
[ "Register", "a", "new", "MapReduce", "routine", "to", "be", "executed", "on", "top", "of", "the", "database", "results", "Both", "the", "mapper", "and", "caller", "callable", "should", "be", "invokable", "objects", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L348-L366
210,766
cakephp/cakephp
src/Datasource/QueryTrait.php
QueryTrait.formatResults
public function formatResults(callable $formatter = null, $mode = 0) { if ($mode === self::OVERWRITE) { $this->_formatters = []; } if ($formatter === null) { if ($mode !== self::OVERWRITE) { deprecationWarning( 'Using QueryTrait::fo...
php
public function formatResults(callable $formatter = null, $mode = 0) { if ($mode === self::OVERWRITE) { $this->_formatters = []; } if ($formatter === null) { if ($mode !== self::OVERWRITE) { deprecationWarning( 'Using QueryTrait::fo...
[ "public", "function", "formatResults", "(", "callable", "$", "formatter", "=", "null", ",", "$", "mode", "=", "0", ")", "{", "if", "(", "$", "mode", "===", "self", "::", "OVERWRITE", ")", "{", "$", "this", "->", "_formatters", "=", "[", "]", ";", "...
Registers a new formatter callback function that is to be executed when trying to fetch the results from the database. Formatting callbacks will get a first parameter, an object implementing `\Cake\Collection\CollectionInterface`, that can be traversed and modified at will. Callbacks are required to return an iterato...
[ "Registers", "a", "new", "formatter", "callback", "function", "that", "is", "to", "be", "executed", "when", "trying", "to", "fetch", "the", "results", "from", "the", "database", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Datasource/QueryTrait.php#L416-L441
210,767
cakephp/cakephp
src/I18n/Time.php
Time.nice
public function nice($timezone = null, $locale = null) { return $this->i18nFormat(static::$niceFormat, $timezone, $locale); }
php
public function nice($timezone = null, $locale = null) { return $this->i18nFormat(static::$niceFormat, $timezone, $locale); }
[ "public", "function", "nice", "(", "$", "timezone", "=", "null", ",", "$", "locale", "=", "null", ")", "{", "return", "$", "this", "->", "i18nFormat", "(", "static", "::", "$", "niceFormat", ",", "$", "timezone", ",", "$", "locale", ")", ";", "}" ]
Returns a nicely formatted date string for this object. The format to be used is stored in the static property `Time::niceFormat`. @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object in which the date will be displayed. The timezone stored for this object will not be changed. @param stri...
[ "Returns", "a", "nicely", "formatted", "date", "string", "for", "this", "object", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/Time.php#L132-L135
210,768
cakephp/cakephp
src/I18n/Time.php
Time.listTimezones
public static function listTimezones($filter = null, $country = null, $options = []) { if (is_bool($options)) { $options = [ 'group' => $options, ]; } $defaults = [ 'group' => true, 'abbr' => false, 'before' => ' - '...
php
public static function listTimezones($filter = null, $country = null, $options = []) { if (is_bool($options)) { $options = [ 'group' => $options, ]; } $defaults = [ 'group' => true, 'abbr' => false, 'before' => ' - '...
[ "public", "static", "function", "listTimezones", "(", "$", "filter", "=", "null", ",", "$", "country", "=", "null", ",", "$", "options", "=", "[", "]", ")", "{", "if", "(", "is_bool", "(", "$", "options", ")", ")", "{", "$", "options", "=", "[", ...
Get list of timezone identifiers @param int|string|null $filter A regex to filter identifier Or one of DateTimeZone class constants @param string|null $country A two-letter ISO 3166-1 compatible country code. This option is only used when $filter is set to DateTimeZone::PER_COUNTRY @param bool|array $options If true (...
[ "Get", "list", "of", "timezone", "identifiers" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/Time.php#L260-L320
210,769
cakephp/cakephp
src/I18n/Time.php
Time.wasWithinLast
public function wasWithinLast($timeInterval) { $tmp = trim($timeInterval); if (is_numeric($tmp)) { deprecationWarning( 'Passing int/numeric string into Time::wasWithinLast() is deprecated. ' . 'Pass strings including interval eg. "6 days"' ); ...
php
public function wasWithinLast($timeInterval) { $tmp = trim($timeInterval); if (is_numeric($tmp)) { deprecationWarning( 'Passing int/numeric string into Time::wasWithinLast() is deprecated. ' . 'Pass strings including interval eg. "6 days"' ); ...
[ "public", "function", "wasWithinLast", "(", "$", "timeInterval", ")", "{", "$", "tmp", "=", "trim", "(", "$", "timeInterval", ")", ";", "if", "(", "is_numeric", "(", "$", "tmp", ")", ")", "{", "deprecationWarning", "(", "'Passing int/numeric string into Time::...
Returns true this instance will happen within the specified interval This overridden method provides backwards compatible behavior for integers, or strings with trailing spaces. This behavior is *deprecated* and will be removed in future versions of CakePHP. @param string|int $timeInterval the numeric value with spac...
[ "Returns", "true", "this", "instance", "will", "happen", "within", "the", "specified", "interval" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/I18n/Time.php#L333-L345
210,770
cakephp/cakephp
src/ORM/Behavior/TranslateBehavior.php
TranslateBehavior.locale
public function locale($locale = null) { deprecationWarning( get_called_class() . '::locale() is deprecated. ' . 'Use setLocale()/getLocale() instead.' ); if ($locale !== null) { $this->setLocale($locale); } return $this->getLocale(); ...
php
public function locale($locale = null) { deprecationWarning( get_called_class() . '::locale() is deprecated. ' . 'Use setLocale()/getLocale() instead.' ); if ($locale !== null) { $this->setLocale($locale); } return $this->getLocale(); ...
[ "public", "function", "locale", "(", "$", "locale", "=", "null", ")", "{", "deprecationWarning", "(", "get_called_class", "(", ")", ".", "'::locale() is deprecated. '", ".", "'Use setLocale()/getLocale() instead.'", ")", ";", "if", "(", "$", "locale", "!==", "null...
Sets all future finds for the bound table to also fetch translated fields for the passed locale. If no value is passed, it returns the currently configured locale @deprecated 3.6.0 Use setLocale()/getLocale() instead. @param string|null $locale The locale to use for fetching translated records @return string
[ "Sets", "all", "future", "finds", "for", "the", "bound", "table", "to", "also", "fetch", "translated", "fields", "for", "the", "passed", "locale", ".", "If", "no", "value", "is", "passed", "it", "returns", "the", "currently", "configured", "locale" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TranslateBehavior.php#L469-L481
210,771
cakephp/cakephp
src/ORM/Behavior/TranslateBehavior.php
TranslateBehavior.findTranslations
public function findTranslations(Query $query, array $options) { $locales = isset($options['locales']) ? $options['locales'] : []; $targetAlias = $this->_translationTable->getAlias(); return $query ->contain([$targetAlias => function ($query) use ($locales, $targetAlias) { ...
php
public function findTranslations(Query $query, array $options) { $locales = isset($options['locales']) ? $options['locales'] : []; $targetAlias = $this->_translationTable->getAlias(); return $query ->contain([$targetAlias => function ($query) use ($locales, $targetAlias) { ...
[ "public", "function", "findTranslations", "(", "Query", "$", "query", ",", "array", "$", "options", ")", "{", "$", "locales", "=", "isset", "(", "$", "options", "[", "'locales'", "]", ")", "?", "$", "options", "[", "'locales'", "]", ":", "[", "]", ";...
Custom finder method used to retrieve all translations for the found records. Fetched translations can be filtered by locale by passing the `locales` key in the options array. Translated values will be found for each entity under the property `_translations`, containing an array indexed by locale name. ### Example: ...
[ "Custom", "finder", "method", "used", "to", "retrieve", "all", "translations", "for", "the", "found", "records", ".", "Fetched", "translations", "can", "be", "filtered", "by", "locale", "by", "passing", "the", "locales", "key", "in", "the", "options", "array",...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TranslateBehavior.php#L530-L545
210,772
cakephp/cakephp
src/ORM/Behavior/TranslateBehavior.php
TranslateBehavior._unsetEmptyFields
protected function _unsetEmptyFields(EntityInterface $entity) { $translations = (array)$entity->get('_translations'); foreach ($translations as $locale => $translation) { $fields = $translation->extract($this->_config['fields'], false); foreach ($fields as $field => $value) {...
php
protected function _unsetEmptyFields(EntityInterface $entity) { $translations = (array)$entity->get('_translations'); foreach ($translations as $locale => $translation) { $fields = $translation->extract($this->_config['fields'], false); foreach ($fields as $field => $value) {...
[ "protected", "function", "_unsetEmptyFields", "(", "EntityInterface", "$", "entity", ")", "{", "$", "translations", "=", "(", "array", ")", "$", "entity", "->", "get", "(", "'_translations'", ")", ";", "foreach", "(", "$", "translations", "as", "$", "locale"...
Unset empty translations to avoid persistence. Should only be called if $this->_config['allowEmptyTranslations'] is false. @param \Cake\Datasource\EntityInterface $entity The entity to check for empty translations fields inside. @return void
[ "Unset", "empty", "translations", "to", "avoid", "persistence", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TranslateBehavior.php#L714-L739
210,773
cakephp/cakephp
src/ORM/Behavior/TranslateBehavior.php
TranslateBehavior._findExistingTranslations
protected function _findExistingTranslations($ruleSet) { $association = $this->_table->getAssociation($this->_translationTable->getAlias()); $query = $association->find() ->select(['id', 'num' => 0]) ->where(current($ruleSet)) ->disableHydration() ->d...
php
protected function _findExistingTranslations($ruleSet) { $association = $this->_table->getAssociation($this->_translationTable->getAlias()); $query = $association->find() ->select(['id', 'num' => 0]) ->where(current($ruleSet)) ->disableHydration() ->d...
[ "protected", "function", "_findExistingTranslations", "(", "$", "ruleSet", ")", "{", "$", "association", "=", "$", "this", "->", "_table", "->", "getAssociation", "(", "$", "this", "->", "_translationTable", "->", "getAlias", "(", ")", ")", ";", "$", "query"...
Returns the ids found for each of the condition arrays passed for the translations table. Each records is indexed by the corresponding position to the conditions array @param array $ruleSet an array of arary of conditions to be used for finding each @return array
[ "Returns", "the", "ids", "found", "for", "each", "of", "the", "condition", "arrays", "passed", "for", "the", "translations", "table", ".", "Each", "records", "is", "indexed", "by", "the", "corresponding", "position", "to", "the", "conditions", "array" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/TranslateBehavior.php#L748-L767
210,774
cakephp/cakephp
src/Cache/SimpleCacheEngine.php
SimpleCacheEngine.ensureValidKeys
protected function ensureValidKeys($keys) { if (!is_array($keys) && !($keys instanceof \Traversable)) { throw new InvalidArgumentException('A cache key set must be either an array or a Traversable.'); } foreach ($keys as $key) { $this->ensureValidKey($key); }...
php
protected function ensureValidKeys($keys) { if (!is_array($keys) && !($keys instanceof \Traversable)) { throw new InvalidArgumentException('A cache key set must be either an array or a Traversable.'); } foreach ($keys as $key) { $this->ensureValidKey($key); }...
[ "protected", "function", "ensureValidKeys", "(", "$", "keys", ")", "{", "if", "(", "!", "is_array", "(", "$", "keys", ")", "&&", "!", "(", "$", "keys", "instanceof", "\\", "Traversable", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'A...
Ensure the validity of the given cache keys. @param mixed $keys The keys to check. @return void @throws \Cake\Cache\InvalidArgumentException When the keys are not valid.
[ "Ensure", "the", "validity", "of", "the", "given", "cache", "keys", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/SimpleCacheEngine.php#L68-L77
210,775
cakephp/cakephp
src/Cache/SimpleCacheEngine.php
SimpleCacheEngine.get
public function get($key, $default = null) { $this->ensureValidKey($key); $result = $this->innerEngine->read($key); if ($result === false) { return $default; } return $result; }
php
public function get($key, $default = null) { $this->ensureValidKey($key); $result = $this->innerEngine->read($key); if ($result === false) { return $default; } return $result; }
[ "public", "function", "get", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "this", "->", "ensureValidKey", "(", "$", "key", ")", ";", "$", "result", "=", "$", "this", "->", "innerEngine", "->", "read", "(", "$", "key", ")", ";...
Fetches the value for a given key from the cache. @param string $key The unique key of this item in the cache. @param mixed $default Default value to return if the key does not exist. @return mixed The value of the item from the cache, or $default in case of cache miss. @throws \Cake\Cache\InvalidArgumentException If ...
[ "Fetches", "the", "value", "for", "a", "given", "key", "from", "the", "cache", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/SimpleCacheEngine.php#L87-L96
210,776
cakephp/cakephp
src/Cache/SimpleCacheEngine.php
SimpleCacheEngine.set
public function set($key, $value, $ttl = null) { $this->ensureValidKey($key); if ($ttl !== null) { $restore = $this->innerEngine->getConfig('duration'); $this->innerEngine->setConfig('duration', $ttl); } try { $result = $this->innerEngine->write($k...
php
public function set($key, $value, $ttl = null) { $this->ensureValidKey($key); if ($ttl !== null) { $restore = $this->innerEngine->getConfig('duration'); $this->innerEngine->setConfig('duration', $ttl); } try { $result = $this->innerEngine->write($k...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ",", "$", "ttl", "=", "null", ")", "{", "$", "this", "->", "ensureValidKey", "(", "$", "key", ")", ";", "if", "(", "$", "ttl", "!==", "null", ")", "{", "$", "restore", "=", "$", ...
Persists data in the cache, uniquely referenced by the given key with an optional expiration TTL time. @param string $key The key of the item to store. @param mixed $value The value of the item to store, must be serializable. @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent ...
[ "Persists", "data", "in", "the", "cache", "uniquely", "referenced", "by", "the", "given", "key", "with", "an", "optional", "expiration", "TTL", "time", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Cache/SimpleCacheEngine.php#L110-L126
210,777
cakephp/cakephp
src/Filesystem/File.php
File.create
public function create() { $dir = $this->Folder->pwd(); if (is_dir($dir) && is_writable($dir) && !$this->exists() && touch($this->path)) { return true; } return false; }
php
public function create() { $dir = $this->Folder->pwd(); if (is_dir($dir) && is_writable($dir) && !$this->exists() && touch($this->path)) { return true; } return false; }
[ "public", "function", "create", "(", ")", "{", "$", "dir", "=", "$", "this", "->", "Folder", "->", "pwd", "(", ")", ";", "if", "(", "is_dir", "(", "$", "dir", ")", "&&", "is_writable", "(", "$", "dir", ")", "&&", "!", "$", "this", "->", "exists...
Creates the file. @return bool Success
[ "Creates", "the", "file", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L108-L117
210,778
cakephp/cakephp
src/Filesystem/File.php
File.read
public function read($bytes = false, $mode = 'rb', $force = false) { if ($bytes === false && $this->lock === null) { return file_get_contents($this->path); } if ($this->open($mode, $force) === false) { return false; } if ($this->lock !== null && flock(...
php
public function read($bytes = false, $mode = 'rb', $force = false) { if ($bytes === false && $this->lock === null) { return file_get_contents($this->path); } if ($this->open($mode, $force) === false) { return false; } if ($this->lock !== null && flock(...
[ "public", "function", "read", "(", "$", "bytes", "=", "false", ",", "$", "mode", "=", "'rb'", ",", "$", "force", "=", "false", ")", "{", "if", "(", "$", "bytes", "===", "false", "&&", "$", "this", "->", "lock", "===", "null", ")", "{", "return", ...
Return the contents of this file as a string. @param string|bool $bytes where to start @param string $mode A `fread` compatible mode. @param bool $force If true then the file will be re-opened even if its already opened, otherwise it won't @return string|false string on success, false on failure
[ "Return", "the", "contents", "of", "this", "file", "as", "a", "string", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L148-L176
210,779
cakephp/cakephp
src/Filesystem/File.php
File.offset
public function offset($offset = false, $seek = SEEK_SET) { if ($offset === false) { if (is_resource($this->handle)) { return ftell($this->handle); } } elseif ($this->open() === true) { return fseek($this->handle, $offset, $seek) === 0; } ...
php
public function offset($offset = false, $seek = SEEK_SET) { if ($offset === false) { if (is_resource($this->handle)) { return ftell($this->handle); } } elseif ($this->open() === true) { return fseek($this->handle, $offset, $seek) === 0; } ...
[ "public", "function", "offset", "(", "$", "offset", "=", "false", ",", "$", "seek", "=", "SEEK_SET", ")", "{", "if", "(", "$", "offset", "===", "false", ")", "{", "if", "(", "is_resource", "(", "$", "this", "->", "handle", ")", ")", "{", "return", ...
Sets or gets the offset for the currently opened file. @param int|bool $offset The $offset in bytes to seek. If set to false then the current offset is returned. @param int $seek PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to @return int|bool True on success, false on failure (...
[ "Sets", "or", "gets", "the", "offset", "for", "the", "currently", "opened", "file", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L185-L196
210,780
cakephp/cakephp
src/Filesystem/File.php
File.prepare
public static function prepare($data, $forceWindows = false) { $lineBreak = "\n"; if (DIRECTORY_SEPARATOR === '\\' || $forceWindows === true) { $lineBreak = "\r\n"; } return strtr($data, ["\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak]); }
php
public static function prepare($data, $forceWindows = false) { $lineBreak = "\n"; if (DIRECTORY_SEPARATOR === '\\' || $forceWindows === true) { $lineBreak = "\r\n"; } return strtr($data, ["\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak]); }
[ "public", "static", "function", "prepare", "(", "$", "data", ",", "$", "forceWindows", "=", "false", ")", "{", "$", "lineBreak", "=", "\"\\n\"", ";", "if", "(", "DIRECTORY_SEPARATOR", "===", "'\\\\'", "||", "$", "forceWindows", "===", "true", ")", "{", "...
Prepares an ASCII string for writing. Converts line endings to the correct terminator for the current platform. If Windows, "\r\n" will be used, all other platforms will use "\n" @param string $data Data to prepare for writing. @param bool $forceWindows If true forces Windows new line string. @return string The with c...
[ "Prepares", "an", "ASCII", "string", "for", "writing", ".", "Converts", "line", "endings", "to", "the", "correct", "terminator", "for", "the", "current", "platform", ".", "If", "Windows", "\\", "r", "\\", "n", "will", "be", "used", "all", "other", "platfor...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L207-L215
210,781
cakephp/cakephp
src/Filesystem/File.php
File.write
public function write($data, $mode = 'w', $force = false) { $success = false; if ($this->open($mode, $force) === true) { if ($this->lock !== null && flock($this->handle, LOCK_EX) === false) { return false; } if (fwrite($this->handle, $data) !== fa...
php
public function write($data, $mode = 'w', $force = false) { $success = false; if ($this->open($mode, $force) === true) { if ($this->lock !== null && flock($this->handle, LOCK_EX) === false) { return false; } if (fwrite($this->handle, $data) !== fa...
[ "public", "function", "write", "(", "$", "data", ",", "$", "mode", "=", "'w'", ",", "$", "force", "=", "false", ")", "{", "$", "success", "=", "false", ";", "if", "(", "$", "this", "->", "open", "(", "$", "mode", ",", "$", "force", ")", "===", ...
Write given data to this file. @param string $data Data to write to this File. @param string $mode Mode of writing. {@link https://secure.php.net/fwrite See fwrite()}. @param bool $force Force the file to open @return bool Success
[ "Write", "given", "data", "to", "this", "file", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L225-L242
210,782
cakephp/cakephp
src/Filesystem/File.php
File.md5
public function md5($maxsize = 5) { if ($maxsize === true) { return md5_file($this->path); } $size = $this->size(); if ($size && $size < ($maxsize * 1024) * 1024) { return md5_file($this->path); } return false; }
php
public function md5($maxsize = 5) { if ($maxsize === true) { return md5_file($this->path); } $size = $this->size(); if ($size && $size < ($maxsize * 1024) * 1024) { return md5_file($this->path); } return false; }
[ "public", "function", "md5", "(", "$", "maxsize", "=", "5", ")", "{", "if", "(", "$", "maxsize", "===", "true", ")", "{", "return", "md5_file", "(", "$", "this", "->", "path", ")", ";", "}", "$", "size", "=", "$", "this", "->", "size", "(", ")"...
Get md5 Checksum of file with previous check of Filesize @param int|bool $maxsize in MB or true to force @return string|false md5 Checksum {@link https://secure.php.net/md5_file See md5_file()}, or false in case of an error
[ "Get", "md5", "Checksum", "of", "file", "with", "previous", "check", "of", "Filesize" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L407-L419
210,783
cakephp/cakephp
src/Filesystem/File.php
File.replaceText
public function replaceText($search, $replace) { if (!$this->open('r+')) { return false; } if ($this->lock !== null && flock($this->handle, LOCK_EX) === false) { return false; } $replaced = $this->write(str_replace($search, $replace, $this->read()), ...
php
public function replaceText($search, $replace) { if (!$this->open('r+')) { return false; } if ($this->lock !== null && flock($this->handle, LOCK_EX) === false) { return false; } $replaced = $this->write(str_replace($search, $replace, $this->read()), ...
[ "public", "function", "replaceText", "(", "$", "search", ",", "$", "replace", ")", "{", "if", "(", "!", "$", "this", "->", "open", "(", "'r+'", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$", "this", "->", "lock", "!==", "null", "&&",...
Searches for a given text and replaces the text if found. @param string|array $search Text(s) to search for. @param string|array $replace Text(s) to replace with. @return bool Success
[ "Searches", "for", "a", "given", "text", "and", "replaces", "the", "text", "if", "found", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/Filesystem/File.php#L641-L659
210,784
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior.beforeSave
public function beforeSave(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } foreach ($this->_config as $assoc => $settings) { $assoc = $this->_table->getAssociation($a...
php
public function beforeSave(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } foreach ($this->_config as $assoc => $settings) { $assoc = $this->_table->getAssociation($a...
[ "public", "function", "beforeSave", "(", "Event", "$", "event", ",", "EntityInterface", "$", "entity", ",", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'ignoreCounterCache'", "]", ")", "&&", "$", "options", "[", "'ignoreCounter...
beforeSave callback. Check if a field, which should be ignored, is dirty @param \Cake\Event\Event $event The beforeSave event that was fired @param \Cake\Datasource\EntityInterface $entity The entity that is going to be saved @param \ArrayObject $options The options for the query @return void
[ "beforeSave", "callback", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L121-L146
210,785
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior.afterSave
public function afterSave(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } $this->_processAssociations($event, $entity); $this->_ignoreDirty = []; }
php
public function afterSave(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } $this->_processAssociations($event, $entity); $this->_ignoreDirty = []; }
[ "public", "function", "afterSave", "(", "Event", "$", "event", ",", "EntityInterface", "$", "entity", ",", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'ignoreCounterCache'", "]", ")", "&&", "$", "options", "[", "'ignoreCounterC...
afterSave callback. Makes sure to update counter cache when a new record is created or updated. @param \Cake\Event\Event $event The afterSave event that was fired. @param \Cake\Datasource\EntityInterface $entity The entity that was saved. @param \ArrayObject $options The options for the query @return void
[ "afterSave", "callback", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L158-L166
210,786
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior.afterDelete
public function afterDelete(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } $this->_processAssociations($event, $entity); }
php
public function afterDelete(Event $event, EntityInterface $entity, $options) { if (isset($options['ignoreCounterCache']) && $options['ignoreCounterCache'] === true) { return; } $this->_processAssociations($event, $entity); }
[ "public", "function", "afterDelete", "(", "Event", "$", "event", ",", "EntityInterface", "$", "entity", ",", "$", "options", ")", "{", "if", "(", "isset", "(", "$", "options", "[", "'ignoreCounterCache'", "]", ")", "&&", "$", "options", "[", "'ignoreCounte...
afterDelete callback. Makes sure to update counter cache when a record is deleted. @param \Cake\Event\Event $event The afterDelete event that was fired. @param \Cake\Datasource\EntityInterface $entity The entity that was deleted. @param \ArrayObject $options The options for the query @return void
[ "afterDelete", "callback", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L178-L185
210,787
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior._processAssociations
protected function _processAssociations(Event $event, EntityInterface $entity) { foreach ($this->_config as $assoc => $settings) { $assoc = $this->_table->getAssociation($assoc); $this->_processAssociation($event, $entity, $assoc, $settings); } }
php
protected function _processAssociations(Event $event, EntityInterface $entity) { foreach ($this->_config as $assoc => $settings) { $assoc = $this->_table->getAssociation($assoc); $this->_processAssociation($event, $entity, $assoc, $settings); } }
[ "protected", "function", "_processAssociations", "(", "Event", "$", "event", ",", "EntityInterface", "$", "entity", ")", "{", "foreach", "(", "$", "this", "->", "_config", "as", "$", "assoc", "=>", "$", "settings", ")", "{", "$", "assoc", "=", "$", "this...
Iterate all associations and update counter caches. @param \Cake\Event\Event $event Event instance. @param \Cake\Datasource\EntityInterface $entity Entity. @return void
[ "Iterate", "all", "associations", "and", "update", "counter", "caches", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L194-L200
210,788
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior._processAssociation
protected function _processAssociation(Event $event, EntityInterface $entity, Association $assoc, array $settings) { $foreignKeys = (array)$assoc->getForeignKey(); $primaryKeys = (array)$assoc->getBindingKey(); $countConditions = $entity->extract($foreignKeys); $updateConditions = ar...
php
protected function _processAssociation(Event $event, EntityInterface $entity, Association $assoc, array $settings) { $foreignKeys = (array)$assoc->getForeignKey(); $primaryKeys = (array)$assoc->getBindingKey(); $countConditions = $entity->extract($foreignKeys); $updateConditions = ar...
[ "protected", "function", "_processAssociation", "(", "Event", "$", "event", ",", "EntityInterface", "$", "entity", ",", "Association", "$", "assoc", ",", "array", "$", "settings", ")", "{", "$", "foreignKeys", "=", "(", "array", ")", "$", "assoc", "->", "g...
Updates counter cache for a single association @param \Cake\Event\Event $event Event instance. @param \Cake\Datasource\EntityInterface $entity Entity @param \Cake\ORM\Association $assoc The association object @param array $settings The settings for for counter cache for this association @return void @throws \RuntimeEx...
[ "Updates", "counter", "cache", "for", "a", "single", "association" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L212-L262
210,789
cakephp/cakephp
src/ORM/Behavior/CounterCacheBehavior.php
CounterCacheBehavior._getCount
protected function _getCount(array $config, array $conditions) { $finder = 'all'; if (!empty($config['finder'])) { $finder = $config['finder']; unset($config['finder']); } if (!isset($config['conditions'])) { $config['conditions'] = []; } ...
php
protected function _getCount(array $config, array $conditions) { $finder = 'all'; if (!empty($config['finder'])) { $finder = $config['finder']; unset($config['finder']); } if (!isset($config['conditions'])) { $config['conditions'] = []; } ...
[ "protected", "function", "_getCount", "(", "array", "$", "config", ",", "array", "$", "conditions", ")", "{", "$", "finder", "=", "'all'", ";", "if", "(", "!", "empty", "(", "$", "config", "[", "'finder'", "]", ")", ")", "{", "$", "finder", "=", "$...
Fetches and returns the count for a single field in an association @param array $config The counter cache configuration for a single field @param array $conditions Additional conditions given to the query @return int The number of relations matching the given config and conditions
[ "Fetches", "and", "returns", "the", "count", "for", "a", "single", "field", "in", "an", "association" ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Behavior/CounterCacheBehavior.php#L271-L286
210,790
cakephp/cakephp
src/ORM/Query.php
Query.selectAllExcept
public function selectAllExcept($table, array $excludedFields, $overwrite = false) { if ($table instanceof Association) { $table = $table->getTarget(); } if (!($table instanceof Table)) { throw new \InvalidArgumentException('You must provide either an Association or ...
php
public function selectAllExcept($table, array $excludedFields, $overwrite = false) { if ($table instanceof Association) { $table = $table->getTarget(); } if (!($table instanceof Table)) { throw new \InvalidArgumentException('You must provide either an Association or ...
[ "public", "function", "selectAllExcept", "(", "$", "table", ",", "array", "$", "excludedFields", ",", "$", "overwrite", "=", "false", ")", "{", "if", "(", "$", "table", "instanceof", "Association", ")", "{", "$", "table", "=", "$", "table", "->", "getTar...
All the fields associated with the passed table except the excluded fields will be added to the select clause of the query. Passed excluded fields should not be aliased. After the first call to this method, a second call cannot be used to remove fields that have already been added to the query by the first. If you need...
[ "All", "the", "fields", "associated", "with", "the", "passed", "table", "except", "the", "excluded", "fields", "will", "be", "added", "to", "the", "select", "clause", "of", "the", "query", ".", "Passed", "excluded", "fields", "should", "not", "be", "aliased"...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L239-L253
210,791
cakephp/cakephp
src/ORM/Query.php
Query.addDefaultTypes
public function addDefaultTypes(Table $table) { $alias = $table->getAlias(); $map = $table->getSchema()->typeMap(); $fields = []; foreach ($map as $f => $type) { $fields[$f] = $fields[$alias . '.' . $f] = $fields[$alias . '__' . $f] = $type; } $this->getTy...
php
public function addDefaultTypes(Table $table) { $alias = $table->getAlias(); $map = $table->getSchema()->typeMap(); $fields = []; foreach ($map as $f => $type) { $fields[$f] = $fields[$alias . '.' . $f] = $fields[$alias . '__' . $f] = $type; } $this->getTy...
[ "public", "function", "addDefaultTypes", "(", "Table", "$", "table", ")", "{", "$", "alias", "=", "$", "table", "->", "getAlias", "(", ")", ";", "$", "map", "=", "$", "table", "->", "getSchema", "(", ")", "->", "typeMap", "(", ")", ";", "$", "field...
Hints this object to associate the correct types when casting conditions for the database. This is done by extracting the field types from the schema associated to the passed table object. This prevents the user from repeating themselves when specifying conditions. This method returns the same query object for chainin...
[ "Hints", "this", "object", "to", "associate", "the", "correct", "types", "when", "casting", "conditions", "for", "the", "database", ".", "This", "is", "done", "by", "extracting", "the", "field", "types", "from", "the", "schema", "associated", "to", "the", "p...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L266-L277
210,792
cakephp/cakephp
src/ORM/Query.php
Query.eagerLoader
public function eagerLoader(EagerLoader $instance = null) { deprecationWarning( 'Query::eagerLoader() is deprecated. ' . 'Use setEagerLoader()/getEagerLoader() instead.' ); if ($instance !== null) { return $this->setEagerLoader($instance); } ...
php
public function eagerLoader(EagerLoader $instance = null) { deprecationWarning( 'Query::eagerLoader() is deprecated. ' . 'Use setEagerLoader()/getEagerLoader() instead.' ); if ($instance !== null) { return $this->setEagerLoader($instance); } ...
[ "public", "function", "eagerLoader", "(", "EagerLoader", "$", "instance", "=", "null", ")", "{", "deprecationWarning", "(", "'Query::eagerLoader() is deprecated. '", ".", "'Use setEagerLoader()/getEagerLoader() instead.'", ")", ";", "if", "(", "$", "instance", "!==", "n...
Sets the instance of the eager loader class to use for loading associations and storing containments. If called with no arguments, it will return the currently configured instance. @deprecated 3.4.0 Use setEagerLoader()/getEagerLoader() instead. @param \Cake\ORM\EagerLoader|null $instance The eager loader to use. Pass...
[ "Sets", "the", "instance", "of", "the", "eager", "loader", "class", "to", "use", "for", "loading", "associations", "and", "storing", "containments", ".", "If", "called", "with", "no", "arguments", "it", "will", "return", "the", "currently", "configured", "inst...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L317-L328
210,793
cakephp/cakephp
src/ORM/Query.php
Query.contain
public function contain($associations = null, $override = false) { $loader = $this->getEagerLoader(); if ($override === true) { $this->clearContain(); } if ($associations === null) { deprecationWarning( 'Using Query::contain() as getter is dep...
php
public function contain($associations = null, $override = false) { $loader = $this->getEagerLoader(); if ($override === true) { $this->clearContain(); } if ($associations === null) { deprecationWarning( 'Using Query::contain() as getter is dep...
[ "public", "function", "contain", "(", "$", "associations", "=", "null", ",", "$", "override", "=", "false", ")", "{", "$", "loader", "=", "$", "this", "->", "getEagerLoader", "(", ")", ";", "if", "(", "$", "override", "===", "true", ")", "{", "$", ...
Sets the list of associations that should be eagerly loaded along with this query. The list of associated tables passed must have been previously set as associations using the Table API. ### Example: ``` // Bring articles' author information $query->contain('Author'); // Also bring the category and tags associated t...
[ "Sets", "the", "list", "of", "associations", "that", "should", "be", "eagerly", "loaded", "along", "with", "this", "query", ".", "The", "list", "of", "associated", "tables", "passed", "must", "have", "been", "previously", "set", "as", "associations", "using", ...
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L450-L481
210,794
cakephp/cakephp
src/ORM/Query.php
Query._addAssociationsToTypeMap
protected function _addAssociationsToTypeMap($table, $typeMap, $associations) { foreach ($associations as $name => $nested) { if (!$table->hasAssociation($name)) { continue; } $association = $table->getAssociation($name); $target = $association...
php
protected function _addAssociationsToTypeMap($table, $typeMap, $associations) { foreach ($associations as $name => $nested) { if (!$table->hasAssociation($name)) { continue; } $association = $table->getAssociation($name); $target = $association...
[ "protected", "function", "_addAssociationsToTypeMap", "(", "$", "table", ",", "$", "typeMap", ",", "$", "associations", ")", "{", "foreach", "(", "$", "associations", "as", "$", "name", "=>", "$", "nested", ")", "{", "if", "(", "!", "$", "table", "->", ...
Used to recursively add contained association column types to the query. @param \Cake\ORM\Table $table The table instance to pluck associations from. @param \Cake\Database\TypeMap $typeMap The typemap to check for columns in. This typemap is indirectly mutated via Cake\ORM\Query::addDefaultTypes() @param array $associ...
[ "Used", "to", "recursively", "add", "contained", "association", "column", "types", "to", "the", "query", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L514-L530
210,795
cakephp/cakephp
src/ORM/Query.php
Query.matching
public function matching($assoc, callable $builder = null) { $result = $this->getEagerLoader()->setMatching($assoc, $builder)->getMatching(); $this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result); $this->_dirty(); return $this; }
php
public function matching($assoc, callable $builder = null) { $result = $this->getEagerLoader()->setMatching($assoc, $builder)->getMatching(); $this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result); $this->_dirty(); return $this; }
[ "public", "function", "matching", "(", "$", "assoc", ",", "callable", "$", "builder", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "getEagerLoader", "(", ")", "->", "setMatching", "(", "$", "assoc", ",", "$", "builder", ")", "->", "g...
Adds filtering conditions to this query to only bring rows that have a relation to another from an associated table, based on conditions in the associated table. This function will add entries in the `contain` graph. ### Example: ``` // Bring only articles that were tagged with 'cake' $query->matching('Tags', functi...
[ "Adds", "filtering", "conditions", "to", "this", "query", "to", "only", "bring", "rows", "that", "have", "a", "relation", "to", "another", "from", "an", "associated", "table", "based", "on", "conditions", "in", "the", "associated", "table", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L582-L589
210,796
cakephp/cakephp
src/ORM/Query.php
Query.leftJoinWith
public function leftJoinWith($assoc, callable $builder = null) { $result = $this->getEagerLoader() ->setMatching($assoc, $builder, [ 'joinType' => QueryInterface::JOIN_TYPE_LEFT, 'fields' => false ]) ->getMatching(); $this->_addAsso...
php
public function leftJoinWith($assoc, callable $builder = null) { $result = $this->getEagerLoader() ->setMatching($assoc, $builder, [ 'joinType' => QueryInterface::JOIN_TYPE_LEFT, 'fields' => false ]) ->getMatching(); $this->_addAsso...
[ "public", "function", "leftJoinWith", "(", "$", "assoc", ",", "callable", "$", "builder", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "getEagerLoader", "(", ")", "->", "setMatching", "(", "$", "assoc", ",", "$", "builder", ",", "[", ...
Creates a LEFT JOIN with the passed association table while preserving the foreign key matching and the custom conditions that were originally set for it. This function will add entries in the `contain` graph. ### Example: ``` // Get the count of articles per user $usersQuery ->select(['total_articles' => $query->fu...
[ "Creates", "a", "LEFT", "JOIN", "with", "the", "passed", "association", "table", "while", "preserving", "the", "foreign", "key", "matching", "and", "the", "custom", "conditions", "that", "were", "originally", "set", "for", "it", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L654-L666
210,797
cakephp/cakephp
src/ORM/Query.php
Query.innerJoinWith
public function innerJoinWith($assoc, callable $builder = null) { $result = $this->getEagerLoader() ->setMatching($assoc, $builder, [ 'joinType' => QueryInterface::JOIN_TYPE_INNER, 'fields' => false ]) ->getMatching(); $this->_addAs...
php
public function innerJoinWith($assoc, callable $builder = null) { $result = $this->getEagerLoader() ->setMatching($assoc, $builder, [ 'joinType' => QueryInterface::JOIN_TYPE_INNER, 'fields' => false ]) ->getMatching(); $this->_addAs...
[ "public", "function", "innerJoinWith", "(", "$", "assoc", ",", "callable", "$", "builder", "=", "null", ")", "{", "$", "result", "=", "$", "this", "->", "getEagerLoader", "(", ")", "->", "setMatching", "(", "$", "assoc", ",", "$", "builder", ",", "[", ...
Creates an INNER JOIN with the passed association table while preserving the foreign key matching and the custom conditions that were originally set for it. This function will add entries in the `contain` graph. ### Example: ``` // Bring only articles that were tagged with 'cake' $query->innerJoinWith('Tags', functi...
[ "Creates", "an", "INNER", "JOIN", "with", "the", "passed", "association", "table", "while", "preserving", "the", "foreign", "key", "matching", "and", "the", "custom", "conditions", "that", "were", "originally", "set", "for", "it", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L703-L715
210,798
cakephp/cakephp
src/ORM/Query.php
Query.cleanCopy
public function cleanCopy() { $clone = clone $this; $clone->setEagerLoader(clone $this->getEagerLoader()); $clone->triggerBeforeFind(); $clone->enableAutoFields(false); $clone->limit(null); $clone->order([], true); $clone->offset(null); $clone->mapRedu...
php
public function cleanCopy() { $clone = clone $this; $clone->setEagerLoader(clone $this->getEagerLoader()); $clone->triggerBeforeFind(); $clone->enableAutoFields(false); $clone->limit(null); $clone->order([], true); $clone->offset(null); $clone->mapRedu...
[ "public", "function", "cleanCopy", "(", ")", "{", "$", "clone", "=", "clone", "$", "this", ";", "$", "clone", "->", "setEagerLoader", "(", "clone", "$", "this", "->", "getEagerLoader", "(", ")", ")", ";", "$", "clone", "->", "triggerBeforeFind", "(", "...
Creates a copy of this current query, triggers beforeFind and resets some state. The following state will be cleared: - autoFields - limit - offset - map/reduce functions - result formatters - order - containments This method creates query clones that are useful when working with subqueries. @return \Cake\ORM\Query
[ "Creates", "a", "copy", "of", "this", "current", "query", "triggers", "beforeFind", "and", "resets", "some", "state", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L864-L879
210,799
cakephp/cakephp
src/ORM/Query.php
Query._execute
protected function _execute() { $this->triggerBeforeFind(); if ($this->_results) { $decorator = $this->_decoratorClass(); return new $decorator($this->_results); } $statement = $this->getEagerLoader()->loadExternal($this, $this->execute()); return n...
php
protected function _execute() { $this->triggerBeforeFind(); if ($this->_results) { $decorator = $this->_decoratorClass(); return new $decorator($this->_results); } $statement = $this->getEagerLoader()->loadExternal($this, $this->execute()); return n...
[ "protected", "function", "_execute", "(", ")", "{", "$", "this", "->", "triggerBeforeFind", "(", ")", ";", "if", "(", "$", "this", "->", "_results", ")", "{", "$", "decorator", "=", "$", "this", "->", "_decoratorClass", "(", ")", ";", "return", "new", ...
Executes this query and returns a ResultSet object containing the results. This will also setup the correct statement class in order to eager load deep associations. @return \Cake\ORM\ResultSet
[ "Executes", "this", "query", "and", "returns", "a", "ResultSet", "object", "containing", "the", "results", ".", "This", "will", "also", "setup", "the", "correct", "statement", "class", "in", "order", "to", "eager", "load", "deep", "associations", "." ]
5f6c9d65dcbbfc093410d1dbbb207a17f4cde540
https://github.com/cakephp/cakephp/blob/5f6c9d65dcbbfc093410d1dbbb207a17f4cde540/src/ORM/Query.php#L1132-L1144