repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
php-lug/lug
src/Bundle/GridBundle/Form/Type/Filter/TextFilterType.php
TextFilterType.buildForm
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add($builder->create('type', ChoiceType::class, [ 'choices' => array_combine( array_map(function ($choice) use ($options) { return $options['label_pre...
php
public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add($builder->create('type', ChoiceType::class, [ 'choices' => array_combine( array_map(function ($choice) use ($options) { return $options['label_pre...
[ "public", "function", "buildForm", "(", "FormBuilderInterface", "$", "builder", ",", "array", "$", "options", ")", "{", "$", "builder", "->", "add", "(", "$", "builder", "->", "create", "(", "'type'", ",", "ChoiceType", "::", "class", ",", "[", "'choices'"...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/Type/Filter/TextFilterType.php#L40-L54
php-lug/lug
src/Bundle/GridBundle/Form/EventSubscriber/Batch/AbstractGridBatchSubscriber.php
AbstractGridBatchSubscriber.handleAll
private function handleAll(FormInterface $form) { $config = $form->get('value')->getConfig(); $choiceValue = $config->getOption('choice_value'); $choices = iterator_to_array($config->getOption('grid')->getDataSource(['all' => true])); $this->buildForm($form, $choices); retu...
php
private function handleAll(FormInterface $form) { $config = $form->get('value')->getConfig(); $choiceValue = $config->getOption('choice_value'); $choices = iterator_to_array($config->getOption('grid')->getDataSource(['all' => true])); $this->buildForm($form, $choices); retu...
[ "private", "function", "handleAll", "(", "FormInterface", "$", "form", ")", "{", "$", "config", "=", "$", "form", "->", "get", "(", "'value'", ")", "->", "getConfig", "(", ")", ";", "$", "choiceValue", "=", "$", "config", "->", "getOption", "(", "'choi...
@param FormInterface $form @return mixed[]
[ "@param", "FormInterface", "$form" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Form/EventSubscriber/Batch/AbstractGridBatchSubscriber.php#L120-L131
heidelpay/PhpDoc
src/phpDocumentor/Descriptor/Builder/Reflector/ClassAssembler.php
ClassAssembler.create
public function create($data) { $classDescriptor = new ClassDescriptor(); $classDescriptor->setFullyQualifiedStructuralElementName($data->getName()); $classDescriptor->setName($data->getShortName()); $classDescriptor->setPackage($this->extractPackageFromDocBlock($data->getDocBlock()...
php
public function create($data) { $classDescriptor = new ClassDescriptor(); $classDescriptor->setFullyQualifiedStructuralElementName($data->getName()); $classDescriptor->setName($data->getShortName()); $classDescriptor->setPackage($this->extractPackageFromDocBlock($data->getDocBlock()...
[ "public", "function", "create", "(", "$", "data", ")", "{", "$", "classDescriptor", "=", "new", "ClassDescriptor", "(", ")", ";", "$", "classDescriptor", "->", "setFullyQualifiedStructuralElementName", "(", "$", "data", "->", "getName", "(", ")", ")", ";", "...
Creates a Descriptor from the provided data. @param ClassReflector $data @return ClassDescriptor
[ "Creates", "a", "Descriptor", "from", "the", "provided", "data", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/ClassAssembler.php#L31-L64
surebert/surebert-framework
src/sb/Cache/Hash.php
Hash.store
public function store($key, $data, $lifetime = 0) { if ($lifetime != 0) { $lifetime = \time() + $lifetime; } $data = array($lifetime, $data); $this->hash[$key] = $data; if ($key != $this->catalog_key) { $this->catalogKeyAdd($key, $lifetime); ...
php
public function store($key, $data, $lifetime = 0) { if ($lifetime != 0) { $lifetime = \time() + $lifetime; } $data = array($lifetime, $data); $this->hash[$key] = $data; if ($key != $this->catalog_key) { $this->catalogKeyAdd($key, $lifetime); ...
[ "public", "function", "store", "(", "$", "key", ",", "$", "data", ",", "$", "lifetime", "=", "0", ")", "{", "if", "(", "$", "lifetime", "!=", "0", ")", "{", "$", "lifetime", "=", "\\", "time", "(", ")", "+", "$", "lifetime", ";", "}", "$", "d...
Store the cache data in memcache
[ "Store", "the", "cache", "data", "in", "memcache" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L48-L64
surebert/surebert-framework
src/sb/Cache/Hash.php
Hash.fetch
public function fetch($key) { if (!\array_key_exists($key, $this->hash)) { return false; } $data = $this->hash[$key]; //check to see if it expired if ($data && ($data[0] == 0 || \time() <= $data[0])) { return $data[1]; } else { $...
php
public function fetch($key) { if (!\array_key_exists($key, $this->hash)) { return false; } $data = $this->hash[$key]; //check to see if it expired if ($data && ($data[0] == 0 || \time() <= $data[0])) { return $data[1]; } else { $...
[ "public", "function", "fetch", "(", "$", "key", ")", "{", "if", "(", "!", "\\", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "hash", ")", ")", "{", "return", "false", ";", "}", "$", "data", "=", "$", "this", "->", "hash", "[", "...
Fetches the cache from memcache
[ "Fetches", "the", "cache", "from", "memcache" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L69-L85
surebert/surebert-framework
src/sb/Cache/Hash.php
Hash.delete
public function delete($key) { $deleted = false; $catalog = \array_keys($this->getKeys()); foreach ($catalog as $k) { if ($k == $key) { unset($this->hash[$key]); if ($delete) { $this->catalogKeyDelete($k); ...
php
public function delete($key) { $deleted = false; $catalog = \array_keys($this->getKeys()); foreach ($catalog as $k) { if ($k == $key) { unset($this->hash[$key]); if ($delete) { $this->catalogKeyDelete($k); ...
[ "public", "function", "delete", "(", "$", "key", ")", "{", "$", "deleted", "=", "false", ";", "$", "catalog", "=", "\\", "array_keys", "(", "$", "this", "->", "getKeys", "(", ")", ")", ";", "foreach", "(", "$", "catalog", "as", "$", "k", ")", "{"...
Deletes cache data
[ "Deletes", "cache", "data" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/Hash.php#L90-L108
VincentChalnot/SidusDataGridBundle
Model/Column.php
Column.renderValue
public function renderValue($object, array $options = []): string { $options = array_merge( ['column' => $this, 'object' => $object], $this->getFormattingOptions(), $options ); $accessor = PropertyAccess::createPropertyAccessor(); try { ...
php
public function renderValue($object, array $options = []): string { $options = array_merge( ['column' => $this, 'object' => $object], $this->getFormattingOptions(), $options ); $accessor = PropertyAccess::createPropertyAccessor(); try { ...
[ "public", "function", "renderValue", "(", "$", "object", ",", "array", "$", "options", "=", "[", "]", ")", ":", "string", "{", "$", "options", "=", "array_merge", "(", "[", "'column'", "=>", "$", "this", ",", "'object'", "=>", "$", "object", "]", ","...
Render column for a given result @param mixed $object @param array $options @return string
[ "Render", "column", "for", "a", "given", "result" ]
train
https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Model/Column.php#L249-L264
surebert/surebert-framework
src/sb/Logger/FileSystem.php
FileSystem.getLogPath
protected function getLogPath($log) { $dir = $this->log_root.'/'.$log.'/'; if(!is_dir($dir)){ mkdir($dir, 0777, true); } return $dir; }
php
protected function getLogPath($log) { $dir = $this->log_root.'/'.$log.'/'; if(!is_dir($dir)){ mkdir($dir, 0777, true); } return $dir; }
[ "protected", "function", "getLogPath", "(", "$", "log", ")", "{", "$", "dir", "=", "$", "this", "->", "log_root", ".", "'/'", ".", "$", "log", ".", "'/'", ";", "if", "(", "!", "is_dir", "(", "$", "dir", ")", ")", "{", "mkdir", "(", "$", "dir", ...
Grabs the log path based on the type of log @param $log Sting the log type. Should be in the $enabled_logs array @return string The path to the log directory to be used
[ "Grabs", "the", "log", "path", "based", "on", "the", "type", "of", "log" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/FileSystem.php#L40-L50
surebert/surebert-framework
src/sb/Logger/FileSystem.php
FileSystem.write
protected function write($data, $log_type) { return file_put_contents($this->getLogPath($log_type) .date('Y_m_d').'.log', "\n\n".\date('Y/m/d H:i:s') ."\t".$this->agent_str ."\n".$data, \FILE_APPEND); }
php
protected function write($data, $log_type) { return file_put_contents($this->getLogPath($log_type) .date('Y_m_d').'.log', "\n\n".\date('Y/m/d H:i:s') ."\t".$this->agent_str ."\n".$data, \FILE_APPEND); }
[ "protected", "function", "write", "(", "$", "data", ",", "$", "log_type", ")", "{", "return", "file_put_contents", "(", "$", "this", "->", "getLogPath", "(", "$", "log_type", ")", ".", "date", "(", "'Y_m_d'", ")", ".", "'.log'", ",", "\"\\n\\n\"", ".", ...
Writes the data to file @param string $data The data to be written @param string $log_type The log_type being written to @return boolean If the data was written or not
[ "Writes", "the", "data", "to", "file" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/FileSystem.php#L58-L64
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.add
function add($header) { // convert to object form if (is_string($header)) $header = HeaderField::fromString($header); $this->_headers[] = $header; return $this; }
php
function add($header) { // convert to object form if (is_string($header)) $header = HeaderField::fromString($header); $this->_headers[] = $header; return $this; }
[ "function", "add", "(", "$", "header", ")", "{", "// convert to object form", "if", "(", "is_string", "(", "$", "header", ")", ")", "$", "header", "=", "HeaderField", "::", "fromString", "(", "$", "header", ")", ";", "$", "this", "->", "_headers", "[", ...
Adds a header to the collection, either in "Header: Value" format or an {@link HeaderField} object. @chainable
[ "Adds", "a", "header", "to", "the", "collection", "either", "in", "Header", ":", "Value", "format", "or", "an", "{" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L26-L34
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.remove
function remove($header) { $normalizer = new HeaderCaseNormalizer(); $name = $normalizer->normalize($header); foreach ($this->_headers as $idx => $header) { if ($header->getName() == $name) unset($this->_headers[$idx]); } return $this; }
php
function remove($header) { $normalizer = new HeaderCaseNormalizer(); $name = $normalizer->normalize($header); foreach ($this->_headers as $idx => $header) { if ($header->getName() == $name) unset($this->_headers[$idx]); } return $this; }
[ "function", "remove", "(", "$", "header", ")", "{", "$", "normalizer", "=", "new", "HeaderCaseNormalizer", "(", ")", ";", "$", "name", "=", "$", "normalizer", "->", "normalize", "(", "$", "header", ")", ";", "foreach", "(", "$", "this", "->", "_headers...
Remove a header by name @chainable
[ "Remove", "a", "header", "by", "name" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L40-L51
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.replace
function replace($header) { if (is_string($header)) $header = HeaderField::fromString($header); return $this ->remove($header->getName()) ->add($header); }
php
function replace($header) { if (is_string($header)) $header = HeaderField::fromString($header); return $this ->remove($header->getName()) ->add($header); }
[ "function", "replace", "(", "$", "header", ")", "{", "if", "(", "is_string", "(", "$", "header", ")", ")", "$", "header", "=", "HeaderField", "::", "fromString", "(", "$", "header", ")", ";", "return", "$", "this", "->", "remove", "(", "$", "header",...
Replaces a header in the collection, either in "Header: Value" format or an {@link HeaderField} object. @chainable
[ "Replaces", "a", "header", "in", "the", "collection", "either", "in", "Header", ":", "Value", "format", "or", "an", "{" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L58-L66
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.value
function value($name, $default = false) { $values = $this->values($name); return count($values) ? $values[0] : $default; }
php
function value($name, $default = false) { $values = $this->values($name); return count($values) ? $values[0] : $default; }
[ "function", "value", "(", "$", "name", ",", "$", "default", "=", "false", ")", "{", "$", "values", "=", "$", "this", "->", "values", "(", "$", "name", ")", ";", "return", "count", "(", "$", "values", ")", "?", "$", "values", "[", "0", "]", ":",...
Gets a single header value @return string
[ "Gets", "a", "single", "header", "value" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L72-L76
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.values
function values($name) { $normalizer = new HeaderCaseNormalizer(); $name = $normalizer->normalize($name); $values = array(); foreach ($this->_headers as $header) { if ($header->getName() == $name) { $values[] = $header->getValue(); } }...
php
function values($name) { $normalizer = new HeaderCaseNormalizer(); $name = $normalizer->normalize($name); $values = array(); foreach ($this->_headers as $header) { if ($header->getName() == $name) { $values[] = $header->getValue(); } }...
[ "function", "values", "(", "$", "name", ")", "{", "$", "normalizer", "=", "new", "HeaderCaseNormalizer", "(", ")", ";", "$", "name", "=", "$", "normalizer", "->", "normalize", "(", "$", "name", ")", ";", "$", "values", "=", "array", "(", ")", ";", ...
Gets an array of the values for a header @return array
[ "Gets", "an", "array", "of", "the", "values", "for", "a", "header" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L82-L95
99designs/ergo-http
src/HeaderCollection.php
HeaderCollection.toArray
function toArray($crlf = true) { $headers = array(); foreach ($this->_headers as $header) { $string = $header->__toString(); $headers[] = $crlf ? $string : rtrim($string); } return $headers; }
php
function toArray($crlf = true) { $headers = array(); foreach ($this->_headers as $header) { $string = $header->__toString(); $headers[] = $crlf ? $string : rtrim($string); } return $headers; }
[ "function", "toArray", "(", "$", "crlf", "=", "true", ")", "{", "$", "headers", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "_headers", "as", "$", "header", ")", "{", "$", "string", "=", "$", "header", "->", "__toString", "(", ...
Returns an array of the string versions of headers @return array
[ "Returns", "an", "array", "of", "the", "string", "versions", "of", "headers" ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderCollection.php#L101-L111
brick/di
src/Container.php
Container.has
public function has(string $key) : bool { if (isset($this->items[$key])) { return true; } try { $class = new \ReflectionClass($key); } catch (\ReflectionException $e) { return false; } $classes = $this->reflectionTools->getClassHi...
php
public function has(string $key) : bool { if (isset($this->items[$key])) { return true; } try { $class = new \ReflectionClass($key); } catch (\ReflectionException $e) { return false; } $classes = $this->reflectionTools->getClassHi...
[ "public", "function", "has", "(", "string", "$", "key", ")", ":", "bool", "{", "if", "(", "isset", "(", "$", "this", "->", "items", "[", "$", "key", "]", ")", ")", "{", "return", "true", ";", "}", "try", "{", "$", "class", "=", "new", "\\", "...
Returns whether the container has the given key. @param string $key The key, class or interface name. @return bool
[ "Returns", "whether", "the", "container", "has", "the", "given", "key", "." ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L94-L117
brick/di
src/Container.php
Container.get
public function get(string $key) { if (! $this->has($key)) { throw DependencyInjectionException::keyNotRegistered($key); } $value = $this->items[$key]; if ($value instanceof Definition) { return $value->get($this); } return $value; }
php
public function get(string $key) { if (! $this->has($key)) { throw DependencyInjectionException::keyNotRegistered($key); } $value = $this->items[$key]; if ($value instanceof Definition) { return $value->get($this); } return $value; }
[ "public", "function", "get", "(", "string", "$", "key", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "key", ")", ")", "{", "throw", "DependencyInjectionException", "::", "keyNotRegistered", "(", "$", "key", ")", ";", "}", "$", "value...
Returns the value for the given key. @param string $key The key, class or interface name. @return mixed @throws DependencyInjectionException If the key is not registered.
[ "Returns", "the", "value", "for", "the", "given", "key", "." ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L128-L141
brick/di
src/Container.php
Container.set
public function set(string $key, $value) : Container { $this->items[$key] = $value; return $this; }
php
public function set(string $key, $value) : Container { $this->items[$key] = $value; return $this; }
[ "public", "function", "set", "(", "string", "$", "key", ",", "$", "value", ")", ":", "Container", "{", "$", "this", "->", "items", "[", "$", "key", "]", "=", "$", "value", ";", "return", "$", "this", ";", "}" ]
Sets a single value. The value will be returned as is when requested with get(). @param string $key The key, class or interface name. @param mixed $value The value to set. @return Container
[ "Sets", "a", "single", "value", "." ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L153-L158
brick/di
src/Container.php
Container.bind
public function bind(string $key, $target = null) : BindingDefinition { return $this->items[$key] = new BindingDefinition($target ?? $key); }
php
public function bind(string $key, $target = null) : BindingDefinition { return $this->items[$key] = new BindingDefinition($target ?? $key); }
[ "public", "function", "bind", "(", "string", "$", "key", ",", "$", "target", "=", "null", ")", ":", "BindingDefinition", "{", "return", "$", "this", "->", "items", "[", "$", "key", "]", "=", "new", "BindingDefinition", "(", "$", "target", "??", "$", ...
Binds a key to a class name to be instantiated, or to a closure to be invoked. By default, the key is bound to itself, so these two lines of code are equivalent; $container->bind('Class\Name'); $container->bind('Class\Name', 'Class\Name'); It can be used to bind an interface to a class to be instantiated: $containe...
[ "Binds", "a", "key", "to", "a", "class", "name", "to", "be", "instantiated", "or", "to", "a", "closure", "to", "be", "invoked", "." ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L219-L222
brick/di
src/Container.php
Container.alias
public function alias(string $key, string $targetKey) : AliasDefinition { return $this->items[$key] = new AliasDefinition($targetKey); }
php
public function alias(string $key, string $targetKey) : AliasDefinition { return $this->items[$key] = new AliasDefinition($targetKey); }
[ "public", "function", "alias", "(", "string", "$", "key", ",", "string", "$", "targetKey", ")", ":", "AliasDefinition", "{", "return", "$", "this", "->", "items", "[", "$", "key", "]", "=", "new", "AliasDefinition", "(", "$", "targetKey", ")", ";", "}"...
Creates an alias from one key to another. This method can be used for use cases as simple as: $container->alias('my.alias', 'my.service'); This is particularly useful when you have already registered a class by its name, but now want to make it resolvable through an interface name it implements as well: $container-...
[ "Creates", "an", "alias", "from", "one", "key", "to", "another", "." ]
train
https://github.com/brick/di/blob/6ced82ab3623b8f1470317d38cbd2de855e7aa3d/src/Container.php#L248-L251
php-lug/lug
src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php
DataSourceBuilder.setParameter
public function setParameter($parameter, $value, $type = null) { $this->queryBuilder->setParameter($parameter, $value, $type); return $this; }
php
public function setParameter($parameter, $value, $type = null) { $this->queryBuilder->setParameter($parameter, $value, $type); return $this; }
[ "public", "function", "setParameter", "(", "$", "parameter", ",", "$", "value", ",", "$", "type", "=", "null", ")", "{", "$", "this", "->", "queryBuilder", "->", "setParameter", "(", "$", "parameter", ",", "$", "value", ",", "$", "type", ")", ";", "r...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php#L148-L153
php-lug/lug
src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php
DataSourceBuilder.createPlaceholder
public function createPlaceholder($parameter, $value, $type = null) { $placeholder = str_replace('.', '_', $parameter).'_'.str_replace('.', '', uniqid(null, true)); $this->setParameter($placeholder, $value, $type); return ':'.$placeholder; }
php
public function createPlaceholder($parameter, $value, $type = null) { $placeholder = str_replace('.', '_', $parameter).'_'.str_replace('.', '', uniqid(null, true)); $this->setParameter($placeholder, $value, $type); return ':'.$placeholder; }
[ "public", "function", "createPlaceholder", "(", "$", "parameter", ",", "$", "value", ",", "$", "type", "=", "null", ")", "{", "$", "placeholder", "=", "str_replace", "(", "'.'", ",", "'_'", ",", "$", "parameter", ")", ".", "'_'", ".", "str_replace", "(...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php#L158-L164
php-lug/lug
src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php
DataSourceBuilder.getProperty
public function getProperty($field, $root = null) { return $this->repository->getProperty($field, $root ?: $this->queryBuilder); }
php
public function getProperty($field, $root = null) { return $this->repository->getProperty($field, $root ?: $this->queryBuilder); }
[ "public", "function", "getProperty", "(", "$", "field", ",", "$", "root", "=", "null", ")", "{", "return", "$", "this", "->", "repository", "->", "getProperty", "(", "$", "field", ",", "$", "root", "?", ":", "$", "this", "->", "queryBuilder", ")", ";...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php#L169-L172
php-lug/lug
src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php
DataSourceBuilder.getExpressionBuilder
public function getExpressionBuilder() { if ($this->expressionBuilder === null) { $this->expressionBuilder = new ExpressionBuilder($this->queryBuilder->expr()); } return $this->expressionBuilder; }
php
public function getExpressionBuilder() { if ($this->expressionBuilder === null) { $this->expressionBuilder = new ExpressionBuilder($this->queryBuilder->expr()); } return $this->expressionBuilder; }
[ "public", "function", "getExpressionBuilder", "(", ")", "{", "if", "(", "$", "this", "->", "expressionBuilder", "===", "null", ")", "{", "$", "this", "->", "expressionBuilder", "=", "new", "ExpressionBuilder", "(", "$", "this", "->", "queryBuilder", "->", "e...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php#L185-L192
php-lug/lug
src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php
DataSourceBuilder.createDataSource
public function createDataSource(array $options = []) { $queryBuilder = clone $this->queryBuilder; if (isset($options['all']) && $options['all']) { return new ArrayDataSource($queryBuilder->getQuery()->getResult()); } $dataSource = new PagerfantaDataSource(new DoctrineO...
php
public function createDataSource(array $options = []) { $queryBuilder = clone $this->queryBuilder; if (isset($options['all']) && $options['all']) { return new ArrayDataSource($queryBuilder->getQuery()->getResult()); } $dataSource = new PagerfantaDataSource(new DoctrineO...
[ "public", "function", "createDataSource", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "queryBuilder", "=", "clone", "$", "this", "->", "queryBuilder", ";", "if", "(", "isset", "(", "$", "options", "[", "'all'", "]", ")", "&&", "$", "o...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/DataSource/Doctrine/ORM/DataSourceBuilder.php#L197-L215
giftcards/Encryption
CipherText/Rotator/Store/StoreRegistryBuilder.php
StoreRegistryBuilder.addStoreToBuildQueue
private function addStoreToBuildQueue($storeName, $builderName, array $options) { if (!$this->factory->getRegistry()->has($builderName)) { throw new \DomainException(sprintf("Unknown builder: %s", $builderName)); } $this->buildQueue[$storeName] = array($builderName, $options); ...
php
private function addStoreToBuildQueue($storeName, $builderName, array $options) { if (!$this->factory->getRegistry()->has($builderName)) { throw new \DomainException(sprintf("Unknown builder: %s", $builderName)); } $this->buildQueue[$storeName] = array($builderName, $options); ...
[ "private", "function", "addStoreToBuildQueue", "(", "$", "storeName", ",", "$", "builderName", ",", "array", "$", "options", ")", "{", "if", "(", "!", "$", "this", "->", "factory", "->", "getRegistry", "(", ")", "->", "has", "(", "$", "builderName", ")",...
Queues a store to be built @param string $storeName @param $builderName @param array $options @return StoreRegistryBuilder
[ "Queues", "a", "store", "to", "be", "built" ]
train
https://github.com/giftcards/Encryption/blob/a48f92408538e2ffe1c8603f168d57803aad7100/CipherText/Rotator/Store/StoreRegistryBuilder.php#L90-L97
inhere/php-librarys
src/Traits/LiteConfigTrait.php
LiteConfigTrait.getValue
public function getValue($name, $default = null) { $value = array_key_exists($name, $this->config) ? $this->config[$name] : $default; if ($value && ($value instanceof \Closure)) { $value = $value(); } return $value; }
php
public function getValue($name, $default = null) { $value = array_key_exists($name, $this->config) ? $this->config[$name] : $default; if ($value && ($value instanceof \Closure)) { $value = $value(); } return $value; }
[ "public", "function", "getValue", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "value", "=", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "config", ")", "?", "$", "this", "->", "config", "[", "$", "name", "]",...
Method to get property Options @param string $name @param mixed $default @return mixed
[ "Method", "to", "get", "property", "Options" ]
train
https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LiteConfigTrait.php#L35-L44
atomwares/atom-view
src/Renderer.php
Renderer.removeAttribute
public function removeAttribute($name) { if (isset($this->attributes[$name])) { unset($this->attributes[$name]); } return $this; }
php
public function removeAttribute($name) { if (isset($this->attributes[$name])) { unset($this->attributes[$name]); } return $this; }
[ "public", "function", "removeAttribute", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "attributes", "[", "$", "name", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "attributes", "[", "$", "name", "]", ")", ";", "...
@param string $name @return $this
[ "@param", "string", "$name" ]
train
https://github.com/atomwares/atom-view/blob/8f2c3f8ed736c5a2e7a442659e2db99a7f333fce/src/Renderer.php#L149-L156
atomwares/atom-view
src/Renderer.php
Renderer.block
public function block($name, $default = null) { return isset($this->blocks[$name]) ? $this->blocks[$name] : $default; }
php
public function block($name, $default = null) { return isset($this->blocks[$name]) ? $this->blocks[$name] : $default; }
[ "public", "function", "block", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "return", "isset", "(", "$", "this", "->", "blocks", "[", "$", "name", "]", ")", "?", "$", "this", "->", "blocks", "[", "$", "name", "]", ":", "$", "de...
@param string $name @param string $default @return mixed|null
[ "@param", "string", "$name", "@param", "string", "$default" ]
train
https://github.com/atomwares/atom-view/blob/8f2c3f8ed736c5a2e7a442659e2db99a7f333fce/src/Renderer.php#L194-L197
atomwares/atom-view
src/Renderer.php
Renderer.render
public function render($template, array $data = []) { ob_start(); $this->requireTemplate($template, $data); while ($extend = array_pop($this->inherits)) { ob_clean(); $this->requireTemplate($extend, $data); } return ob_get_clean(); }
php
public function render($template, array $data = []) { ob_start(); $this->requireTemplate($template, $data); while ($extend = array_pop($this->inherits)) { ob_clean(); $this->requireTemplate($extend, $data); } return ob_get_clean(); }
[ "public", "function", "render", "(", "$", "template", ",", "array", "$", "data", "=", "[", "]", ")", "{", "ob_start", "(", ")", ";", "$", "this", "->", "requireTemplate", "(", "$", "template", ",", "$", "data", ")", ";", "while", "(", "$", "extend"...
@param string $template @param array $data @return string
[ "@param", "string", "$template", "@param", "array", "$data" ]
train
https://github.com/atomwares/atom-view/blob/8f2c3f8ed736c5a2e7a442659e2db99a7f333fce/src/Renderer.php#L205-L216
alevilar/ristorantino-vendor
Comanda/Controller/DetalleComandasController.php
DetalleComandasController.index
public function index() { $this->layout = 'Stats.default'; $this->elementMenu = 'Stats.menu'; // por default ordenar por sumatoria de dinero vendido $conditions['order'] = array('ventas DESC',"cant DESC"); if ( !empty( $this->request->query ) && $this->request->query['ca...
php
public function index() { $this->layout = 'Stats.default'; $this->elementMenu = 'Stats.menu'; // por default ordenar por sumatoria de dinero vendido $conditions['order'] = array('ventas DESC',"cant DESC"); if ( !empty( $this->request->query ) && $this->request->query['ca...
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "layout", "=", "'Stats.default'", ";", "$", "this", "->", "elementMenu", "=", "'Stats.menu'", ";", "// por default ordenar por sumatoria de dinero vendido", "$", "conditions", "[", "'order'", "]", "=...
Listado de los productos mas Vendidos csegun regla de Paretto
[ "Listado", "de", "los", "productos", "mas", "Vendidos", "csegun", "regla", "de", "Paretto" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Comanda/Controller/DetalleComandasController.php#L18-L102
alevilar/ristorantino-vendor
Comanda/Controller/DetalleComandasController.php
DetalleComandasController.add
public function add ( $mesa_id = null ) { if ( $this->request->is(array('post', 'put') ) ) { if ( $this->DetalleComanda->Comanda->saveComanda( $this->request->data ) ) { $this->Session->setFlash('Se guardó correctamente', 'Risto.flash_success'); } else { ...
php
public function add ( $mesa_id = null ) { if ( $this->request->is(array('post', 'put') ) ) { if ( $this->DetalleComanda->Comanda->saveComanda( $this->request->data ) ) { $this->Session->setFlash('Se guardó correctamente', 'Risto.flash_success'); } else { ...
[ "public", "function", "add", "(", "$", "mesa_id", "=", "null", ")", "{", "if", "(", "$", "this", "->", "request", "->", "is", "(", "array", "(", "'post'", ",", "'put'", ")", ")", ")", "{", "if", "(", "$", "this", "->", "DetalleComanda", "->", "Co...
}
[ "}" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Comanda/Controller/DetalleComandasController.php#L125-L152
jakubkratina/larachartie
src/DataTable/Factory/ColumnsFactory.php
ColumnsFactory.create
public static function create($type, $label = '') { if (Type::exists($type) === false) { throw new InvalidColumnTypeException($type); } return new Column($type, $label); }
php
public static function create($type, $label = '') { if (Type::exists($type) === false) { throw new InvalidColumnTypeException($type); } return new Column($type, $label); }
[ "public", "static", "function", "create", "(", "$", "type", ",", "$", "label", "=", "''", ")", "{", "if", "(", "Type", "::", "exists", "(", "$", "type", ")", "===", "false", ")", "{", "throw", "new", "InvalidColumnTypeException", "(", "$", "type", ")...
{@inheritdoc}
[ "{" ]
train
https://github.com/jakubkratina/larachartie/blob/96c535650d61a2a6c1c1b12d374e5e59d33239f6/src/DataTable/Factory/ColumnsFactory.php#L18-L25
j-d/draggy
src/Draggy/Loader.php
Loader.checkMandatoryAttributes
private function checkMandatoryAttributes($where, array $xmlSection, array $requirements) { foreach ($requirements as $requirement) { if (!isset( $xmlSection[$requirement] )) { throw new InvalidFileException( 'Could not find the attribute \'' . $requirement . '\' on the ' . $wher...
php
private function checkMandatoryAttributes($where, array $xmlSection, array $requirements) { foreach ($requirements as $requirement) { if (!isset( $xmlSection[$requirement] )) { throw new InvalidFileException( 'Could not find the attribute \'' . $requirement . '\' on the ' . $wher...
[ "private", "function", "checkMandatoryAttributes", "(", "$", "where", ",", "array", "$", "xmlSection", ",", "array", "$", "requirements", ")", "{", "foreach", "(", "$", "requirements", "as", "$", "requirement", ")", "{", "if", "(", "!", "isset", "(", "$", ...
@param string $where @param array $xmlSection @param array $requirements @throws Exceptions\InvalidFileException
[ "@param", "string", "$where", "@param", "array", "$xmlSection", "@param", "array", "$requirements" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L77-L84
j-d/draggy
src/Draggy/Loader.php
Loader.getProjectProperties
private function getProjectProperties() { $r = ''; $projectOptions = (array)$this->xml->xpath('/draggy/project'); $projectOptions = (array)$projectOptions[0]; $this->checkMandatoryAttributes('Project', $projectOptions, ['language', 'description', 'orm', 'framework']); $r ....
php
private function getProjectProperties() { $r = ''; $projectOptions = (array)$this->xml->xpath('/draggy/project'); $projectOptions = (array)$projectOptions[0]; $this->checkMandatoryAttributes('Project', $projectOptions, ['language', 'description', 'orm', 'framework']); $r ....
[ "private", "function", "getProjectProperties", "(", ")", "{", "$", "r", "=", "''", ";", "$", "projectOptions", "=", "(", "array", ")", "$", "this", "->", "xml", "->", "xpath", "(", "'/draggy/project'", ")", ";", "$", "projectOptions", "=", "(", "array", ...
Get the project properties from the saved file @return string
[ "Get", "the", "project", "properties", "from", "the", "saved", "file" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L91-L107
j-d/draggy
src/Draggy/Loader.php
Loader.getAutocodeProperties
private function getAutocodeProperties() { $r = ''; $autocode = (array)$this->xml->xpath('/draggy/autocode'); $autocode = (array)$autocode[0]; $autocodeProperties = (array)$autocode['properties']; $autocodeConfigurations = (array)$autocode['configurations']; $au...
php
private function getAutocodeProperties() { $r = ''; $autocode = (array)$this->xml->xpath('/draggy/autocode'); $autocode = (array)$autocode[0]; $autocodeProperties = (array)$autocode['properties']; $autocodeConfigurations = (array)$autocode['configurations']; $au...
[ "private", "function", "getAutocodeProperties", "(", ")", "{", "$", "r", "=", "''", ";", "$", "autocode", "=", "(", "array", ")", "$", "this", "->", "xml", "->", "xpath", "(", "'/draggy/autocode'", ")", ";", "$", "autocode", "=", "(", "array", ")", "...
Get the project autocode properties from the saved file @return string
[ "Get", "the", "project", "autocode", "properties", "from", "the", "saved", "file" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L114-L138
j-d/draggy
src/Draggy/Loader.php
Loader.getModules
private function getModules() { $modules = (array)$this->xml->xpath('/draggy/module'); $r = ''; foreach ($modules as $module) { $moduleAttributes = (array)$module; $moduleAttributes = (array)$moduleAttributes['@attributes']; $this->checkMandatoryAttribu...
php
private function getModules() { $modules = (array)$this->xml->xpath('/draggy/module'); $r = ''; foreach ($modules as $module) { $moduleAttributes = (array)$module; $moduleAttributes = (array)$moduleAttributes['@attributes']; $this->checkMandatoryAttribu...
[ "private", "function", "getModules", "(", ")", "{", "$", "modules", "=", "(", "array", ")", "$", "this", "->", "xml", "->", "xpath", "(", "'/draggy/module'", ")", ";", "$", "r", "=", "''", ";", "foreach", "(", "$", "modules", "as", "$", "module", "...
Get the project modules @return string
[ "Get", "the", "project", "modules" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L145-L168
j-d/draggy
src/Draggy/Loader.php
Loader.getClassLikeProperties
private function getClassLikeProperties($classLikeAttributes, $varName) { $r = ''; if (isset( $classLikeAttributes['description'] )) { $r .= $varName . '.setDescription("' . str_replace('\'', '\\\'', $classLikeAttributes['description']) . '");' . PHP_EOL; } if (isset( $...
php
private function getClassLikeProperties($classLikeAttributes, $varName) { $r = ''; if (isset( $classLikeAttributes['description'] )) { $r .= $varName . '.setDescription("' . str_replace('\'', '\\\'', $classLikeAttributes['description']) . '");' . PHP_EOL; } if (isset( $...
[ "private", "function", "getClassLikeProperties", "(", "$", "classLikeAttributes", ",", "$", "varName", ")", "{", "$", "r", "=", "''", ";", "if", "(", "isset", "(", "$", "classLikeAttributes", "[", "'description'", "]", ")", ")", "{", "$", "r", ".=", "$",...
@param array $classLikeAttributes @param string $varName @return string
[ "@param", "array", "$classLikeAttributes", "@param", "string", "$varName" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L176-L217
j-d/draggy
src/Draggy/Loader.php
Loader.getClasses
private function getClasses() { $r = ''; // Inside classes foreach ($this->modules as $module) { $classes = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/class'); foreach ($classes as $class) { $classAttributes = (array)$class; ...
php
private function getClasses() { $r = ''; // Inside classes foreach ($this->modules as $module) { $classes = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/class'); foreach ($classes as $class) { $classAttributes = (array)$class; ...
[ "private", "function", "getClasses", "(", ")", "{", "$", "r", "=", "''", ";", "// Inside classes", "foreach", "(", "$", "this", "->", "modules", "as", "$", "module", ")", "{", "$", "classes", "=", "(", "array", ")", "$", "this", "->", "xml", "->", ...
Get the project classes @return string
[ "Get", "the", "project", "classes" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L224-L287
j-d/draggy
src/Draggy/Loader.php
Loader.getAbstracts
private function getAbstracts() { $r = ''; // Inside abstracts foreach ($this->modules as $module) { $abstracts = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/abstract'); foreach ($abstracts as $abstract) { $abstractAttributes ...
php
private function getAbstracts() { $r = ''; // Inside abstracts foreach ($this->modules as $module) { $abstracts = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/abstract'); foreach ($abstracts as $abstract) { $abstractAttributes ...
[ "private", "function", "getAbstracts", "(", ")", "{", "$", "r", "=", "''", ";", "// Inside abstracts", "foreach", "(", "$", "this", "->", "modules", "as", "$", "module", ")", "{", "$", "abstracts", "=", "(", "array", ")", "$", "this", "->", "xml", "-...
Get the project classes @return string
[ "Get", "the", "project", "classes" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L294-L357
j-d/draggy
src/Draggy/Loader.php
Loader.getInterfaceProperties
private function getInterfaceProperties($interfaceAttributes, $varName) { $r = ''; if (isset( $interfaceAttributes['description'] )) { $r .= $varName . '.setDescription("' . str_replace('\'', '\\\'', $interfaceAttributes['description']) . '");' . PHP_EOL; } return $r; ...
php
private function getInterfaceProperties($interfaceAttributes, $varName) { $r = ''; if (isset( $interfaceAttributes['description'] )) { $r .= $varName . '.setDescription("' . str_replace('\'', '\\\'', $interfaceAttributes['description']) . '");' . PHP_EOL; } return $r; ...
[ "private", "function", "getInterfaceProperties", "(", "$", "interfaceAttributes", ",", "$", "varName", ")", "{", "$", "r", "=", "''", ";", "if", "(", "isset", "(", "$", "interfaceAttributes", "[", "'description'", "]", ")", ")", "{", "$", "r", ".=", "$",...
@param array $interfaceAttributes @param string $varName @return string
[ "@param", "array", "$interfaceAttributes", "@param", "string", "$varName" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L365-L374
j-d/draggy
src/Draggy/Loader.php
Loader.getInterfaces
private function getInterfaces() { $r = ''; // Inside interfaces foreach ($this->modules as $module) { $interfaces = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/interface'); foreach ($interfaces as $interface) { $interfaceAttr...
php
private function getInterfaces() { $r = ''; // Inside interfaces foreach ($this->modules as $module) { $interfaces = (array)$this->xml->xpath('/draggy/module[@name=\'' . $module . '\']/interface'); foreach ($interfaces as $interface) { $interfaceAttr...
[ "private", "function", "getInterfaces", "(", ")", "{", "$", "r", "=", "''", ";", "// Inside interfaces", "foreach", "(", "$", "this", "->", "modules", "as", "$", "module", ")", "{", "$", "interfaces", "=", "(", "array", ")", "$", "this", "->", "xml", ...
Get the project interfaces @return string
[ "Get", "the", "project", "interfaces" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L381-L440
j-d/draggy
src/Draggy/Loader.php
Loader.getClassLikeAttributeProperties
private function getClassLikeAttributeProperties($classLike, $classLikeAttributeAttributes, $varName) { $r = ''; foreach ($classLikeAttributeAttributes as $attribute) { $attributeProperties = (array)$attribute; $attributeProperties = $attributeProperties['@attributes']; ...
php
private function getClassLikeAttributeProperties($classLike, $classLikeAttributeAttributes, $varName) { $r = ''; foreach ($classLikeAttributeAttributes as $attribute) { $attributeProperties = (array)$attribute; $attributeProperties = $attributeProperties['@attributes']; ...
[ "private", "function", "getClassLikeAttributeProperties", "(", "$", "classLike", ",", "$", "classLikeAttributeAttributes", ",", "$", "varName", ")", "{", "$", "r", "=", "''", ";", "foreach", "(", "$", "classLikeAttributeAttributes", "as", "$", "attribute", ")", ...
@param string $classLike @param array $classLikeAttributeAttributes @param string $varName @return string
[ "@param", "string", "$classLike", "@param", "array", "$classLikeAttributeAttributes", "@param", "string", "$varName" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L449-L532
j-d/draggy
src/Draggy/Loader.php
Loader.getAttributes
private function getAttributes() { $r = ''; // Inside classes foreach ($this->insideClasses as $insideClassModule => $insideClasses) { foreach ($insideClasses as $insideClass) { $attributes = $this->xml->xpath( '/draggy/module[@name=\'' . $ins...
php
private function getAttributes() { $r = ''; // Inside classes foreach ($this->insideClasses as $insideClassModule => $insideClasses) { foreach ($insideClasses as $insideClass) { $attributes = $this->xml->xpath( '/draggy/module[@name=\'' . $ins...
[ "private", "function", "getAttributes", "(", ")", "{", "$", "r", "=", "''", ";", "// Inside classes", "foreach", "(", "$", "this", "->", "insideClasses", "as", "$", "insideClassModule", "=>", "$", "insideClasses", ")", "{", "foreach", "(", "$", "insideClasse...
Get the project attributes @return string
[ "Get", "the", "project", "attributes" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L539-L612
j-d/draggy
src/Draggy/Loader.php
Loader.getRelationships
private function getRelationships() { $r = ''; $relationships = (array)$this->xml->xpath('/draggy/relationships/relation'); foreach ($relationships as $relation) { $relationAttributes = (array)$relation; $relationAttributes = $relationAttributes['@attributes']; ...
php
private function getRelationships() { $r = ''; $relationships = (array)$this->xml->xpath('/draggy/relationships/relation'); foreach ($relationships as $relation) { $relationAttributes = (array)$relation; $relationAttributes = $relationAttributes['@attributes']; ...
[ "private", "function", "getRelationships", "(", ")", "{", "$", "r", "=", "''", ";", "$", "relationships", "=", "(", "array", ")", "$", "this", "->", "xml", "->", "xpath", "(", "'/draggy/relationships/relation'", ")", ";", "foreach", "(", "$", "relationship...
Get the project attributes @return string
[ "Get", "the", "project", "attributes" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L702-L749
j-d/draggy
src/Draggy/Loader.php
Loader.getLoaderJS
public function getLoaderJS() { if ($this->newFile) { return ''; } $r = ''; $r .= $this->getProjectProperties(); // FIRST STEP: Load all modules and entities $r .= $this->getModules(); $r .= $this->getClasses(); $r .= $this->getAbstracts...
php
public function getLoaderJS() { if ($this->newFile) { return ''; } $r = ''; $r .= $this->getProjectProperties(); // FIRST STEP: Load all modules and entities $r .= $this->getModules(); $r .= $this->getClasses(); $r .= $this->getAbstracts...
[ "public", "function", "getLoaderJS", "(", ")", "{", "if", "(", "$", "this", "->", "newFile", ")", "{", "return", "''", ";", "}", "$", "r", "=", "''", ";", "$", "r", ".=", "$", "this", "->", "getProjectProperties", "(", ")", ";", "// FIRST STEP: Load ...
Returns all the JS code to load the project @return string
[ "Returns", "all", "the", "JS", "code", "to", "load", "the", "project" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Loader.php#L756-L789
web2all/framework
src/Web2All/Manager/PrsLogger.class.php
Web2All_Manager_PrsLogger.log
public function log($level, $message, array $context = array()) { $this->Web2All->debugLog('['.$level.'] '.$this->interpolate($message, $context)); }
php
public function log($level, $message, array $context = array()) { $this->Web2All->debugLog('['.$level.'] '.$this->interpolate($message, $context)); }
[ "public", "function", "log", "(", "$", "level", ",", "$", "message", ",", "array", "$", "context", "=", "array", "(", ")", ")", "{", "$", "this", "->", "Web2All", "->", "debugLog", "(", "'['", ".", "$", "level", ".", "'] '", ".", "$", "this", "->...
Logs with an arbitrary level. @param mixed $level @param string $message @param array $context @return void
[ "Logs", "with", "an", "arbitrary", "level", "." ]
train
https://github.com/web2all/framework/blob/6990dc3700efad3207ec6e710124f7ba18891b31/src/Web2All/Manager/PrsLogger.class.php#L29-L32
surebert/surebert-framework
src/sb/Excel/Reader.php
Reader.readCells
public function readCells($func, $sheet = 0) { $rows = $this->rowcount(); $cols = $this->colcount(); for ($r = 1; $r <= $rows; $r++) { for ($c = 1; $c < $cols; $c++) { $func($this->value($r, $c, $sheet), $r, $c); } } }
php
public function readCells($func, $sheet = 0) { $rows = $this->rowcount(); $cols = $this->colcount(); for ($r = 1; $r <= $rows; $r++) { for ($c = 1; $c < $cols; $c++) { $func($this->value($r, $c, $sheet), $r, $c); } } }
[ "public", "function", "readCells", "(", "$", "func", ",", "$", "sheet", "=", "0", ")", "{", "$", "rows", "=", "$", "this", "->", "rowcount", "(", ")", ";", "$", "cols", "=", "$", "this", "->", "colcount", "(", ")", ";", "for", "(", "$", "r", ...
Fires a function per cell @param function $func The function to fire for each cell, passes (value, rownum, colnum) as arguments @param integer $sheet The sheet to read use when going through cell @example <code> $data = new \sb\Excel_Reader('/path/to/excelfile.xls'); $data->readCells(function($val, $row, $col) use($dat...
[ "Fires", "a", "function", "per", "cell", "@param", "function", "$func", "The", "function", "to", "fire", "for", "each", "cell", "passes", "(", "value", "rownum", "colnum", ")", "as", "arguments", "@param", "integer", "$sheet", "The", "sheet", "to", "read", ...
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader.php#L70-L79
surebert/surebert-framework
src/sb/Excel/Reader.php
Reader.toArray
public function toArray($sheet = 0) { $arr = array(); for ($row = 1; $row <= $this->rowcount($sheet); $row++) { for ($col = 1; $col <= $this->colcount($sheet); $col++) { $arr[$row][$col] = $this->val($row, $col, $sheet); } } return $arr; }
php
public function toArray($sheet = 0) { $arr = array(); for ($row = 1; $row <= $this->rowcount($sheet); $row++) { for ($col = 1; $col <= $this->colcount($sheet); $col++) { $arr[$row][$col] = $this->val($row, $col, $sheet); } } return $arr; }
[ "public", "function", "toArray", "(", "$", "sheet", "=", "0", ")", "{", "$", "arr", "=", "array", "(", ")", ";", "for", "(", "$", "row", "=", "1", ";", "$", "row", "<=", "$", "this", "->", "rowcount", "(", "$", "sheet", ")", ";", "$", "row", ...
export to multi dimensional array @param integer $sheet @return array
[ "export", "to", "multi", "dimensional", "array" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader.php#L86-L96
surebert/surebert-framework
src/sb/Excel/Reader.php
Reader.info
public function info($row, $col, $type = '', $sheet = 0) { $col = $this->getCol($col); if (array_key_exists('cellsInfo', $this->sheets[$sheet]) && array_key_exists($row, $this->sheets[$sheet]['cellsInfo']) && array_key_exists($col, $this->sheets[$sheet]['cellsInfo'][$row]) ...
php
public function info($row, $col, $type = '', $sheet = 0) { $col = $this->getCol($col); if (array_key_exists('cellsInfo', $this->sheets[$sheet]) && array_key_exists($row, $this->sheets[$sheet]['cellsInfo']) && array_key_exists($col, $this->sheets[$sheet]['cellsInfo'][$row]) ...
[ "public", "function", "info", "(", "$", "row", ",", "$", "col", ",", "$", "type", "=", "''", ",", "$", "sheet", "=", "0", ")", "{", "$", "col", "=", "$", "this", "->", "getCol", "(", "$", "col", ")", ";", "if", "(", "array_key_exists", "(", "...
Gets info for a specifc cell of a specific sheet @param int $row @param int $col @param string $type @param int $sheet @return string
[ "Gets", "info", "for", "a", "specifc", "cell", "of", "a", "specific", "sheet" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader.php#L106-L116
alevilar/ristorantino-vendor
Mesa/Model/Mozo.php
Mozo.mesasAbiertas
public function mesasAbiertas($mozo_id = null, $lastAccess = null){ $conditions = array(); // si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo if ( !empty($mozo_id) ){ $conditions['Mozo.id'] = $mozo_id; } else { ...
php
public function mesasAbiertas($mozo_id = null, $lastAccess = null){ $conditions = array(); // si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo if ( !empty($mozo_id) ){ $conditions['Mozo.id'] = $mozo_id; } else { ...
[ "public", "function", "mesasAbiertas", "(", "$", "mozo_id", "=", "null", ",", "$", "lastAccess", "=", "null", ")", "{", "$", "conditions", "=", "array", "(", ")", ";", "// si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo", "if", "(", "!", ...
Para todos los mozos activos, me trae sus mesas abiertas @param int $mozo_id id del mozo, en caso de que no le pase ninguno, me busca todos @return array Mozos con sus mesas, Comandas, detalleComanda, productos y sabores
[ "Para", "todos", "los", "mozos", "activos", "me", "trae", "sus", "mesas", "abiertas" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Mesa/Model/Mozo.php#L103-L161
alevilar/ristorantino-vendor
Mesa/Model/Mozo.php
Mozo.mesasBorradas
public function mesasBorradas($mozo_id = null, $lastAccess = null){ if ( empty($lastAccess) ) { return array(); } $conditions = array(); // si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo if ( !empty($m...
php
public function mesasBorradas($mozo_id = null, $lastAccess = null){ if ( empty($lastAccess) ) { return array(); } $conditions = array(); // si vino el mozo por parametro, es porque solo quiero las mesas de ese mozo if ( !empty($m...
[ "public", "function", "mesasBorradas", "(", "$", "mozo_id", "=", "null", ",", "$", "lastAccess", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "lastAccess", ")", ")", "{", "return", "array", "(", ")", ";", "}", "$", "conditions", "=", "array",...
Para todos los mozos activos, me trae sus mesas eliminadas entre cada actualizacion de datos @param int $mozo_id id del mozo, en caso de que no le pase ninguno, me busca todos @return array Mozos con sus mesas, Comandas, detalleComanda, productos y sabores
[ "Para", "todos", "los", "mozos", "activos", "me", "trae", "sus", "mesas", "eliminadas", "entre", "cada", "actualizacion", "de", "datos" ]
train
https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Mesa/Model/Mozo.php#L171-L223
weew/http
src/Weew/Http/Data/JsonData.php
JsonData.pick
public function pick(array $keys) { $data = []; foreach ($keys as $key) { array_set($data, $key, $this->get($key)); } return $data; }
php
public function pick(array $keys) { $data = []; foreach ($keys as $key) { array_set($data, $key, $this->get($key)); } return $data; }
[ "public", "function", "pick", "(", "array", "$", "keys", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "array_set", "(", "$", "data", ",", "$", "key", ",", "$", "this", "->", "get", "(", "...
@param array $keys @return array
[ "@param", "array", "$keys" ]
train
https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/Data/JsonData.php#L56-L64
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php
DocBlockConverter.convert
public function convert(\DOMElement $parent, DescriptorAbstract $element) { $child = new \DOMElement('docblock'); $parent->appendChild($child); $child->setAttribute('line', $element->getLine()); $package = str_replace('&', '&amp;', ltrim($element->getPackage(), '\\')); $pare...
php
public function convert(\DOMElement $parent, DescriptorAbstract $element) { $child = new \DOMElement('docblock'); $parent->appendChild($child); $child->setAttribute('line', $element->getLine()); $package = str_replace('&', '&amp;', ltrim($element->getPackage(), '\\')); $pare...
[ "public", "function", "convert", "(", "\\", "DOMElement", "$", "parent", ",", "DescriptorAbstract", "$", "element", ")", "{", "$", "child", "=", "new", "\\", "DOMElement", "(", "'docblock'", ")", ";", "$", "parent", "->", "appendChild", "(", "$", "child", ...
Exports the given reflection object to the parent XML element. This method creates a new child element on the given parent XML element and takes the properties of the Reflection argument and sets the elements and attributes on the child. If a child DOMElement is provided then the properties and attributes are set on ...
[ "Exports", "the", "given", "reflection", "object", "to", "the", "parent", "XML", "element", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php#L59-L74
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php
DocBlockConverter.addDescription
protected function addDescription(\DOMElement $node, DescriptorAbstract $element) { $node->appendChild(new \DOMElement('long-description')) ->appendChild(new \DOMText($element->getDescription())); }
php
protected function addDescription(\DOMElement $node, DescriptorAbstract $element) { $node->appendChild(new \DOMElement('long-description')) ->appendChild(new \DOMText($element->getDescription())); }
[ "protected", "function", "addDescription", "(", "\\", "DOMElement", "$", "node", ",", "DescriptorAbstract", "$", "element", ")", "{", "$", "node", "->", "appendChild", "(", "new", "\\", "DOMElement", "(", "'long-description'", ")", ")", "->", "appendChild", "(...
Adds the DocBlock's long description to the $child element, @param \DOMElement $node @param DescriptorAbstract $element @return void
[ "Adds", "the", "DocBlock", "s", "long", "description", "to", "the", "$child", "element" ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php#L99-L103
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php
DocBlockConverter.addInheritedFromTag
protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor) { $parentElement = $descriptor->getInheritedElement(); if (! $parentElement instanceof $descriptor) { return; } $child = new \DOMElement('tag'); $docBlock->appendChild($child); $r...
php
protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor) { $parentElement = $descriptor->getInheritedElement(); if (! $parentElement instanceof $descriptor) { return; } $child = new \DOMElement('tag'); $docBlock->appendChild($child); $r...
[ "protected", "function", "addInheritedFromTag", "(", "\\", "DOMElement", "$", "docBlock", ",", "$", "descriptor", ")", "{", "$", "parentElement", "=", "$", "descriptor", "->", "getInheritedElement", "(", ")", ";", "if", "(", "!", "$", "parentElement", "instanc...
Adds the 'inherited_from' tag when a Descriptor inherits from another Descriptor. @param \DOMElement $docBlock @param DescriptorAbstract $descriptor @return void
[ "Adds", "the", "inherited_from", "tag", "when", "a", "Descriptor", "inherits", "from", "another", "Descriptor", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml/DocBlockConverter.php#L137-L153
frdl/webfan
.ApplicationComposer/lib/webdof/valFormats.php
valFormats._isuuidversion
protected function _isuuidversion($in, $strict = true) { if(false !== $strict) { $in = strtolower($in ); $alphanums = "a-f"; }else{ $alphanums = "a-z"; } if(!preg_match("/^[0-9$alphanums]{8}-[0-9$alphanums]{4}-(?<version>[0-9$alphanums]{1})[0-9$alpha...
php
protected function _isuuidversion($in, $strict = true) { if(false !== $strict) { $in = strtolower($in ); $alphanums = "a-f"; }else{ $alphanums = "a-z"; } if(!preg_match("/^[0-9$alphanums]{8}-[0-9$alphanums]{4}-(?<version>[0-9$alphanums]{1})[0-9$alpha...
[ "protected", "function", "_isuuidversion", "(", "$", "in", ",", "$", "strict", "=", "true", ")", "{", "if", "(", "false", "!==", "$", "strict", ")", "{", "$", "in", "=", "strtolower", "(", "$", "in", ")", ";", "$", "alphanums", "=", "\"a-f\"", ";",...
returns UUID version or FALSE if no UUID format
[ "returns", "UUID", "version", "or", "FALSE", "if", "no", "UUID", "format" ]
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/valFormats.php#L892-L909
frdl/webfan
.ApplicationComposer/lib/webdof/valFormats.php
valFormats._camelcase2whitespace
protected function _camelcase2whitespace($camelCaseString, $space = " "){ $re = '/(?<=[a-z])(?=[A-Z])/x'; $a = preg_split($re, $camelCaseString); return join($a, $space); }
php
protected function _camelcase2whitespace($camelCaseString, $space = " "){ $re = '/(?<=[a-z])(?=[A-Z])/x'; $a = preg_split($re, $camelCaseString); return join($a, $space); }
[ "protected", "function", "_camelcase2whitespace", "(", "$", "camelCaseString", ",", "$", "space", "=", "\" \"", ")", "{", "$", "re", "=", "'/(?<=[a-z])(?=[A-Z])/x'", ";", "$", "a", "=", "preg_split", "(", "$", "re", ",", "$", "camelCaseString", ")", ";", "...
http://stackoverflow.com/questions/4519739/split-camelcase-word-into-words-with-php-preg-match-regular-expression Converts camelCase string to have spaces between each. @param $camelCaseString @return string
[ "http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "4519739", "/", "split", "-", "camelcase", "-", "word", "-", "into", "-", "words", "-", "with", "-", "php", "-", "preg", "-", "match", "-", "regular", "-", "expression", "Converts",...
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/valFormats.php#L1018-L1022
frdl/webfan
.ApplicationComposer/lib/webdof/valFormats.php
valFormats._ip2long
protected function _ip2long($ip, $getVersion = TRUE) { $version = $this->_isip($ip); if($getVersion === FALSE && $version === FALSE)return FALSE; if($getVersion === FALSE && $version === 'ipv4')return $this->_ip2long_v4($ip); if($getVersion === FALSE && $version === 'ipv6')return $this->_ip2long_v6($ip); ...
php
protected function _ip2long($ip, $getVersion = TRUE) { $version = $this->_isip($ip); if($getVersion === FALSE && $version === FALSE)return FALSE; if($getVersion === FALSE && $version === 'ipv4')return $this->_ip2long_v4($ip); if($getVersion === FALSE && $version === 'ipv6')return $this->_ip2long_v6($ip); ...
[ "protected", "function", "_ip2long", "(", "$", "ip", ",", "$", "getVersion", "=", "TRUE", ")", "{", "$", "version", "=", "$", "this", "->", "_isip", "(", "$", "ip", ")", ";", "if", "(", "$", "getVersion", "===", "FALSE", "&&", "$", "version", "==="...
IP Addresses... - php.net
[ "IP", "Addresses", "...", "-", "php", ".", "net" ]
train
https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/webdof/valFormats.php#L1038-L1050
WellCommerce/StandardEditionBundle
DataFixtures/ORM/LoadMediaData.php
LoadMediaData.load
public function load(ObjectManager $manager) { if (!$this->isEnabled()) { return; } $rootPath = $this->container->get('kernel')->getRootDir() . '/../web/themes/wellcommerce-default-theme/assets/products/'; $uploader = $this->container->get('media.uploader'); ...
php
public function load(ObjectManager $manager) { if (!$this->isEnabled()) { return; } $rootPath = $this->container->get('kernel')->getRootDir() . '/../web/themes/wellcommerce-default-theme/assets/products/'; $uploader = $this->container->get('media.uploader'); ...
[ "public", "function", "load", "(", "ObjectManager", "$", "manager", ")", "{", "if", "(", "!", "$", "this", "->", "isEnabled", "(", ")", ")", "{", "return", ";", "}", "$", "rootPath", "=", "$", "this", "->", "container", "->", "get", "(", "'kernel'", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadMediaData.php#L44-L74
Baachi/CouchDB
src/CouchDB/Util/BatchUpdater.php
BatchUpdater.execute
public function execute() { $response = $this->client->request('POST', "/{$this->database->getName()}/_bulk_docs", [ 'body' => JSONEncoder::encode($this->data), 'headers' => ['Content-Type' => 'application/json'], ]); return JSONEncoder::decode((string) $response-...
php
public function execute() { $response = $this->client->request('POST', "/{$this->database->getName()}/_bulk_docs", [ 'body' => JSONEncoder::encode($this->data), 'headers' => ['Content-Type' => 'application/json'], ]); return JSONEncoder::decode((string) $response-...
[ "public", "function", "execute", "(", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'POST'", ",", "\"/{$this->database->getName()}/_bulk_docs\"", ",", "[", "'body'", "=>", "JSONEncoder", "::", "encode", "(", "$", "this", ...
Execute the queue. @return array
[ "Execute", "the", "queue", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Util/BatchUpdater.php#L77-L85
Humanized/yii2-location
models/nuts/NutsLocationSearch.php
NutsLocationSearch.search
public function search($params) { $this->load($params); $query = NutsLocation::find(); $query->where(['country_id'=>$this->country_id,'postcode'=>$this->postcode,]); $this->pageSize = 1; $dataProvider = new ActiveDataProvider([ 'query' => $query, 'p...
php
public function search($params) { $this->load($params); $query = NutsLocation::find(); $query->where(['country_id'=>$this->country_id,'postcode'=>$this->postcode,]); $this->pageSize = 1; $dataProvider = new ActiveDataProvider([ 'query' => $query, 'p...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "this", "->", "load", "(", "$", "params", ")", ";", "$", "query", "=", "NutsLocation", "::", "find", "(", ")", ";", "$", "query", "->", "where", "(", "[", "'country_id'", "=>", "$",...
Creates data provider instance with search query applied @param array $params @return ActiveDataProvider
[ "Creates", "data", "provider", "instance", "with", "search", "query", "applied" ]
train
https://github.com/Humanized/yii2-location/blob/48ac12ceab741fc4c82ac8e979415a11bf9175f2/models/nuts/NutsLocationSearch.php#L46-L70
NuclearCMS/Hierarchy
src/Support/migrations/2016_07_31_120003_HierarchyCreateNodesTable.php
HierarchyCreateNodesTable.up
public function up() { Schema::create('nodes', function (Blueprint $table) { $table->increments('id'); $table->integer('node_type_id')->unsigned(); $table->integer('user_id')->unsigned(); NestedSet::columns($table); $table->boolean('maili...
php
public function up() { Schema::create('nodes', function (Blueprint $table) { $table->increments('id'); $table->integer('node_type_id')->unsigned(); $table->integer('user_id')->unsigned(); NestedSet::columns($table); $table->boolean('maili...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "create", "(", "'nodes'", ",", "function", "(", "Blueprint", "$", "table", ")", "{", "$", "table", "->", "increments", "(", "'id'", ")", ";", "$", "table", "->", "integer", "(", "'node_type_id'...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/migrations/2016_07_31_120003_HierarchyCreateNodesTable.php#L14-L53
heidelpay/PhpDoc
src/phpDocumentor/Plugin/Scrybe/Template/Factory.php
Factory.get
public function get($name) { if (!isset($this->engines[$name])) { throw new \InvalidArgumentException('Template engine "'.$name.'" is not known or registered'); } return $this->engines[$name]; }
php
public function get($name) { if (!isset($this->engines[$name])) { throw new \InvalidArgumentException('Template engine "'.$name.'" is not known or registered'); } return $this->engines[$name]; }
[ "public", "function", "get", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "engines", "[", "$", "name", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Template engine \"'", ".", "$", "name", ...
Returns a new instance of the template engine belonging to the given name. @param string $name @throws \InvalidArgumentException if the given name is not registered @return TemplateInterface
[ "Returns", "a", "new", "instance", "of", "the", "template", "engine", "belonging", "to", "the", "given", "name", "." ]
train
https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Template/Factory.php#L66-L73
Josantonius/WP_Image
src/class-wp-image.php
WP_Image.save
public static function save( $url, $post_ID, $featured = false ) { $url = filter_var( $url, FILTER_VALIDATE_URL ); if ( false === $url || false === get_post_status( $post_ID ) ) { return false; } $filename = basename( $url ); $filepath = self::upload( $url, $filename ); $attachment = [ 'post_mime_...
php
public static function save( $url, $post_ID, $featured = false ) { $url = filter_var( $url, FILTER_VALIDATE_URL ); if ( false === $url || false === get_post_status( $post_ID ) ) { return false; } $filename = basename( $url ); $filepath = self::upload( $url, $filename ); $attachment = [ 'post_mime_...
[ "public", "static", "function", "save", "(", "$", "url", ",", "$", "post_ID", ",", "$", "featured", "=", "false", ")", "{", "$", "url", "=", "filter_var", "(", "$", "url", ",", "FILTER_VALIDATE_URL", ")", ";", "if", "(", "false", "===", "$", "url", ...
Save image and associate it with a specific post. @param string $url → external url image. @param int $post_ID → post id. @param boolean $featured → if image is featured. @return string|false → URI for an attachment file or false on failure.
[ "Save", "image", "and", "associate", "it", "with", "a", "specific", "post", "." ]
train
https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L31-L62
Josantonius/WP_Image
src/class-wp-image.php
WP_Image.upload
public static function upload( $url, $filename ) { $dir = wp_upload_dir(); if ( ! isset( $dir['path'], $dir['basedir'] ) ) { return false; } $path = wp_mkdir_p( $dir['path'] ) ? $dir['path'] : $dir['basedir']; $path = rtrim( $path, '/' ) . '/'; $image_data = @file_get_contents( $url ); if ( $image...
php
public static function upload( $url, $filename ) { $dir = wp_upload_dir(); if ( ! isset( $dir['path'], $dir['basedir'] ) ) { return false; } $path = wp_mkdir_p( $dir['path'] ) ? $dir['path'] : $dir['basedir']; $path = rtrim( $path, '/' ) . '/'; $image_data = @file_get_contents( $url ); if ( $image...
[ "public", "static", "function", "upload", "(", "$", "url", ",", "$", "filename", ")", "{", "$", "dir", "=", "wp_upload_dir", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "dir", "[", "'path'", "]", ",", "$", "dir", "[", "'basedir'", "]", ")",...
Upload image to WordPress upload directory. @since 1.0.2 @param string $url → external url image. @param string $filename → filename. @return string|false → path to upload image or false on failure.
[ "Upload", "image", "to", "WordPress", "upload", "directory", "." ]
train
https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L74-L92
Josantonius/WP_Image
src/class-wp-image.php
WP_Image.delete_all_attachment
public static function delete_all_attachment( $post_ID, $force = false ) { if ( get_post_status( $post_ID ) === false ) { return false; } $counter = 0; $attachments = get_posts( [ 'post_type' => 'attachment', 'posts_per_page' => 100, 'post_status' => 'any', 'post_mime_type' => '...
php
public static function delete_all_attachment( $post_ID, $force = false ) { if ( get_post_status( $post_ID ) === false ) { return false; } $counter = 0; $attachments = get_posts( [ 'post_type' => 'attachment', 'posts_per_page' => 100, 'post_status' => 'any', 'post_mime_type' => '...
[ "public", "static", "function", "delete_all_attachment", "(", "$", "post_ID", ",", "$", "force", "=", "false", ")", "{", "if", "(", "get_post_status", "(", "$", "post_ID", ")", "===", "false", ")", "{", "return", "false", ";", "}", "$", "counter", "=", ...
Deletes an attachment and all of its derivatives. @since 1.0.3 @param int $post_ID → post id. @param boolean $force → force deletion. @return int|false → attachments deleted.
[ "Deletes", "an", "attachment", "and", "all", "of", "its", "derivatives", "." ]
train
https://github.com/Josantonius/WP_Image/blob/59a2b7bb79db81e70d7b6c3eb3a5ce603c20e204/src/class-wp-image.php#L104-L129
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.delete
public function delete($id) { $this->fireEvent('deleting', [$id]); $deleted = $this->model->destroy($id); $this->fireEvent('deleted', [$id, $deleted]); return $deleted; }
php
public function delete($id) { $this->fireEvent('deleting', [$id]); $deleted = $this->model->destroy($id); $this->fireEvent('deleted', [$id, $deleted]); return $deleted; }
[ "public", "function", "delete", "(", "$", "id", ")", "{", "$", "this", "->", "fireEvent", "(", "'deleting'", ",", "[", "$", "id", "]", ")", ";", "$", "deleted", "=", "$", "this", "->", "model", "->", "destroy", "(", "$", "id", ")", ";", "$", "t...
Find and delete a resource by ID. @param int $id @return bool
[ "Find", "and", "delete", "a", "resource", "by", "ID", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L68-L77
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.getAll
public function getAll($orderBy = array('id', 'asc')) { list($column, $order) = $orderBy; return $this->newQuery()->orderBy($column, $order)->get(); }
php
public function getAll($orderBy = array('id', 'asc')) { list($column, $order) = $orderBy; return $this->newQuery()->orderBy($column, $order)->get(); }
[ "public", "function", "getAll", "(", "$", "orderBy", "=", "array", "(", "'id'", ",", "'asc'", ")", ")", "{", "list", "(", "$", "column", ",", "$", "order", ")", "=", "$", "orderBy", ";", "return", "$", "this", "->", "newQuery", "(", ")", "->", "o...
Get all resources. @param array $orderBy @return mixed
[ "Get", "all", "resources", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L117-L122
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.getAllPaginated
public function getAllPaginated($orderBy = array('id', 'asc'), $perPage = 25) { list($column, $order) = $orderBy; return $this->newQuery()->orderBy($column, $order)->paginate($perPage); }
php
public function getAllPaginated($orderBy = array('id', 'asc'), $perPage = 25) { list($column, $order) = $orderBy; return $this->newQuery()->orderBy($column, $order)->paginate($perPage); }
[ "public", "function", "getAllPaginated", "(", "$", "orderBy", "=", "array", "(", "'id'", ",", "'asc'", ")", ",", "$", "perPage", "=", "25", ")", "{", "list", "(", "$", "column", ",", "$", "order", ")", "=", "$", "orderBy", ";", "return", "$", "this...
Get all resources. @param array $orderBy @return mixed
[ "Get", "all", "resources", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L130-L135
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.store
public function store($request) { $this->fireEvent('creating', [$request]); $created = $this->model->create($request); $this->fireEvent('created', [$created]); return $created; }
php
public function store($request) { $this->fireEvent('creating', [$request]); $created = $this->model->create($request); $this->fireEvent('created', [$created]); return $created; }
[ "public", "function", "store", "(", "$", "request", ")", "{", "$", "this", "->", "fireEvent", "(", "'creating'", ",", "[", "$", "request", "]", ")", ";", "$", "created", "=", "$", "this", "->", "model", "->", "create", "(", "$", "request", ")", ";"...
Store a new resource. @param mixed $request @return mixed
[ "Store", "a", "new", "resource", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L143-L152
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.update
public function update($id, $request) { $this->fireEvent('updating', [$id, $request]); $updated = $this->find($id)->update($request); $this->fireEvent('updated', [$id, $updated]); return $updated; }
php
public function update($id, $request) { $this->fireEvent('updating', [$id, $request]); $updated = $this->find($id)->update($request); $this->fireEvent('updated', [$id, $updated]); return $updated; }
[ "public", "function", "update", "(", "$", "id", ",", "$", "request", ")", "{", "$", "this", "->", "fireEvent", "(", "'updating'", ",", "[", "$", "id", ",", "$", "request", "]", ")", ";", "$", "updated", "=", "$", "this", "->", "find", "(", "$", ...
Update an existing resource. @param int $id @param mixed $request @return mixed
[ "Update", "an", "existing", "resource", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L161-L170
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.with
public function with($relationships) { if (! is_array($relationships)) { $relationships = explode(', ', $relationships); } if (! in_array($relationships, $this->withRelationships)) { foreach ($relationships as $with) { $this->withRelationships[] = $wi...
php
public function with($relationships) { if (! is_array($relationships)) { $relationships = explode(', ', $relationships); } if (! in_array($relationships, $this->withRelationships)) { foreach ($relationships as $with) { $this->withRelationships[] = $wi...
[ "public", "function", "with", "(", "$", "relationships", ")", "{", "if", "(", "!", "is_array", "(", "$", "relationships", ")", ")", "{", "$", "relationships", "=", "explode", "(", "', '", ",", "$", "relationships", ")", ";", "}", "if", "(", "!", "in_...
Assign eager loading relationships. @param string|array $relationships @return AbstractEloquentRepository
[ "Assign", "eager", "loading", "relationships", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L178-L191
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.newQuery
protected function newQuery() { $query = $this->model->newQuery(); foreach ($this->withRelationships as $relationship) { $query->with($relationship); } return $query; }
php
protected function newQuery() { $query = $this->model->newQuery(); foreach ($this->withRelationships as $relationship) { $query->with($relationship); } return $query; }
[ "protected", "function", "newQuery", "(", ")", "{", "$", "query", "=", "$", "this", "->", "model", "->", "newQuery", "(", ")", ";", "foreach", "(", "$", "this", "->", "withRelationships", "as", "$", "relationship", ")", "{", "$", "query", "->", "with",...
Create a new newQuery instance with eager loaded relationships. @return newQuery
[ "Create", "a", "new", "newQuery", "instance", "with", "eager", "loaded", "relationships", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L232-L241
caffeinated/beverage
src/Repositories/AbstractEloquentRepository.php
AbstractEloquentRepository.fireEvent
protected function fireEvent($event, $data) { $fireableEvent = isset($this->fireEvents[$event]) ? $this->fireEvents[$event] : null; if (! is_null($fireableEvent)) { return $this->event->fire($fireableEvent, $data); } return null; }
php
protected function fireEvent($event, $data) { $fireableEvent = isset($this->fireEvents[$event]) ? $this->fireEvents[$event] : null; if (! is_null($fireableEvent)) { return $this->event->fire($fireableEvent, $data); } return null; }
[ "protected", "function", "fireEvent", "(", "$", "event", ",", "$", "data", ")", "{", "$", "fireableEvent", "=", "isset", "(", "$", "this", "->", "fireEvents", "[", "$", "event", "]", ")", "?", "$", "this", "->", "fireEvents", "[", "$", "event", "]", ...
Fire off an event if one is defined. @param string $event @param array $data @return mixed
[ "Fire", "off", "an", "event", "if", "one", "is", "defined", "." ]
train
https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Repositories/AbstractEloquentRepository.php#L250-L259
bpolaszek/simple-dbal
src/Model/Adapter/Mysqli/MysqliAsync.php
MysqliAsync.pollEvery
public static function pollEvery(float $wait) { if (false === strpos((string) $wait, '.')) { self::$sleep = (int) $wait; self::$usleep = 0; } else { list($seconds, $hundreds) = explode('.', (string) $wait); self::$sleep = (int) $seconds; se...
php
public static function pollEvery(float $wait) { if (false === strpos((string) $wait, '.')) { self::$sleep = (int) $wait; self::$usleep = 0; } else { list($seconds, $hundreds) = explode('.', (string) $wait); self::$sleep = (int) $seconds; se...
[ "public", "static", "function", "pollEvery", "(", "float", "$", "wait", ")", "{", "if", "(", "false", "===", "strpos", "(", "(", "string", ")", "$", "wait", ",", "'.'", ")", ")", "{", "self", "::", "$", "sleep", "=", "(", "int", ")", "$", "wait",...
Poll every $wait seconds. To poll every 100ms, call pollEvery(0.100). @param float $wait
[ "Poll", "every", "$wait", "seconds", ".", "To", "poll", "every", "100ms", "call", "pollEvery", "(", "0", ".", "100", ")", "." ]
train
https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/Mysqli/MysqliAsync.php#L64-L74
bpolaszek/simple-dbal
src/Model/Adapter/Mysqli/MysqliAsync.php
MysqliAsync.wait
private function wait() { do { if (empty($this->queries)) { break; } $links = $errors = $reject = []; foreach ($this->queries as $link) { $links[] = $errors[] = $reject[] = $link['l']; } if (!mysqli_poll(...
php
private function wait() { do { if (empty($this->queries)) { break; } $links = $errors = $reject = []; foreach ($this->queries as $link) { $links[] = $errors[] = $reject[] = $link['l']; } if (!mysqli_poll(...
[ "private", "function", "wait", "(", ")", "{", "do", "{", "if", "(", "empty", "(", "$", "this", "->", "queries", ")", ")", "{", "break", ";", "}", "$", "links", "=", "$", "errors", "=", "$", "reject", "=", "[", "]", ";", "foreach", "(", "$", "...
Wait for pending queries to complete.
[ "Wait", "for", "pending", "queries", "to", "complete", "." ]
train
https://github.com/bpolaszek/simple-dbal/blob/52cb50d326ba5854191814b470f5e84950ebb6e6/src/Model/Adapter/Mysqli/MysqliAsync.php#L106-L143
j-d/draggy
src/Draggy/Autocode/Templates/PHP/Symfony2/Repository.php
Repository.getFileLines
public function getFileLines() { $lines = []; $lines = array_merge($lines, $this->surroundDocumentationBlock($this->getRepositoryDocumentationLines())); $lines[] = 'class ' . $this->getEntity()->getName() . 'Repository extends EntityRepository'; $lines[] = '{'; $lines[] = ...
php
public function getFileLines() { $lines = []; $lines = array_merge($lines, $this->surroundDocumentationBlock($this->getRepositoryDocumentationLines())); $lines[] = 'class ' . $this->getEntity()->getName() . 'Repository extends EntityRepository'; $lines[] = '{'; $lines[] = ...
[ "public", "function", "getFileLines", "(", ")", "{", "$", "lines", "=", "[", "]", ";", "$", "lines", "=", "array_merge", "(", "$", "lines", ",", "$", "this", "->", "surroundDocumentationBlock", "(", "$", "this", "->", "getRepositoryDocumentationLines", "(", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/PHP/Symfony2/Repository.php#L102-L125
php-lug/lug
src/Component/Resource/Repository/Doctrine/ORM/Repository.php
Repository.findForIndex
public function findForIndex(array $criteria, array $orderBy = []) { return new Pagerfanta(new DoctrineORMAdapter( $this->buildQueryBuilder($criteria, $orderBy, true), true, true )); }
php
public function findForIndex(array $criteria, array $orderBy = []) { return new Pagerfanta(new DoctrineORMAdapter( $this->buildQueryBuilder($criteria, $orderBy, true), true, true )); }
[ "public", "function", "findForIndex", "(", "array", "$", "criteria", ",", "array", "$", "orderBy", "=", "[", "]", ")", "{", "return", "new", "Pagerfanta", "(", "new", "DoctrineORMAdapter", "(", "$", "this", "->", "buildQueryBuilder", "(", "$", "criteria", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/Repository.php#L49-L56
php-lug/lug
src/Component/Resource/Repository/Doctrine/ORM/Repository.php
Repository.findBy
public function findBy(array $criteria, array $orderBy = [], $limit = null, $offset = null) { $queryBuilder = $this->buildQueryBuilder($criteria, $orderBy); if ($limit !== null) { $queryBuilder->setMaxResults($limit); } if ($offset !== null) { $queryBuilder-...
php
public function findBy(array $criteria, array $orderBy = [], $limit = null, $offset = null) { $queryBuilder = $this->buildQueryBuilder($criteria, $orderBy); if ($limit !== null) { $queryBuilder->setMaxResults($limit); } if ($offset !== null) { $queryBuilder-...
[ "public", "function", "findBy", "(", "array", "$", "criteria", ",", "array", "$", "orderBy", "=", "[", "]", ",", "$", "limit", "=", "null", ",", "$", "offset", "=", "null", ")", "{", "$", "queryBuilder", "=", "$", "this", "->", "buildQueryBuilder", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/Repository.php#L93-L106
php-lug/lug
src/Component/Resource/Repository/Doctrine/ORM/Repository.php
Repository.createQueryBuilder
public function createQueryBuilder($alias = null, $indexBy = null) { return parent::createQueryBuilder($alias ?: $this->getAlias(), $indexBy); }
php
public function createQueryBuilder($alias = null, $indexBy = null) { return parent::createQueryBuilder($alias ?: $this->getAlias(), $indexBy); }
[ "public", "function", "createQueryBuilder", "(", "$", "alias", "=", "null", ",", "$", "indexBy", "=", "null", ")", "{", "return", "parent", "::", "createQueryBuilder", "(", "$", "alias", "?", ":", "$", "this", "->", "getAlias", "(", ")", ",", "$", "ind...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Repository/Doctrine/ORM/Repository.php#L111-L114
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.makeRoot
public function makeRoot($runValidation = true, $attributes = null) { $this->operation = self::OPERATION_MAKE_ROOT; return $this->owner->save($runValidation, $attributes); }
php
public function makeRoot($runValidation = true, $attributes = null) { $this->operation = self::OPERATION_MAKE_ROOT; return $this->owner->save($runValidation, $attributes); }
[ "public", "function", "makeRoot", "(", "$", "runValidation", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_MAKE_ROOT", ";", "return", "$", "this", "->", "owner", "->", "save", "(...
Creates the root node if the active record is new or moves it as the root node. @param boolean $runValidation @param array $attributes @return boolean
[ "Creates", "the", "root", "node", "if", "the", "active", "record", "is", "new", "or", "moves", "it", "as", "the", "root", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L88-L92
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.prependTo
public function prependTo($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_PREPEND_TO; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
php
public function prependTo($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_PREPEND_TO; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
[ "public", "function", "prependTo", "(", "$", "node", ",", "$", "runValidation", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_PREPEND_TO", ";", "$", "this", "->", "node", "=", ...
Creates a node as the first child of the target node if the active record is new or moves it as the first child of the target node. @param ActiveRecord $node @param boolean $runValidation @param array $attributes @return boolean
[ "Creates", "a", "node", "as", "the", "first", "child", "of", "the", "target", "node", "if", "the", "active", "record", "is", "new", "or", "moves", "it", "as", "the", "first", "child", "of", "the", "target", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L102-L107
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.appendTo
public function appendTo($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_APPEND_TO; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
php
public function appendTo($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_APPEND_TO; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
[ "public", "function", "appendTo", "(", "$", "node", ",", "$", "runValidation", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_APPEND_TO", ";", "$", "this", "->", "node", "=", "$...
Creates a node as the last child of the target node if the active record is new or moves it as the last child of the target node. @param ActiveRecord $node @param boolean $runValidation @param array $attributes @return boolean
[ "Creates", "a", "node", "as", "the", "last", "child", "of", "the", "target", "node", "if", "the", "active", "record", "is", "new", "or", "moves", "it", "as", "the", "last", "child", "of", "the", "target", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L117-L122
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.insertBefore
public function insertBefore($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_INSERT_BEFORE; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
php
public function insertBefore($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_INSERT_BEFORE; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
[ "public", "function", "insertBefore", "(", "$", "node", ",", "$", "runValidation", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_INSERT_BEFORE", ";", "$", "this", "->", "node", "...
Creates a node as the previous sibling of the target node if the active record is new or moves it as the previous sibling of the target node. @param ActiveRecord $node @param boolean $runValidation @param array $attributes @return boolean
[ "Creates", "a", "node", "as", "the", "previous", "sibling", "of", "the", "target", "node", "if", "the", "active", "record", "is", "new", "or", "moves", "it", "as", "the", "previous", "sibling", "of", "the", "target", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L132-L137
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.insertAfter
public function insertAfter($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_INSERT_AFTER; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
php
public function insertAfter($node, $runValidation = true, $attributes = null) { $this->operation = self::OPERATION_INSERT_AFTER; $this->node = $node; return $this->owner->save($runValidation, $attributes); }
[ "public", "function", "insertAfter", "(", "$", "node", ",", "$", "runValidation", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_INSERT_AFTER", ";", "$", "this", "->", "node", "="...
Creates a node as the next sibling of the target node if the active record is new or moves it as the next sibling of the target node. @param ActiveRecord $node @param boolean $runValidation @param array $attributes @return boolean
[ "Creates", "a", "node", "as", "the", "next", "sibling", "of", "the", "target", "node", "if", "the", "active", "record", "is", "new", "or", "moves", "it", "as", "the", "next", "sibling", "of", "the", "target", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L147-L152
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.deleteWithChildren
public function deleteWithChildren() { $this->operation = self::OPERATION_DELETE_WITH_CHILDREN; try { return $this->deleteWithChildrenInternal(); } catch (\Exception $e) { throw $e; } }
php
public function deleteWithChildren() { $this->operation = self::OPERATION_DELETE_WITH_CHILDREN; try { return $this->deleteWithChildrenInternal(); } catch (\Exception $e) { throw $e; } }
[ "public", "function", "deleteWithChildren", "(", ")", "{", "$", "this", "->", "operation", "=", "self", "::", "OPERATION_DELETE_WITH_CHILDREN", ";", "try", "{", "return", "$", "this", "->", "deleteWithChildrenInternal", "(", ")", ";", "}", "catch", "(", "\\", ...
}
[ "}" ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L185-L193
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.parents
public function parents($depth = null) { $condition = [ 'and', [$this->leftAttribute => ['$lt' => $this->owner->getAttribute($this->leftAttribute)]], [$this->rightAttribute => ['$gt' => $this->owner->getAttribute($this->rightAttribute)]], ]; if ($depth...
php
public function parents($depth = null) { $condition = [ 'and', [$this->leftAttribute => ['$lt' => $this->owner->getAttribute($this->leftAttribute)]], [$this->rightAttribute => ['$gt' => $this->owner->getAttribute($this->rightAttribute)]], ]; if ($depth...
[ "public", "function", "parents", "(", "$", "depth", "=", "null", ")", "{", "$", "condition", "=", "[", "'and'", ",", "[", "$", "this", "->", "leftAttribute", "=>", "[", "'$lt'", "=>", "$", "this", "->", "owner", "->", "getAttribute", "(", "$", "this"...
Gets the parents of the node. @param integer|null $depth the depth @return \yii\db\ActiveQuery
[ "Gets", "the", "parents", "of", "the", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L223-L237
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.leaves
public function leaves() { $condition = [ 'and', [$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]], [$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]], ['$where' => "this.{$this->rightAt...
php
public function leaves() { $condition = [ 'and', [$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]], [$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]], ['$where' => "this.{$this->rightAt...
[ "public", "function", "leaves", "(", ")", "{", "$", "condition", "=", "[", "'and'", ",", "[", "$", "this", "->", "leftAttribute", "=>", "[", "'$gt'", "=>", "$", "this", "->", "owner", "->", "getAttribute", "(", "$", "this", "->", "leftAttribute", ")", ...
Gets the leaves of the node. @return \yii\db\ActiveQuery
[ "Gets", "the", "leaves", "of", "the", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L264-L275
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.prev
public function prev() { $condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1]; $this->applyTreeAttributeCondition($condition); return $this->owner->find()->andWhere($condition); }
php
public function prev() { $condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1]; $this->applyTreeAttributeCondition($condition); return $this->owner->find()->andWhere($condition); }
[ "public", "function", "prev", "(", ")", "{", "$", "condition", "=", "[", "$", "this", "->", "rightAttribute", "=>", "$", "this", "->", "owner", "->", "getAttribute", "(", "$", "this", "->", "leftAttribute", ")", "-", "1", "]", ";", "$", "this", "->",...
Gets the previous sibling of the node. @return \yii\db\ActiveQuery
[ "Gets", "the", "previous", "sibling", "of", "the", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L281-L286
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.isChildOf
public function isChildOf($node) { $result = $this->owner->getAttribute($this->leftAttribute) > $node->getAttribute($this->leftAttribute) && $this->owner->getAttribute($this->rightAttribute) < $node->getAttribute($this->rightAttribute); if ($result && $this->treeAttribute !== false) { $...
php
public function isChildOf($node) { $result = $this->owner->getAttribute($this->leftAttribute) > $node->getAttribute($this->leftAttribute) && $this->owner->getAttribute($this->rightAttribute) < $node->getAttribute($this->rightAttribute); if ($result && $this->treeAttribute !== false) { $...
[ "public", "function", "isChildOf", "(", "$", "node", ")", "{", "$", "result", "=", "$", "this", "->", "owner", "->", "getAttribute", "(", "$", "this", "->", "leftAttribute", ")", ">", "$", "node", "->", "getAttribute", "(", "$", "this", "->", "leftAttr...
Determines whether the node is child of the parent node. @param ActiveRecord $node the parent node @return boolean whether the node is child of the parent node
[ "Determines", "whether", "the", "node", "is", "child", "of", "the", "parent", "node", "." ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L312-L320
letyii/yii2-mongo-nested-set
NestedSetsBehavior.php
NestedSetsBehavior.buildTreeHtml
public function buildTreeHtml($keys = [], $items = [], $config = [], $selected = []) { $configDefault = [ 'id' => 'nestable', 'class' => 'dd', 'containerClass' => 'dd-list', 'itemClass' => 'dd-item', 'labelClass' => 'dd-handle', 'act...
php
public function buildTreeHtml($keys = [], $items = [], $config = [], $selected = []) { $configDefault = [ 'id' => 'nestable', 'class' => 'dd', 'containerClass' => 'dd-list', 'itemClass' => 'dd-item', 'labelClass' => 'dd-handle', 'act...
[ "public", "function", "buildTreeHtml", "(", "$", "keys", "=", "[", "]", ",", "$", "items", "=", "[", "]", ",", "$", "config", "=", "[", "]", ",", "$", "selected", "=", "[", "]", ")", "{", "$", "configDefault", "=", "[", "'id'", "=>", "'nestable'"...
Build tree html @param type $keys @param type $items @param type $config @return string HTML
[ "Build", "tree", "html" ]
train
https://github.com/letyii/yii2-mongo-nested-set/blob/cb88a2e8665c62192a013cd7b1cbcd53148f0ec5/NestedSetsBehavior.php#L718-L777
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.fetchData
protected function fetchData( $filename, $useApc = false ) { if ( $useApc === true ) { $data = $this->backend->fetch( $filename ); return ( is_object( $data ) ) ? $data->data : false; } else { return ( include $filename ); } }
php
protected function fetchData( $filename, $useApc = false ) { if ( $useApc === true ) { $data = $this->backend->fetch( $filename ); return ( is_object( $data ) ) ? $data->data : false; } else { return ( include $filename ); } }
[ "protected", "function", "fetchData", "(", "$", "filename", ",", "$", "useApc", "=", "false", ")", "{", "if", "(", "$", "useApc", "===", "true", ")", "{", "$", "data", "=", "$", "this", "->", "backend", "->", "fetch", "(", "$", "filename", ")", ";"...
Fetches the data from the cache. @param string $filename The ID/filename from where to fetch the object @param bool $useApc Use APC or the file system @return mixed The fetched data or false on failure
[ "Fetches", "the", "data", "from", "the", "cache", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L56-L67
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.fetchObject
protected function fetchObject( $filename ) { $data = $this->backend->fetch( $filename ); return ( is_object( $data ) ) ? $data : false; }
php
protected function fetchObject( $filename ) { $data = $this->backend->fetch( $filename ); return ( is_object( $data ) ) ? $data : false; }
[ "protected", "function", "fetchObject", "(", "$", "filename", ")", "{", "$", "data", "=", "$", "this", "->", "backend", "->", "fetch", "(", "$", "filename", ")", ";", "return", "(", "is_object", "(", "$", "data", ")", ")", "?", "$", "data", ":", "f...
Fetches the object from the cache. @param string $filename The ID/filename from where to fetch the data @return mixed The fetched object or false on failure
[ "Fetches", "the", "object", "from", "the", "cache", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L75-L79
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.prepareData
protected function prepareData( $data, $useApc = false ) { if ( $useApc === true ) { if ( is_resource( $data ) ) { throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) ); } return new ezcCacheSt...
php
protected function prepareData( $data, $useApc = false ) { if ( $useApc === true ) { if ( is_resource( $data ) ) { throw new ezcCacheInvalidDataException( gettype( $data ), array( 'simple', 'array', 'object' ) ); } return new ezcCacheSt...
[ "protected", "function", "prepareData", "(", "$", "data", ",", "$", "useApc", "=", "false", ")", "{", "if", "(", "$", "useApc", "===", "true", ")", "{", "if", "(", "is_resource", "(", "$", "data", ")", ")", "{", "throw", "new", "ezcCacheInvalidDataExce...
Wraps the data in order to be stored in APC ($useApc = true) or on the file system ($useApc = false). @throws ezcCacheInvalidDataException If the data submitted can not be handled by this storage (object, resource). @param mixed $data Simple type or array @param bool $useApc Use APC or not @return mixed Prepared data
[ "Wraps", "the", "data", "in", "order", "to", "be", "stored", "in", "APC", "(", "$useApc", "=", "true", ")", "or", "on", "the", "file", "system", "(", "$useApc", "=", "false", ")", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L93-L112
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.store
public function store( $id, $data, $attributes = array() ) { // Generates the identifier $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes ); // Purges the Registry Cache if ( isset( $this->registry[$filename] ) ) { unset( $t...
php
public function store( $id, $data, $attributes = array() ) { // Generates the identifier $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes ); // Purges the Registry Cache if ( isset( $this->registry[$filename] ) ) { unset( $t...
[ "public", "function", "store", "(", "$", "id", ",", "$", "data", ",", "$", "attributes", "=", "array", "(", ")", ")", "{", "// Generates the identifier", "$", "filename", "=", "$", "this", "->", "properties", "[", "'location'", "]", ".", "$", "this", "...
Stores data to the cache storage. @throws ezcBaseFilePermissionException If the directory to store the cache file could not be created. This exception means most likely that your cache directory has been corrupted by external influences (file permission change). @throws ezcBaseFileIoException If an error occured while...
[ "Stores", "data", "to", "the", "cache", "storage", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L139-L199
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.restore
public function restore( $id, $attributes = array(), $search = false ) { // Generates the identifier $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes ); // Grabs the data object from the APC $dataObj = $this->fetchObject( $filename ); $...
php
public function restore( $id, $attributes = array(), $search = false ) { // Generates the identifier $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes ); // Grabs the data object from the APC $dataObj = $this->fetchObject( $filename ); $...
[ "public", "function", "restore", "(", "$", "id", ",", "$", "attributes", "=", "array", "(", ")", ",", "$", "search", "=", "false", ")", "{", "// Generates the identifier", "$", "filename", "=", "$", "this", "->", "properties", "[", "'location'", "]", "."...
Restores the data from the cache. @param string $id The item ID to restore @param array(string=>string) $attributes Attributes describing the data to restore @param bool $search Whether to search for items if not found directly @return mixed The cached data on success, otherwise false
[ "Restores", "the", "data", "from", "the", "cache", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L209-L333
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.delete
public function delete( $id = null, $attributes = array(), $search = false ) { $location = $this->properties['location']; // Generates the identifier $filename = $location . $this->generateIdentifier( $id, $attributes ); // Initializes the array $delFiles = array(); ...
php
public function delete( $id = null, $attributes = array(), $search = false ) { $location = $this->properties['location']; // Generates the identifier $filename = $location . $this->generateIdentifier( $id, $attributes ); // Initializes the array $delFiles = array(); ...
[ "public", "function", "delete", "(", "$", "id", "=", "null", ",", "$", "attributes", "=", "array", "(", ")", ",", "$", "search", "=", "false", ")", "{", "$", "location", "=", "$", "this", "->", "properties", "[", "'location'", "]", ";", "// Generates...
Deletes the data associated with $id or $attributes from the cache. @throws ezcBaseFilePermissionException If an already existsing cache file could not be unlinked. This exception means most likely that your cache directory has been corrupted by external influences (file permission change). @param string $id The item...
[ "Deletes", "the", "data", "associated", "with", "$id", "or", "$attributes", "from", "the", "cache", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L348-L400
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.validateLocation
protected function validateLocation() { if ( file_exists( $this->properties['location'] ) === false ) { throw new ezcBaseFileNotFoundException( $this->properties['location'], 'cache location' ); } if ( is_dir( $this->properties['location'] ) === false ) { ...
php
protected function validateLocation() { if ( file_exists( $this->properties['location'] ) === false ) { throw new ezcBaseFileNotFoundException( $this->properties['location'], 'cache location' ); } if ( is_dir( $this->properties['location'] ) === false ) { ...
[ "protected", "function", "validateLocation", "(", ")", "{", "if", "(", "file_exists", "(", "$", "this", "->", "properties", "[", "'location'", "]", ")", "===", "false", ")", "{", "throw", "new", "ezcBaseFileNotFoundException", "(", "$", "this", "->", "proper...
Checks the path in the location property exists, and is read-/writable. It throws an exception if not. @throws ezcBaseFileNotFoundException If the storage location does not exist. This should usually not happen, since {@link ezcCacheManager::createCache()} already performs sanity checks for the cache location. In case...
[ "Checks", "the", "path", "in", "the", "location", "property", "exists", "and", "is", "read", "-", "/", "writable", ".", "It", "throws", "an", "exception", "if", "not", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L425-L441
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php
ezcCacheStorageFileApcArray.calcLifetime
protected function calcLifetime( $filename, $useApc = false ) { $ttl = $this->options->ttl; // Calculate when the APC object was created if ( $useApc === true ) { // we've likely already looked this thing up in APC, so we'll grab the local object if ( isset( $...
php
protected function calcLifetime( $filename, $useApc = false ) { $ttl = $this->options->ttl; // Calculate when the APC object was created if ( $useApc === true ) { // we've likely already looked this thing up in APC, so we'll grab the local object if ( isset( $...
[ "protected", "function", "calcLifetime", "(", "$", "filename", ",", "$", "useApc", "=", "false", ")", "{", "$", "ttl", "=", "$", "this", "->", "options", "->", "ttl", ";", "// Calculate when the APC object was created", "if", "(", "$", "useApc", "===", "true...
Calculates the lifetime remaining for a cache object. If the TTL option is set to false, this method will always return 1 for existing items. @param string $filename The file to calculate the remaining lifetime for @param bool $useApc Use APC or not @return int The remaining lifetime in seconds (0 if no time remainin...
[ "Calculates", "the", "lifetime", "remaining", "for", "a", "cache", "object", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/apc/apc_array.php#L453-L508