id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
1,200
consolle/framework
src/Foundation/Application.php
Application.storagePath
public function storagePath() { if ($this->storagePath) return $this->storagePath; return $this->storagePath ?: $this->rootPath() . DIRECTORY_SEPARATOR . 'storage'; }
php
public function storagePath() { if ($this->storagePath) return $this->storagePath; return $this->storagePath ?: $this->rootPath() . DIRECTORY_SEPARATOR . 'storage'; }
[ "public", "function", "storagePath", "(", ")", "{", "if", "(", "$", "this", "->", "storagePath", ")", "return", "$", "this", "->", "storagePath", ";", "return", "$", "this", "->", "storagePath", "?", ":", "$", "this", "->", "rootPath", "(", ")", ".", ...
Get the path to the application configuration files. @return string
[ "Get", "the", "path", "to", "the", "application", "configuration", "files", "." ]
2799921d6983f31e775099eac116c337bbe29c74
https://github.com/consolle/framework/blob/2799921d6983f31e775099eac116c337bbe29c74/src/Foundation/Application.php#L288-L293
1,201
AnonymPHP/Anonym-Library
src/Anonym/Html/Form/BuildCsrfField.php
BuildCsrfField.createCsrfField
public function createCsrfField() { $fieldName = Config::get('security.csrf.field_name'); $input = new Input($this->form->expression('input'), [ 'name' => $fieldName, 'value' => $this->createToken(), 'type' => 'hidden' ]); return $input->execute(...
php
public function createCsrfField() { $fieldName = Config::get('security.csrf.field_name'); $input = new Input($this->form->expression('input'), [ 'name' => $fieldName, 'value' => $this->createToken(), 'type' => 'hidden' ]); return $input->execute(...
[ "public", "function", "createCsrfField", "(", ")", "{", "$", "fieldName", "=", "Config", "::", "get", "(", "'security.csrf.field_name'", ")", ";", "$", "input", "=", "new", "Input", "(", "$", "this", "->", "form", "->", "expression", "(", "'input'", ")", ...
create csrf token field @return mixed
[ "create", "csrf", "token", "field" ]
c967ad804f84e8fb204593a0959cda2fed5ae075
https://github.com/AnonymPHP/Anonym-Library/blob/c967ad804f84e8fb204593a0959cda2fed5ae075/src/Anonym/Html/Form/BuildCsrfField.php#L38-L49
1,202
calgamo/util
src/MacroProcessor.php
MacroProcessor.process
public function process(string $string, int $strategy = EnumMacroProcessStorategy::STRATEGY_LAST) { // find and replce macro $ret = $string; $replace_exists = false; $keyword_list = self::findMacroKeywords($ret); foreach($keyword_list as $keyword){ $replace = $thi...
php
public function process(string $string, int $strategy = EnumMacroProcessStorategy::STRATEGY_LAST) { // find and replce macro $ret = $string; $replace_exists = false; $keyword_list = self::findMacroKeywords($ret); foreach($keyword_list as $keyword){ $replace = $thi...
[ "public", "function", "process", "(", "string", "$", "string", ",", "int", "$", "strategy", "=", "EnumMacroProcessStorategy", "::", "STRATEGY_LAST", ")", "{", "// find and replce macro", "$", "ret", "=", "$", "string", ";", "$", "replace_exists", "=", "false", ...
Expand string by macro keyword @param string $string @param int $strategy @return string
[ "Expand", "string", "by", "macro", "keyword" ]
13ef5caf3d4cce423854a0cb8fb8010c0d40326a
https://github.com/calgamo/util/blob/13ef5caf3d4cce423854a0cb8fb8010c0d40326a/src/MacroProcessor.php#L130-L146
1,203
calgamo/util
src/MacroProcessor.php
MacroProcessor.checkIfReplaceIncludeMacro
private function checkIfReplaceIncludeMacro(string $replace) : bool { $keyword_list = self::findMacroKeywords($replace); foreach($keyword_list as $keyword){ $replace = $this->callHandlers($keyword, EnumMacroProcessStorategy::STRATEGY_FISRT); if ($replace !== null){ ...
php
private function checkIfReplaceIncludeMacro(string $replace) : bool { $keyword_list = self::findMacroKeywords($replace); foreach($keyword_list as $keyword){ $replace = $this->callHandlers($keyword, EnumMacroProcessStorategy::STRATEGY_FISRT); if ($replace !== null){ ...
[ "private", "function", "checkIfReplaceIncludeMacro", "(", "string", "$", "replace", ")", ":", "bool", "{", "$", "keyword_list", "=", "self", "::", "findMacroKeywords", "(", "$", "replace", ")", ";", "foreach", "(", "$", "keyword_list", "as", "$", "keyword", ...
Check if replace string has macro @param string $replace @return bool
[ "Check", "if", "replace", "string", "has", "macro" ]
13ef5caf3d4cce423854a0cb8fb8010c0d40326a
https://github.com/calgamo/util/blob/13ef5caf3d4cce423854a0cb8fb8010c0d40326a/src/MacroProcessor.php#L155-L165
1,204
calgamo/util
src/MacroProcessor.php
MacroProcessor.callHandlers
private function callHandlers(string $keyword, int $strategy) { if ($this->handlers) { $stack = null; foreach($this->handlers as $handler){ $replace = $handler($keyword); if (!is_null($replace)){ if ($strategy === EnumMacroP...
php
private function callHandlers(string $keyword, int $strategy) { if ($this->handlers) { $stack = null; foreach($this->handlers as $handler){ $replace = $handler($keyword); if (!is_null($replace)){ if ($strategy === EnumMacroP...
[ "private", "function", "callHandlers", "(", "string", "$", "keyword", ",", "int", "$", "strategy", ")", "{", "if", "(", "$", "this", "->", "handlers", ")", "{", "$", "stack", "=", "null", ";", "foreach", "(", "$", "this", "->", "handlers", "as", "$",...
Callback all handlers @param string $keyword @param int $strategy @return bool|string
[ "Callback", "all", "handlers" ]
13ef5caf3d4cce423854a0cb8fb8010c0d40326a
https://github.com/calgamo/util/blob/13ef5caf3d4cce423854a0cb8fb8010c0d40326a/src/MacroProcessor.php#L192-L211
1,205
donbidon/core
src/Bootstrap.php
Bootstrap.initByPath
public static function initByPath( $path, array $options = [ 'registry' => Recursive::ALL_INCLUSIVE, ] ) { if (!file_exists($path) || !is_readable($path)) { throw new RuntimeException( sprintf("Cannot open config file \"%s\"", $path), ...
php
public static function initByPath( $path, array $options = [ 'registry' => Recursive::ALL_INCLUSIVE, ] ) { if (!file_exists($path) || !is_readable($path)) { throw new RuntimeException( sprintf("Cannot open config file \"%s\"", $path), ...
[ "public", "static", "function", "initByPath", "(", "$", "path", ",", "array", "$", "options", "=", "[", "'registry'", "=>", "Recursive", "::", "ALL_INCLUSIVE", ",", "]", ")", "{", "if", "(", "!", "file_exists", "(", "$", "path", ")", "||", "!", "is_rea...
Initializes environment by config file path. @param string $path @param array $options Array of options: - (int)registry - see Recursive::__construct(). @return I_Registry @throws RuntimeException If passed file doesn't exist or cannot be read. @throws RuntimeException If cannot parse config file.
[ "Initializes", "environment", "by", "config", "file", "path", "." ]
a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe
https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Bootstrap.php#L131-L155
1,206
donbidon/core
src/Bootstrap.php
Bootstrap.initByArray
public static function initByArray( array $config, array $options = [ 'registry' => Recursive::ALL_INCLUSIVE, ] ) { if (!is_array($config)) { throw new InvalidArgumentException( sprintf( "Passed argument isn't array (%s...
php
public static function initByArray( array $config, array $options = [ 'registry' => Recursive::ALL_INCLUSIVE, ] ) { if (!is_array($config)) { throw new InvalidArgumentException( sprintf( "Passed argument isn't array (%s...
[ "public", "static", "function", "initByArray", "(", "array", "$", "config", ",", "array", "$", "options", "=", "[", "'registry'", "=>", "Recursive", "::", "ALL_INCLUSIVE", ",", "]", ")", "{", "if", "(", "!", "is_array", "(", "$", "config", ")", ")", "{...
Initializes environment by config array. @param array $config @param array $options Array of options: - (int)registry - see Recursive::__construct(). @return I_Registry @throws InvalidArgumentException
[ "Initializes", "environment", "by", "config", "array", "." ]
a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe
https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Bootstrap.php#L166-L194
1,207
LaBlog/LaBlog
src/Lablog/Lablog/Category/FileCategory.php
FileCategory.exists
public function exists($category) { $ds = DIRECTORY_SEPARATOR; $path = app_path().$ds.'lablog'.$ds.$category; if ($this->fs->isDirectory($path)) { return true; } return false; }
php
public function exists($category) { $ds = DIRECTORY_SEPARATOR; $path = app_path().$ds.'lablog'.$ds.$category; if ($this->fs->isDirectory($path)) { return true; } return false; }
[ "public", "function", "exists", "(", "$", "category", ")", "{", "$", "ds", "=", "DIRECTORY_SEPARATOR", ";", "$", "path", "=", "app_path", "(", ")", ".", "$", "ds", ".", "'lablog'", ".", "$", "ds", ".", "$", "category", ";", "if", "(", "$", "this", ...
Check if a given category exists or not. @param string $path @return boolean
[ "Check", "if", "a", "given", "category", "exists", "or", "not", "." ]
d23f7848bd9a3993cbb5913d967626e9914a009c
https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/Lablog/Lablog/Category/FileCategory.php#L21-L31
1,208
LaBlog/LaBlog
src/Lablog/Lablog/Category/FileCategory.php
FileCategory.getSubCategories
public function getSubCategories($category) { $ds = DIRECTORY_SEPARATOR; $categoryPath = str_replace('/', $ds, $category); $basePath = app_path().$ds.'lablog'.$ds; $path = $basePath.$categoryPath; if (!$this->exists($category)) { return array(); } ...
php
public function getSubCategories($category) { $ds = DIRECTORY_SEPARATOR; $categoryPath = str_replace('/', $ds, $category); $basePath = app_path().$ds.'lablog'.$ds; $path = $basePath.$categoryPath; if (!$this->exists($category)) { return array(); } ...
[ "public", "function", "getSubCategories", "(", "$", "category", ")", "{", "$", "ds", "=", "DIRECTORY_SEPARATOR", ";", "$", "categoryPath", "=", "str_replace", "(", "'/'", ",", "$", "ds", ",", "$", "category", ")", ";", "$", "basePath", "=", "app_path", "...
Get a given categories sub categories. @param string $category @return array
[ "Get", "a", "given", "categories", "sub", "categories", "." ]
d23f7848bd9a3993cbb5913d967626e9914a009c
https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/Lablog/Lablog/Category/FileCategory.php#L38-L61
1,209
LaBlog/LaBlog
src/Lablog/Lablog/Category/FileCategory.php
FileCategory.getCategory
public function getCategory($category) { $ds = DIRECTORY_SEPARATOR; $categoryPath = str_replace('/', $ds, $category); $path = app_path().$ds.'lablog'.$ds.$categoryPath; if (!$this->exists($category)) { return (object) array(); } $categoryExplode = explo...
php
public function getCategory($category) { $ds = DIRECTORY_SEPARATOR; $categoryPath = str_replace('/', $ds, $category); $path = app_path().$ds.'lablog'.$ds.$categoryPath; if (!$this->exists($category)) { return (object) array(); } $categoryExplode = explo...
[ "public", "function", "getCategory", "(", "$", "category", ")", "{", "$", "ds", "=", "DIRECTORY_SEPARATOR", ";", "$", "categoryPath", "=", "str_replace", "(", "'/'", ",", "$", "ds", ",", "$", "category", ")", ";", "$", "path", "=", "app_path", "(", ")"...
Get a given category information. @param string $category @return void
[ "Get", "a", "given", "category", "information", "." ]
d23f7848bd9a3993cbb5913d967626e9914a009c
https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/Lablog/Lablog/Category/FileCategory.php#L68-L94
1,210
plinker-rpc/cron
src/lib/CronFileWriter.php
CronFileWriter.create
public function create($delim = '#', $data = PHP_EOL) { //first check for existing then update if ($this->read($delim)) { $this->update($delim, $data); } else { //create new entry file_put_contents( $this->file, PHP_EOL.'# '...
php
public function create($delim = '#', $data = PHP_EOL) { //first check for existing then update if ($this->read($delim)) { $this->update($delim, $data); } else { //create new entry file_put_contents( $this->file, PHP_EOL.'# '...
[ "public", "function", "create", "(", "$", "delim", "=", "'#'", ",", "$", "data", "=", "PHP_EOL", ")", "{", "//first check for existing then update", "if", "(", "$", "this", "->", "read", "(", "$", "delim", ")", ")", "{", "$", "this", "->", "update", "(...
Create or update an entry in the .htaccess file @param string $data @param string $delim
[ "Create", "or", "update", "an", "entry", "in", "the", ".", "htaccess", "file" ]
af1bd1258a22b8333239654e0cb3c371f1eda42d
https://github.com/plinker-rpc/cron/blob/af1bd1258a22b8333239654e0cb3c371f1eda42d/src/lib/CronFileWriter.php#L58-L71
1,211
plinker-rpc/cron
src/lib/CronFileWriter.php
CronFileWriter.read
public function read($delim = '#') { $file = file_get_contents($this->file); $delim = preg_quote($delim); if (preg_match("/#\s$delim\s(.*?)\s#\s\\\\$delim/s", $file, $matches)) { return trim($matches[1]); } else { return false; } }
php
public function read($delim = '#') { $file = file_get_contents($this->file); $delim = preg_quote($delim); if (preg_match("/#\s$delim\s(.*?)\s#\s\\\\$delim/s", $file, $matches)) { return trim($matches[1]); } else { return false; } }
[ "public", "function", "read", "(", "$", "delim", "=", "'#'", ")", "{", "$", "file", "=", "file_get_contents", "(", "$", "this", "->", "file", ")", ";", "$", "delim", "=", "preg_quote", "(", "$", "delim", ")", ";", "if", "(", "preg_match", "(", "\"/...
Read entry from .htaccess file @param string $delim @return mixed (bool|string)
[ "Read", "entry", "from", ".", "htaccess", "file" ]
af1bd1258a22b8333239654e0cb3c371f1eda42d
https://github.com/plinker-rpc/cron/blob/af1bd1258a22b8333239654e0cb3c371f1eda42d/src/lib/CronFileWriter.php#L79-L89
1,212
plinker-rpc/cron
src/lib/CronFileWriter.php
CronFileWriter.update
public function update($delim = '#', $data = PHP_EOL) { $data = str_replace( array('$1','$2','$3','$4','$5'), array('\$1','\$2','\$3','\$4','\$5'), $data ); $delim = preg_quote($delim); file_put_contents( $this->file, trim...
php
public function update($delim = '#', $data = PHP_EOL) { $data = str_replace( array('$1','$2','$3','$4','$5'), array('\$1','\$2','\$3','\$4','\$5'), $data ); $delim = preg_quote($delim); file_put_contents( $this->file, trim...
[ "public", "function", "update", "(", "$", "delim", "=", "'#'", ",", "$", "data", "=", "PHP_EOL", ")", "{", "$", "data", "=", "str_replace", "(", "array", "(", "'$1'", ",", "'$2'", ",", "'$3'", ",", "'$4'", ",", "'$5'", ")", ",", "array", "(", "'\...
Update entry in .htaccess file @param string $data @param string $delim
[ "Update", "entry", "in", ".", "htaccess", "file" ]
af1bd1258a22b8333239654e0cb3c371f1eda42d
https://github.com/plinker-rpc/cron/blob/af1bd1258a22b8333239654e0cb3c371f1eda42d/src/lib/CronFileWriter.php#L97-L117
1,213
plinker-rpc/cron
src/lib/CronFileWriter.php
CronFileWriter.delete
public function delete($delim = '#') { $file = file_get_contents($this->file); $delim = preg_quote($delim); if (preg_match("/#\s$delim\s(.*?)\s#\s\\\\$delim/s", $file, $matches)) { file_put_contents( $this->file, str_replace(PHP_EOL.$matches[0].PH...
php
public function delete($delim = '#') { $file = file_get_contents($this->file); $delim = preg_quote($delim); if (preg_match("/#\s$delim\s(.*?)\s#\s\\\\$delim/s", $file, $matches)) { file_put_contents( $this->file, str_replace(PHP_EOL.$matches[0].PH...
[ "public", "function", "delete", "(", "$", "delim", "=", "'#'", ")", "{", "$", "file", "=", "file_get_contents", "(", "$", "this", "->", "file", ")", ";", "$", "delim", "=", "preg_quote", "(", "$", "delim", ")", ";", "if", "(", "preg_match", "(", "\...
Delete entry from .htaccess file @param string $delim @return bool
[ "Delete", "entry", "from", ".", "htaccess", "file" ]
af1bd1258a22b8333239654e0cb3c371f1eda42d
https://github.com/plinker-rpc/cron/blob/af1bd1258a22b8333239654e0cb3c371f1eda42d/src/lib/CronFileWriter.php#L125-L139
1,214
Dhii/tokenizer-abstract
src/TokenizerAwareTrait.php
TokenizerAwareTrait._setTokenizer
protected function _setTokenizer($tokenizer) { if ($tokenizer !== null && !($tokenizer instanceof TokenizerInterface)) { throw $this->_createInvalidArgumentException($this->__('Invalid tokenizer'), null, null, $tokenizer); } $this->tokenizer = $tokenizer; }
php
protected function _setTokenizer($tokenizer) { if ($tokenizer !== null && !($tokenizer instanceof TokenizerInterface)) { throw $this->_createInvalidArgumentException($this->__('Invalid tokenizer'), null, null, $tokenizer); } $this->tokenizer = $tokenizer; }
[ "protected", "function", "_setTokenizer", "(", "$", "tokenizer", ")", "{", "if", "(", "$", "tokenizer", "!==", "null", "&&", "!", "(", "$", "tokenizer", "instanceof", "TokenizerInterface", ")", ")", "{", "throw", "$", "this", "->", "_createInvalidArgumentExcep...
Assigns a tokenizer to this instance. @since [*next-version*] @param TokenizerInterface|null $tokenizer The tokenizer.
[ "Assigns", "a", "tokenizer", "to", "this", "instance", "." ]
45588113b1fca6daf62b776aade8627d08970565
https://github.com/Dhii/tokenizer-abstract/blob/45588113b1fca6daf62b776aade8627d08970565/src/TokenizerAwareTrait.php#L41-L48
1,215
MarHue/cms-migration-tool
app/Console/Commands/CMSMigrationTool.php
CMSMigrationTool.chooseCMS
protected function chooseCMS($availableInputSystems, $availableOutputSystems) { $this->info("\n************************************************"); $this->info("\n********* CMS Migration Manager ************"); $this->info("\n************************************************"); $...
php
protected function chooseCMS($availableInputSystems, $availableOutputSystems) { $this->info("\n************************************************"); $this->info("\n********* CMS Migration Manager ************"); $this->info("\n************************************************"); $...
[ "protected", "function", "chooseCMS", "(", "$", "availableInputSystems", ",", "$", "availableOutputSystems", ")", "{", "$", "this", "->", "info", "(", "\"\\n************************************************\"", ")", ";", "$", "this", "->", "info", "(", "\"\\n********* ...
Starts Console Menu, Asks User to choose Input and Output CMS, returns array with the two integer @return array
[ "Starts", "Console", "Menu", "Asks", "User", "to", "choose", "Input", "and", "Output", "CMS", "returns", "array", "with", "the", "two", "integer" ]
1c285a7673f4ef3ca20818d7c7b807c630aabd46
https://github.com/MarHue/cms-migration-tool/blob/1c285a7673f4ef3ca20818d7c7b807c630aabd46/app/Console/Commands/CMSMigrationTool.php#L35-L46
1,216
MarHue/cms-migration-tool
app/Console/Commands/CMSMigrationTool.php
CMSMigrationTool.getInputAndOutputDisk
protected function getInputAndOutputDisk() { $validInputPath = FALSE; $validOutputPath = FALSE; //runs as long as user enters valid input root path while(!$validInputPath){ $goBack = FALSE; $rootInput = $this->choice('Which input disk?', array_keys(config('fi...
php
protected function getInputAndOutputDisk() { $validInputPath = FALSE; $validOutputPath = FALSE; //runs as long as user enters valid input root path while(!$validInputPath){ $goBack = FALSE; $rootInput = $this->choice('Which input disk?', array_keys(config('fi...
[ "protected", "function", "getInputAndOutputDisk", "(", ")", "{", "$", "validInputPath", "=", "FALSE", ";", "$", "validOutputPath", "=", "FALSE", ";", "//runs as long as user enters valid input root path", "while", "(", "!", "$", "validInputPath", ")", "{", "$", "goB...
Asks User to enter Root-Path of Input and Output CMS @return array with the two strings
[ "Asks", "User", "to", "enter", "Root", "-", "Path", "of", "Input", "and", "Output", "CMS" ]
1c285a7673f4ef3ca20818d7c7b807c630aabd46
https://github.com/MarHue/cms-migration-tool/blob/1c285a7673f4ef3ca20818d7c7b807c630aabd46/app/Console/Commands/CMSMigrationTool.php#L52-L104
1,217
liftkit/core
src/Loader/File/Script.php
Script.load
public function load ($path, $data = array()) { extract($data); $fullPath = $this->transformPath($path); if (is_file($fullPath)) { return include($fullPath); } else { throw new NonexistentFileException('Script not found: ' . $fullPath); } }
php
public function load ($path, $data = array()) { extract($data); $fullPath = $this->transformPath($path); if (is_file($fullPath)) { return include($fullPath); } else { throw new NonexistentFileException('Script not found: ' . $fullPath); } }
[ "public", "function", "load", "(", "$", "path", ",", "$", "data", "=", "array", "(", ")", ")", "{", "extract", "(", "$", "data", ")", ";", "$", "fullPath", "=", "$", "this", "->", "transformPath", "(", "$", "path", ")", ";", "if", "(", "is_file",...
Includes a PHP file and returns any result returned by the file. @api @param string $path Path to file. Beware that this is not an absolute path if you set the basePath or suffix in the constructor. @param array $data An associative array of variables to be injected into the file. @return mixed @throws NonexistentF...
[ "Includes", "a", "PHP", "file", "and", "returns", "any", "result", "returned", "by", "the", "file", "." ]
c98dcffa65450bd11332dbffe2064650c3a72aae
https://github.com/liftkit/core/blob/c98dcffa65450bd11332dbffe2064650c3a72aae/src/Loader/File/Script.php#L38-L48
1,218
webriq/core
module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php
ContentController.editAction
public function editAction() { $params = $this->params(); $request = $this->getRequest(); $locator = $this->getServiceLocator(); $model = $locator->get( 'Grid\Paragraph\Model\Paragraph\Model' ) ->setLocale( $this->getAdminLocale() ); ...
php
public function editAction() { $params = $this->params(); $request = $this->getRequest(); $locator = $this->getServiceLocator(); $model = $locator->get( 'Grid\Paragraph\Model\Paragraph\Model' ) ->setLocale( $this->getAdminLocale() ); ...
[ "public", "function", "editAction", "(", ")", "{", "$", "params", "=", "$", "this", "->", "params", "(", ")", ";", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "$", "locator", "=", "$", "this", "->", "getServiceLocator", "(", ...
Edit a content
[ "Edit", "a", "content" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php#L31-L122
1,219
webriq/core
module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php
ContentController.cloneAction
public function cloneAction() { if ( ! $this->getPermissionsModel() ->isAllowed( 'paragraph.content', 'create' ) ) { $this->getResponse() ->setStatusCode( 403 ); return; } $params = $this->params(); $locator ...
php
public function cloneAction() { if ( ! $this->getPermissionsModel() ->isAllowed( 'paragraph.content', 'create' ) ) { $this->getResponse() ->setStatusCode( 403 ); return; } $params = $this->params(); $locator ...
[ "public", "function", "cloneAction", "(", ")", "{", "if", "(", "!", "$", "this", "->", "getPermissionsModel", "(", ")", "->", "isAllowed", "(", "'paragraph.content'", ",", "'create'", ")", ")", "{", "$", "this", "->", "getResponse", "(", ")", "->", "setS...
Clone a content
[ "Clone", "a", "content" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php#L127-L199
1,220
webriq/core
module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php
ContentController.deleteAction
public function deleteAction() { $params = $this->params(); $locator = $this->getServiceLocator(); $model = $locator->get( 'Grid\Paragraph\Model\Paragraph\Model' ); $paragraph = $model->find( $params->fromRoute( 'id' ) ); if ( empty( $paragraph ) || $paragraph->...
php
public function deleteAction() { $params = $this->params(); $locator = $this->getServiceLocator(); $model = $locator->get( 'Grid\Paragraph\Model\Paragraph\Model' ); $paragraph = $model->find( $params->fromRoute( 'id' ) ); if ( empty( $paragraph ) || $paragraph->...
[ "public", "function", "deleteAction", "(", ")", "{", "$", "params", "=", "$", "this", "->", "params", "(", ")", ";", "$", "locator", "=", "$", "this", "->", "getServiceLocator", "(", ")", ";", "$", "model", "=", "$", "locator", "->", "get", "(", "'...
Delete a content
[ "Delete", "a", "content" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Controller/ContentController.php#L204-L244
1,221
synapsestudios/synapse-base
src/Synapse/View/Migration/Create.php
Create.description
public function description($description = null) { if ($description === null) { return $this->description; } $this->description = $description; }
php
public function description($description = null) { if ($description === null) { return $this->description; } $this->description = $description; }
[ "public", "function", "description", "(", "$", "description", "=", "null", ")", "{", "if", "(", "$", "description", "===", "null", ")", "{", "return", "$", "this", "->", "description", ";", "}", "$", "this", "->", "description", "=", "$", "description", ...
Set or get the description of the migration @param string $description Migration description. If omitted, acts as a getter. @return string
[ "Set", "or", "get", "the", "description", "of", "the", "migration" ]
60c830550491742a077ab063f924e2f0b63825da
https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/View/Migration/Create.php#L39-L46
1,222
synapsestudios/synapse-base
src/Synapse/View/Migration/Create.php
Create.classname
public function classname($classname = null) { if ($classname === null) { return $this->classname; } $this->classname = $classname; }
php
public function classname($classname = null) { if ($classname === null) { return $this->classname; } $this->classname = $classname; }
[ "public", "function", "classname", "(", "$", "classname", "=", "null", ")", "{", "if", "(", "$", "classname", "===", "null", ")", "{", "return", "$", "this", "->", "classname", ";", "}", "$", "this", "->", "classname", "=", "$", "classname", ";", "}"...
Set or get the name of the migration class @param string $classname Name of the migration class. If omitted, acts as a getter. @return string
[ "Set", "or", "get", "the", "name", "of", "the", "migration", "class" ]
60c830550491742a077ab063f924e2f0b63825da
https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/View/Migration/Create.php#L54-L61
1,223
binsoul/common
src/Decorator.php
Decorator.setDecoratedObject
public function setDecoratedObject($decorated) { if (!is_object($decorated)) { throw new \InvalidArgumentException( sprintf( 'Expected an object but got an argument of type "%s" instead.', gettype($decorated) ) )...
php
public function setDecoratedObject($decorated) { if (!is_object($decorated)) { throw new \InvalidArgumentException( sprintf( 'Expected an object but got an argument of type "%s" instead.', gettype($decorated) ) )...
[ "public", "function", "setDecoratedObject", "(", "$", "decorated", ")", "{", "if", "(", "!", "is_object", "(", "$", "decorated", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'Expected an object but got an argument of type \"...
Sets the decorated object. @param object $decorated
[ "Sets", "the", "decorated", "object", "." ]
668a62dada22727c0b75e9484dce587d7a490889
https://github.com/binsoul/common/blob/668a62dada22727c0b75e9484dce587d7a490889/src/Decorator.php#L30-L42
1,224
zicht/z-plugin-lftp
lftp/Plugin.php
Plugin.parseFtpString
public function parseFtpString($ftpUrl) { if(is_null($this->ftpUsername)){ if(preg_match('/^(?:ftp:\/\/)?([^:]+):([^@]+)@(.*)$/',$ftpUrl,$matches)){ $this->ftpUsername = $matches[1]; $this->ftpPassword = $matches[2]; $this->ftpDomain = $matches[3...
php
public function parseFtpString($ftpUrl) { if(is_null($this->ftpUsername)){ if(preg_match('/^(?:ftp:\/\/)?([^:]+):([^@]+)@(.*)$/',$ftpUrl,$matches)){ $this->ftpUsername = $matches[1]; $this->ftpPassword = $matches[2]; $this->ftpDomain = $matches[3...
[ "public", "function", "parseFtpString", "(", "$", "ftpUrl", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "ftpUsername", ")", ")", "{", "if", "(", "preg_match", "(", "'/^(?:ftp:\\/\\/)?([^:]+):([^@]+)@(.*)$/'", ",", "$", "ftpUrl", ",", "$", "matche...
helper function to set local vars @param $ftpUrl @throws \Exception
[ "helper", "function", "to", "set", "local", "vars" ]
1d9f38de4945e1ba1709e42ca8f6d9abc8fbd840
https://github.com/zicht/z-plugin-lftp/blob/1d9f38de4945e1ba1709e42ca8f6d9abc8fbd840/lftp/Plugin.php#L50-L61
1,225
phossa2/libs
src/Phossa2/Query/Dialect/Mysql/Union.php
Union.buildUnion
protected function buildUnion( /*# string */ $prefix, array $settings )/*# : string */ { $clause = &$this->getClause('UNION'); $flat = $this->flatSettings($settings); $res = ''; foreach ($clause as $idx => $field) { $parts = []; $prefix = $idx...
php
protected function buildUnion( /*# string */ $prefix, array $settings )/*# : string */ { $clause = &$this->getClause('UNION'); $flat = $this->flatSettings($settings); $res = ''; foreach ($clause as $idx => $field) { $parts = []; $prefix = $idx...
[ "protected", "function", "buildUnion", "(", "/*# string */", "$", "prefix", ",", "array", "$", "settings", ")", "/*# : string */", "{", "$", "clause", "=", "&", "$", "this", "->", "getClause", "(", "'UNION'", ")", ";", "$", "flat", "=", "$", "this", "->"...
Build unioned SELECT @param string $prefix @param array $settings @return string @access protected
[ "Build", "unioned", "SELECT" ]
921e485c8cc29067f279da2cdd06f47a9bddd115
https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Query/Dialect/Mysql/Union.php#L72-L87
1,226
robertasproniu/tic-tac-toe-agent
src/TicTacToe.php
TicTacToe.makeMove
public function makeMove(array $boardState, $player = Game::PLAYER_A) { $this->setBoard($boardState); $recommendedMove = $this->getMove($player) ?: []; return $recommendedMove ? array_merge($recommendedMove , [$player]): []; }
php
public function makeMove(array $boardState, $player = Game::PLAYER_A) { $this->setBoard($boardState); $recommendedMove = $this->getMove($player) ?: []; return $recommendedMove ? array_merge($recommendedMove , [$player]): []; }
[ "public", "function", "makeMove", "(", "array", "$", "boardState", ",", "$", "player", "=", "Game", "::", "PLAYER_A", ")", "{", "$", "this", "->", "setBoard", "(", "$", "boardState", ")", ";", "$", "recommendedMove", "=", "$", "this", "->", "getMove", ...
Get move for a particular player @param array $boardState @param string $player @return array
[ "Get", "move", "for", "a", "particular", "player" ]
00bc8e31e3c9770f2ee24d97d82e40dff20e3e98
https://github.com/robertasproniu/tic-tac-toe-agent/blob/00bc8e31e3c9770f2ee24d97d82e40dff20e3e98/src/TicTacToe.php#L18-L25
1,227
dankempster/axstrad-test-bundle
Functional/AbstractAxstradKernel.php
AbstractAxstradKernel.registerContainerConfiguration
public function registerContainerConfiguration(LoaderInterface $loader) { $classInfo = new \ReflectionClass($this); $dir = dirname($classInfo->getFileName()); $loader->load($dir . '/config.yml'); }
php
public function registerContainerConfiguration(LoaderInterface $loader) { $classInfo = new \ReflectionClass($this); $dir = dirname($classInfo->getFileName()); $loader->load($dir . '/config.yml'); }
[ "public", "function", "registerContainerConfiguration", "(", "LoaderInterface", "$", "loader", ")", "{", "$", "classInfo", "=", "new", "\\", "ReflectionClass", "(", "$", "this", ")", ";", "$", "dir", "=", "dirname", "(", "$", "classInfo", "->", "getFileName", ...
Register container configuration @param LoaderInterface $loader Loader
[ "Register", "container", "configuration" ]
7b8272fd81fd97d493169657a1b9a8fdc6808e52
https://github.com/dankempster/axstrad-test-bundle/blob/7b8272fd81fd97d493169657a1b9a8fdc6808e52/Functional/AbstractAxstradKernel.php#L46-L51
1,228
atelierspierrot/library
src/Library/Helper/Code.php
Code.implementsInterface
public static function implementsInterface($class_name, $interface_name) { if (is_object($class_name)) { $class_name = get_class($class_name); } if (class_exists($class_name)) { $interfaces = class_implements($class_name); return (bool) in_array($interface...
php
public static function implementsInterface($class_name, $interface_name) { if (is_object($class_name)) { $class_name = get_class($class_name); } if (class_exists($class_name)) { $interfaces = class_implements($class_name); return (bool) in_array($interface...
[ "public", "static", "function", "implementsInterface", "(", "$", "class_name", ",", "$", "interface_name", ")", "{", "if", "(", "is_object", "(", "$", "class_name", ")", ")", "{", "$", "class_name", "=", "get_class", "(", "$", "class_name", ")", ";", "}", ...
Check if a class implements a certain interface @param string|object $class_name The class name to test or a full object of this class @param string $interface_name The interface name to test @return bool
[ "Check", "if", "a", "class", "implements", "a", "certain", "interface" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/Code.php#L87-L97
1,229
atelierspierrot/library
src/Library/Helper/Code.php
Code.extendsClass
public static function extendsClass($class_name, $mother_name) { if (is_object($class_name)) { $class_name = get_class($class_name); } if (class_exists($class_name)) { return (bool) is_subclass_of($class_name, $mother_name); } return false; }
php
public static function extendsClass($class_name, $mother_name) { if (is_object($class_name)) { $class_name = get_class($class_name); } if (class_exists($class_name)) { return (bool) is_subclass_of($class_name, $mother_name); } return false; }
[ "public", "static", "function", "extendsClass", "(", "$", "class_name", ",", "$", "mother_name", ")", "{", "if", "(", "is_object", "(", "$", "class_name", ")", ")", "{", "$", "class_name", "=", "get_class", "(", "$", "class_name", ")", ";", "}", "if", ...
Check if a class extends a certain class @param string|object $class_name The class name to test or a full object of this class @param string $mother_name The class name to extend @return bool
[ "Check", "if", "a", "class", "extends", "a", "certain", "class" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/Code.php#L107-L116
1,230
atelierspierrot/library
src/Library/Helper/Code.php
Code.isClassInstance
public static function isClassInstance($object, $class_name) { if (class_exists($class_name) && is_object($object)) { return (bool) ($object instanceof $class_name); } return false; }
php
public static function isClassInstance($object, $class_name) { if (class_exists($class_name) && is_object($object)) { return (bool) ($object instanceof $class_name); } return false; }
[ "public", "static", "function", "isClassInstance", "(", "$", "object", ",", "$", "class_name", ")", "{", "if", "(", "class_exists", "(", "$", "class_name", ")", "&&", "is_object", "(", "$", "object", ")", ")", "{", "return", "(", "bool", ")", "(", "$",...
Check if a an object is an instance of a class @param object $object @param string $class_name @return bool
[ "Check", "if", "a", "an", "object", "is", "an", "instance", "of", "a", "class" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/Code.php#L126-L132
1,231
atelierspierrot/library
src/Library/Helper/Code.php
Code.namespaceExists
public static function namespaceExists($namespace) { $namespace = trim($namespace, self::NAMESPACE_SEPARATOR); $namespace .= self::NAMESPACE_SEPARATOR; foreach (get_declared_classes() as $name) { if (strpos($name, $namespace) === 0) { return true; } ...
php
public static function namespaceExists($namespace) { $namespace = trim($namespace, self::NAMESPACE_SEPARATOR); $namespace .= self::NAMESPACE_SEPARATOR; foreach (get_declared_classes() as $name) { if (strpos($name, $namespace) === 0) { return true; } ...
[ "public", "static", "function", "namespaceExists", "(", "$", "namespace", ")", "{", "$", "namespace", "=", "trim", "(", "$", "namespace", ",", "self", "::", "NAMESPACE_SEPARATOR", ")", ";", "$", "namespace", ".=", "self", "::", "NAMESPACE_SEPARATOR", ";", "f...
Test if a namespace can be found in declared classes or via Composer autoloader if so This method will search concerned namespace in PHP declared classes namespaces and, if found, in a Composer namespaces mapping usually stored in `vendor/composer/autoload_namespaces.php`, searching for a directory that should contain...
[ "Test", "if", "a", "namespace", "can", "be", "found", "in", "declared", "classes", "or", "via", "Composer", "autoloader", "if", "so" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/Code.php#L161-L213
1,232
atelierspierrot/library
src/Library/Helper/Code.php
Code.fetchArguments
public static function fetchArguments($method_name = null, $arguments = null, $class_name = null, &$logs = array()) { $args_def = self::organizeArguments($method_name, $arguments, $class_name, $logs); if (!empty($class_name)) { if (is_callable(array($class_name, $method_name))) { ...
php
public static function fetchArguments($method_name = null, $arguments = null, $class_name = null, &$logs = array()) { $args_def = self::organizeArguments($method_name, $arguments, $class_name, $logs); if (!empty($class_name)) { if (is_callable(array($class_name, $method_name))) { ...
[ "public", "static", "function", "fetchArguments", "(", "$", "method_name", "=", "null", ",", "$", "arguments", "=", "null", ",", "$", "class_name", "=", "null", ",", "&", "$", "logs", "=", "array", "(", ")", ")", "{", "$", "args_def", "=", "self", ":...
Launch a function or class's method fetching it arguments according to its declaration @param string $method_name The method name @param mixed $arguments A set of arguments to fetch @param string $class_name The class name @param array $logs Will be filled with indexes `miss` with m...
[ "Launch", "a", "function", "or", "class", "s", "method", "fetching", "it", "arguments", "according", "to", "its", "declaration" ]
a2988a11370d13c7e0dc47f9d2d81c664c30b8dd
https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/Code.php#L226-L241
1,233
tomk79/php-excellent-db
php/create.php
create.get_physical_table_name
public function get_physical_table_name($table_name){ $prefix = $this->conf()->prefix; if( strlen($prefix) ){ $prefix = preg_replace('/\_*$/', '_', $prefix); } return $prefix.$table_name; }
php
public function get_physical_table_name($table_name){ $prefix = $this->conf()->prefix; if( strlen($prefix) ){ $prefix = preg_replace('/\_*$/', '_', $prefix); } return $prefix.$table_name; }
[ "public", "function", "get_physical_table_name", "(", "$", "table_name", ")", "{", "$", "prefix", "=", "$", "this", "->", "conf", "(", ")", "->", "prefix", ";", "if", "(", "strlen", "(", "$", "prefix", ")", ")", "{", "$", "prefix", "=", "preg_replace",...
getting table prefix @param string $table_name テーブル名 @return String Table Prefix
[ "getting", "table", "prefix" ]
deeacf64c090fc5647267a06f97c3fb60fdf8f68
https://github.com/tomk79/php-excellent-db/blob/deeacf64c090fc5647267a06f97c3fb60fdf8f68/php/create.php#L277-L283
1,234
dazarobbo/Cola
src/Database/MySQL/String.php
String.parse
public static function parse($object){ $len = \strlen($object); if(Number::between($len, MySQL::getConstant('CHAR_LEN_MIN'), MySQL::getConstant('CHAR_LEN_MAX'))){ return new static($len, static::CHAR); } else if(Number::between($len, MySQL::getConstant('VARCHAR_LEN_MIN'), MySQL::getConstant('VA...
php
public static function parse($object){ $len = \strlen($object); if(Number::between($len, MySQL::getConstant('CHAR_LEN_MIN'), MySQL::getConstant('CHAR_LEN_MAX'))){ return new static($len, static::CHAR); } else if(Number::between($len, MySQL::getConstant('VARCHAR_LEN_MIN'), MySQL::getConstant('VA...
[ "public", "static", "function", "parse", "(", "$", "object", ")", "{", "$", "len", "=", "\\", "strlen", "(", "$", "object", ")", ";", "if", "(", "Number", "::", "between", "(", "$", "len", ",", "MySQL", "::", "getConstant", "(", "'CHAR_LEN_MIN'", ")"...
Parse a string object to a MySQL string type Prefers VARCHARs over BLOBs @param mixed $object @return \static
[ "Parse", "a", "string", "object", "to", "a", "MySQL", "string", "type", "Prefers", "VARCHARs", "over", "BLOBs" ]
b101b73ebeb8a571345a303cbc75168f60d0e64f
https://github.com/dazarobbo/Cola/blob/b101b73ebeb8a571345a303cbc75168f60d0e64f/src/Database/MySQL/String.php#L44-L67
1,235
swoopaholic/Components
Routing/RouteProvider.php
RouteProvider.getRouteCollectionForRequest
public function getRouteCollectionForRequest(Request $request) { $slug = '/' . trim($request->getPathInfo(), '/'); $document = $this->repository->findOneBy(array('slug' => $slug)); $collection = new RouteCollection(); if ($document) { $controller = $this->templateContro...
php
public function getRouteCollectionForRequest(Request $request) { $slug = '/' . trim($request->getPathInfo(), '/'); $document = $this->repository->findOneBy(array('slug' => $slug)); $collection = new RouteCollection(); if ($document) { $controller = $this->templateContro...
[ "public", "function", "getRouteCollectionForRequest", "(", "Request", "$", "request", ")", "{", "$", "slug", "=", "'/'", ".", "trim", "(", "$", "request", "->", "getPathInfo", "(", ")", ",", "'/'", ")", ";", "$", "document", "=", "$", "this", "->", "re...
Finds routes that may potentially match the request. This may return a mixed list of class instances, but all routes returned must extend the core symfony route. The classes may also implement RouteObjectInterface to link to a content document. This method may not throw an exception based on implementation specific r...
[ "Finds", "routes", "that", "may", "potentially", "match", "the", "request", "." ]
a665248a4d3285dea936579a763b5a7ecfe62c4a
https://github.com/swoopaholic/Components/blob/a665248a4d3285dea936579a763b5a7ecfe62c4a/Routing/RouteProvider.php#L80-L101
1,236
gearphp/loop
Tick/AbstractTick.php
AbstractTick.catchException
protected function catchException(\Exception $e) { foreach ($this->onException as $call) { call_user_func_array($call, [$e]); } throw $e; }
php
protected function catchException(\Exception $e) { foreach ($this->onException as $call) { call_user_func_array($call, [$e]); } throw $e; }
[ "protected", "function", "catchException", "(", "\\", "Exception", "$", "e", ")", "{", "foreach", "(", "$", "this", "->", "onException", "as", "$", "call", ")", "{", "call_user_func_array", "(", "$", "call", ",", "[", "$", "e", "]", ")", ";", "}", "t...
Catch tick exception and throw it. @param \Exception $e @throws \Exception
[ "Catch", "tick", "exception", "and", "throw", "it", "." ]
53032b3e9f789b729744922c75e09b2a33845f90
https://github.com/gearphp/loop/blob/53032b3e9f789b729744922c75e09b2a33845f90/Tick/AbstractTick.php#L119-L126
1,237
FuturaSoft/Pabana
src/Parser/Ini.php
Ini.load
public function load($filename) { if (!file_exists($filename)) { throw new \Exception('Ini file "' . $filename . '" doesn\'t exist.'); return false; } $this->filename = $filename; return $this; }
php
public function load($filename) { if (!file_exists($filename)) { throw new \Exception('Ini file "' . $filename . '" doesn\'t exist.'); return false; } $this->filename = $filename; return $this; }
[ "public", "function", "load", "(", "$", "filename", ")", "{", "if", "(", "!", "file_exists", "(", "$", "filename", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Ini file \"'", ".", "$", "filename", ".", "'\" doesn\\'t exist.'", ")", ";", "retu...
Load INI file @since 1.0 @param string $filename File path. @return bool|$this
[ "Load", "INI", "file" ]
b3a95eeb976042ac2a393cc10755a7adbc164c24
https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Parser/Ini.php#L37-L45
1,238
calgamo/event-loop
src/EventContext.php
EventContext.pushEvent
public function pushEvent(string $name, $data = null) : Event { $event = new Event($name, $data); $this->queue->enqueue($event); return $event; }
php
public function pushEvent(string $name, $data = null) : Event { $event = new Event($name, $data); $this->queue->enqueue($event); return $event; }
[ "public", "function", "pushEvent", "(", "string", "$", "name", ",", "$", "data", "=", "null", ")", ":", "Event", "{", "$", "event", "=", "new", "Event", "(", "$", "name", ",", "$", "data", ")", ";", "$", "this", "->", "queue", "->", "enqueue", "(...
Add an event to event queue @param string $name @param mixed $data @return Event
[ "Add", "an", "event", "to", "event", "queue" ]
f85a9c153f2548a94ddc58334c001f241dd8f12d
https://github.com/calgamo/event-loop/blob/f85a9c153f2548a94ddc58334c001f241dd8f12d/src/EventContext.php#L62-L67
1,239
buybrain/nervus-php
src/Buybrain/Nervus/Adapter/TypedAdapter.php
TypedAdapter.addHandler
protected function addHandler(TypedHandler $handler) { $this->addHandlerTypes($handler); $this->handlers[] = $handler; return $this; }
php
protected function addHandler(TypedHandler $handler) { $this->addHandlerTypes($handler); $this->handlers[] = $handler; return $this; }
[ "protected", "function", "addHandler", "(", "TypedHandler", "$", "handler", ")", "{", "$", "this", "->", "addHandlerTypes", "(", "$", "handler", ")", ";", "$", "this", "->", "handlers", "[", "]", "=", "$", "handler", ";", "return", "$", "this", ";", "}...
Add a handler to the adapter. The handler's supported types will be added to the adapter's supported types. @param TypedHandler $handler @return $this
[ "Add", "a", "handler", "to", "the", "adapter", ".", "The", "handler", "s", "supported", "types", "will", "be", "added", "to", "the", "adapter", "s", "supported", "types", "." ]
96e00e30571b3ea4cf3494cd26c930ffa336c3bf
https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Adapter/TypedAdapter.php#L29-L34
1,240
buybrain/nervus-php
src/Buybrain/Nervus/Adapter/TypedAdapter.php
TypedAdapter.assignToHandlers
protected function assignToHandlers(array $objects) { $result = []; $perType = TypedUtils::groupByType($objects); foreach ($this->handlers as $handler) { $remainingTypes = array_keys($perType); $handlerTypes = $handler->getSupportedEntityTypes(); $useTypes...
php
protected function assignToHandlers(array $objects) { $result = []; $perType = TypedUtils::groupByType($objects); foreach ($this->handlers as $handler) { $remainingTypes = array_keys($perType); $handlerTypes = $handler->getSupportedEntityTypes(); $useTypes...
[ "protected", "function", "assignToHandlers", "(", "array", "$", "objects", ")", "{", "$", "result", "=", "[", "]", ";", "$", "perType", "=", "TypedUtils", "::", "groupByType", "(", "$", "objects", ")", ";", "foreach", "(", "$", "this", "->", "handlers", ...
Assign every entity to the first handler that supports it @param Typed[] $objects @return array tuples of [Handler, object[]]
[ "Assign", "every", "entity", "to", "the", "first", "handler", "that", "supports", "it" ]
96e00e30571b3ea4cf3494cd26c930ffa336c3bf
https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Adapter/TypedAdapter.php#L68-L91
1,241
buybrain/nervus-php
src/Buybrain/Nervus/Adapter/TypedAdapter.php
TypedAdapter.checkUnsupportedTypes
protected function checkUnsupportedTypes(array $objects) { if ($this->supportedTypes !== null) { $unsupportedTypes = array_diff(TypedUtils::uniqueTypes($objects), $this->supportedTypes); if (count($unsupportedTypes) > 0) { throw new Exception(sprintf( ...
php
protected function checkUnsupportedTypes(array $objects) { if ($this->supportedTypes !== null) { $unsupportedTypes = array_diff(TypedUtils::uniqueTypes($objects), $this->supportedTypes); if (count($unsupportedTypes) > 0) { throw new Exception(sprintf( ...
[ "protected", "function", "checkUnsupportedTypes", "(", "array", "$", "objects", ")", "{", "if", "(", "$", "this", "->", "supportedTypes", "!==", "null", ")", "{", "$", "unsupportedTypes", "=", "array_diff", "(", "TypedUtils", "::", "uniqueTypes", "(", "$", "...
Validate that all the entity types from a request are supported by this adapter @param Typed[] $objects
[ "Validate", "that", "all", "the", "entity", "types", "from", "a", "request", "are", "supported", "by", "this", "adapter" ]
96e00e30571b3ea4cf3494cd26c930ffa336c3bf
https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Adapter/TypedAdapter.php#L98-L110
1,242
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.table
final public function table($table, $getData = false, $dataType = null) { if (!empty($table)) { $this->from($table); //if getData; run getData; } return $this; }
php
final public function table($table, $getData = false, $dataType = null) { if (!empty($table)) { $this->from($table); //if getData; run getData; } return $this; }
[ "final", "public", "function", "table", "(", "$", "table", ",", "$", "getData", "=", "false", ",", "$", "dataType", "=", "null", ")", "{", "if", "(", "!", "empty", "(", "$", "table", ")", ")", "{", "$", "this", "->", "from", "(", "$", "table", ...
Specifies the table upon which a read or write query is performed @param string $table the table name with any prefix. e.g #__users @param boolean $getData if set to true, this method returns all stored data array @param mixed $dataType @return object TuiyoDatabase
[ "Specifies", "the", "table", "upon", "which", "a", "read", "or", "write", "query", "is", "performed" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L241-L249
1,243
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.traceTableAlias
final public function traceTableAlias($table) { if (is_array($table)) { foreach ($table as $t) { $this->traceTableAlias($t); } return; } // Does the string contain a comma? If so, we need to separate // the string into discreet st...
php
final public function traceTableAlias($table) { if (is_array($table)) { foreach ($table as $t) { $this->traceTableAlias($t); } return; } // Does the string contain a comma? If so, we need to separate // the string into discreet st...
[ "final", "public", "function", "traceTableAlias", "(", "$", "table", ")", "{", "if", "(", "is_array", "(", "$", "table", ")", ")", "{", "foreach", "(", "$", "table", "as", "$", "t", ")", "{", "$", "this", "->", "traceTableAlias", "(", "$", "t", ")"...
This method allows us to preserve and track table aliasis as we build the query statement @access private @param string $table the table name @return void
[ "This", "method", "allows", "us", "to", "preserve", "and", "track", "table", "aliasis", "as", "we", "build", "the", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L288-L315
1,244
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.identifiers
final public function identifiers($identifier) { // Convert tabs or multiple spaces into single spaces $identifier = preg_replace('/[\t ]+/', ' ', $identifier); // If the item has an alias declaration we remove it and set it aside. // Basically we remove everything to the right of t...
php
final public function identifiers($identifier) { // Convert tabs or multiple spaces into single spaces $identifier = preg_replace('/[\t ]+/', ' ', $identifier); // If the item has an alias declaration we remove it and set it aside. // Basically we remove everything to the right of t...
[ "final", "public", "function", "identifiers", "(", "$", "identifier", ")", "{", "// Convert tabs or multiple spaces into single spaces", "$", "identifier", "=", "preg_replace", "(", "'/[\\t ]+/'", ",", "' '", ",", "$", "identifier", ")", ";", "// If the item has an alia...
Helper method for modifying any indentifiers in the query @param string $identifier @access private @return string modified identifier e.g escaped, santized etc
[ "Helper", "method", "for", "modifying", "any", "indentifiers", "in", "the", "query" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L325-L345
1,245
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.orderBy
final public function orderBy($orderby, $direction = '') { if (strtolower($direction) == 'random') { $orderby = ''; // Random results want or don't need a field name $direction = $this->_randomKeyword; } elseif (trim($direction) != '') { $direction = (in_array(str...
php
final public function orderBy($orderby, $direction = '') { if (strtolower($direction) == 'random') { $orderby = ''; // Random results want or don't need a field name $direction = $this->_randomKeyword; } elseif (trim($direction) != '') { $direction = (in_array(str...
[ "final", "public", "function", "orderBy", "(", "$", "orderby", ",", "$", "direction", "=", "''", ")", "{", "if", "(", "strtolower", "(", "$", "direction", ")", "==", "'random'", ")", "{", "$", "orderby", "=", "''", ";", "// Random results want or don't nee...
Adds the ORDER BY clause to the query statement @param string $orderby @param string $direction @return ActiveRecord
[ "Adds", "the", "ORDER", "BY", "clause", "to", "the", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L354-L388
1,246
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.count
final public function count($table = '', $resetselect = true) { if (!empty($table)) { $this->traceTableAlias($table); $this->fromTable($table); } $sql = $this->compile($this->_countString . $this->identifiers('totalcount'), true); $statement = $this->DBO->pre...
php
final public function count($table = '', $resetselect = true) { if (!empty($table)) { $this->traceTableAlias($table); $this->fromTable($table); } $sql = $this->compile($this->_countString . $this->identifiers('totalcount'), true); $statement = $this->DBO->pre...
[ "final", "public", "function", "count", "(", "$", "table", "=", "''", ",", "$", "resetselect", "=", "true", ")", "{", "if", "(", "!", "empty", "(", "$", "table", ")", ")", "{", "$", "this", "->", "traceTableAlias", "(", "$", "table", ")", ";", "$...
Counts all the records in the specified table Or records which satisfy the compiled SQL statement @param string $table @return interger
[ "Counts", "all", "the", "records", "in", "the", "specified", "table", "Or", "records", "which", "satisfy", "the", "compiled", "SQL", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L442-L460
1,247
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.where
final public function where($key, $value = NULL, $type = 'AND', $escape = TRUE) { if (empty($key)) { return $this; } if (!is_array($key)) { if (is_null($value)) { //some values could be '' return $this; } $key = array($key => $...
php
final public function where($key, $value = NULL, $type = 'AND', $escape = TRUE) { if (empty($key)) { return $this; } if (!is_array($key)) { if (is_null($value)) { //some values could be '' return $this; } $key = array($key => $...
[ "final", "public", "function", "where", "(", "$", "key", ",", "$", "value", "=", "NULL", ",", "$", "type", "=", "'AND'", ",", "$", "escape", "=", "TRUE", ")", "{", "if", "(", "empty", "(", "$", "key", ")", ")", "{", "return", "$", "this", ";", ...
Adds a WHERE condition to the Query statement. NOTE, to change the operatory, append the desired operator to the key names for example use where('a >', 'b'); to add an a > b rule to the statement where( array('a >'=>'b','a <'='c') ); @param mixed $key string with a single field key or array of key value pairs @param ...
[ "Adds", "a", "WHERE", "condition", "to", "the", "Query", "statement", ".", "NOTE", "to", "change", "the", "operatory", "append", "the", "desired", "operator", "to", "the", "key", "names", "for", "example", "use" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L709-L754
1,248
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.hasOperator
final public function hasOperator($string) { $string = trim($string); //echo $string; $matches = array(); if (!preg_match("/(\<|>|!|=|is null|BETWEEN|is not null)/i", $string, $matches)) { return FALSE; } return TRUE; }
php
final public function hasOperator($string) { $string = trim($string); //echo $string; $matches = array(); if (!preg_match("/(\<|>|!|=|is null|BETWEEN|is not null)/i", $string, $matches)) { return FALSE; } return TRUE; }
[ "final", "public", "function", "hasOperator", "(", "$", "string", ")", "{", "$", "string", "=", "trim", "(", "$", "string", ")", ";", "//echo $string;", "$", "matches", "=", "array", "(", ")", ";", "if", "(", "!", "preg_match", "(", "\"/(\\<|>|!|=|is nul...
Searches for a standard MySQL operator in a specified string @access private @param string $string @return boolean true if found or FALSE if not found
[ "Searches", "for", "a", "standard", "MySQL", "operator", "in", "a", "specified", "string" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L763-L772
1,249
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.join
final public function join($table, $cond, $type = 'LEFT') { if ($type != '') { $type = strtoupper(trim($type)); if (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) { $type = ''; } else { $type .= '...
php
final public function join($table, $cond, $type = 'LEFT') { if ($type != '') { $type = strtoupper(trim($type)); if (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) { $type = ''; } else { $type .= '...
[ "final", "public", "function", "join", "(", "$", "table", ",", "$", "cond", ",", "$", "type", "=", "'LEFT'", ")", "{", "if", "(", "$", "type", "!=", "''", ")", "{", "$", "type", "=", "strtoupper", "(", "trim", "(", "$", "type", ")", ")", ";", ...
Adds a JOIN query statement @param string $table the table name @param string $cond The JOIN condition @param string $type The type of JOIN e.g LEFT, RIGHT etc. @return TuiyoDatabase
[ "Adds", "a", "JOIN", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L794-L827
1,250
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.getWhere
final public function getWhere($key, $values = NULL, $type = 'AND') { return $this->where($key, $values, $type); }
php
final public function getWhere($key, $values = NULL, $type = 'AND') { return $this->where($key, $values, $type); }
[ "final", "public", "function", "getWhere", "(", "$", "key", ",", "$", "values", "=", "NULL", ",", "$", "type", "=", "'AND'", ")", "{", "return", "$", "this", "->", "where", "(", "$", "key", ",", "$", "values", ",", "$", "type", ")", ";", "}" ]
Returns the result set from a compiled Query representing the where conditions. See {@method where} for a more controlled approach @param mixed $key string or array. see {@method where} @param string $values @param string $type , e.g AND, OR @return object TuiyoDatabaseResult
[ "Returns", "the", "result", "set", "from", "a", "compiled", "Query", "representing", "the", "where", "conditions", "." ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L882-L885
1,251
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.notIn
final public function notIn($key, $values) { if (empty($key) || empty($values)) { return $this; } if (!is_array($values)) { $values = array($values); } return $this->in($key, $values, TRUE); }
php
final public function notIn($key, $values) { if (empty($key) || empty($values)) { return $this; } if (!is_array($values)) { $values = array($values); } return $this->in($key, $values, TRUE); }
[ "final", "public", "function", "notIn", "(", "$", "key", ",", "$", "values", ")", "{", "if", "(", "empty", "(", "$", "key", ")", "||", "empty", "(", "$", "values", ")", ")", "{", "return", "$", "this", ";", "}", "if", "(", "!", "is_array", "(",...
adds a NOT IN clause to the statement @param string $key @param array $values @return ActiveRecord
[ "adds", "a", "NOT", "IN", "clause", "to", "the", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L894-L904
1,252
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.like
final public function like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') { if (!is_array($field)) { $field = array($field => $match); } foreach ($field as $k => $v) { $k = $this->identifiers($k); $prefix = (count($this->arrayLike) == 0) ...
php
final public function like($field, $match = '', $type = 'AND ', $side = 'both', $not = '') { if (!is_array($field)) { $field = array($field => $match); } foreach ($field as $k => $v) { $k = $this->identifiers($k); $prefix = (count($this->arrayLike) == 0) ...
[ "final", "public", "function", "like", "(", "$", "field", ",", "$", "match", "=", "''", ",", "$", "type", "=", "'AND '", ",", "$", "side", "=", "'both'", ",", "$", "not", "=", "''", ")", "{", "if", "(", "!", "is_array", "(", "$", "field", ")", ...
Adds a LIKE cluase to the query statement @param string $field @param string $match @param string $type @param string $side @param string $not @return ActiveRecord
[ "Adds", "a", "LIKE", "cluase", "to", "the", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L968-L994
1,253
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.notLike
final public function notLike($field, $match = '', $type = 'AND', $side = 'both') { return $this->like($field, $match, $type, $side, 'NOT'); }
php
final public function notLike($field, $match = '', $type = 'AND', $side = 'both') { return $this->like($field, $match, $type, $side, 'NOT'); }
[ "final", "public", "function", "notLike", "(", "$", "field", ",", "$", "match", "=", "''", ",", "$", "type", "=", "'AND'", ",", "$", "side", "=", "'both'", ")", "{", "return", "$", "this", "->", "like", "(", "$", "field", ",", "$", "match", ",", ...
Adds a NOT LIKE to the statement @param string $field @param string $match @param string $type @param string $side @return object ActiveRecord
[ "Adds", "a", "NOT", "LIKE", "to", "the", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1018-L1021
1,254
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.groupBy
final public function groupBy($by) { if (is_string($by)) { $by = explode(',', $by); } foreach ($by as $val) { $val = trim($val); if ($val != '') { $this->arrayGroupBy[] = $this->identifiers($val); if ($this->arrayCaching ...
php
final public function groupBy($by) { if (is_string($by)) { $by = explode(',', $by); } foreach ($by as $val) { $val = trim($val); if ($val != '') { $this->arrayGroupBy[] = $this->identifiers($val); if ($this->arrayCaching ...
[ "final", "public", "function", "groupBy", "(", "$", "by", ")", "{", "if", "(", "is_string", "(", "$", "by", ")", ")", "{", "$", "by", "=", "explode", "(", "','", ",", "$", "by", ")", ";", "}", "foreach", "(", "$", "by", "as", "$", "val", ")",...
Adds a group by clause to a query statement @param string $by @return ActiveRecord
[ "Adds", "a", "group", "by", "clause", "to", "a", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1029-L1048
1,255
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.distinct
final public function distinct($boolean = TRUE) { $this->arrayDistinct = (is_bool($boolean)) ? $boolean : TRUE; return $this; }
php
final public function distinct($boolean = TRUE) { $this->arrayDistinct = (is_bool($boolean)) ? $boolean : TRUE; return $this; }
[ "final", "public", "function", "distinct", "(", "$", "boolean", "=", "TRUE", ")", "{", "$", "this", "->", "arrayDistinct", "=", "(", "is_bool", "(", "$", "boolean", ")", ")", "?", "$", "boolean", ":", "TRUE", ";", "return", "$", "this", ";", "}" ]
Adds a distinct clause to a select query statement @param boolean $boolean @return ActiveRecord
[ "Adds", "a", "distinct", "clause", "to", "a", "select", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1056-L1060
1,256
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.having
final public function having($key, $value = '', $type = 'AND ', $escape = TRUE) { if (!is_array($key)) { $key = array($key => $value); } foreach ($key as $k => $v) { $prefix = (count($this->arrayHaving) == 0) ? '' : $type; if ($escape === TRUE) { ...
php
final public function having($key, $value = '', $type = 'AND ', $escape = TRUE) { if (!is_array($key)) { $key = array($key => $value); } foreach ($key as $k => $v) { $prefix = (count($this->arrayHaving) == 0) ? '' : $type; if ($escape === TRUE) { ...
[ "final", "public", "function", "having", "(", "$", "key", ",", "$", "value", "=", "''", ",", "$", "type", "=", "'AND '", ",", "$", "escape", "=", "TRUE", ")", "{", "if", "(", "!", "is_array", "(", "$", "key", ")", ")", "{", "$", "key", "=", "...
Adds a having clause to a query statement @param string $key @param mixed $value @param string $type @param boolean $escape @return ActiveRecord
[ "Adds", "a", "having", "clause", "to", "a", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1071-L1100
1,257
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.limit
final public function limit($value, $offset = '') { $this->arrayLimit = $value; if ($offset != '') { $this->arrayOffset = $offset; } return $this; }
php
final public function limit($value, $offset = '') { $this->arrayLimit = $value; if ($offset != '') { $this->arrayOffset = $offset; } return $this; }
[ "final", "public", "function", "limit", "(", "$", "value", ",", "$", "offset", "=", "''", ")", "{", "$", "this", "->", "arrayLimit", "=", "$", "value", ";", "if", "(", "$", "offset", "!=", "''", ")", "{", "$", "this", "->", "arrayOffset", "=", "$...
Adds a limit to the query statement @param interger $value @param interger $offset @return object ActiveRecord
[ "Adds", "a", "limit", "to", "the", "query", "statement" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1109-L1116
1,258
budkit/budkit-framework
src/Budkit/Datastore/Activerecord.php
Activerecord.prepare
final public function prepare() { $DB = $this->DBO; $QUERY = $this->compile(); //echo $QUERY; //Compile the query; $STATEMENT = $DB->prepare($QUERY); //Return the Result Object; return $STATEMENT; }
php
final public function prepare() { $DB = $this->DBO; $QUERY = $this->compile(); //echo $QUERY; //Compile the query; $STATEMENT = $DB->prepare($QUERY); //Return the Result Object; return $STATEMENT; }
[ "final", "public", "function", "prepare", "(", ")", "{", "$", "DB", "=", "$", "this", "->", "DBO", ";", "$", "QUERY", "=", "$", "this", "->", "compile", "(", ")", ";", "//echo $QUERY;", "//Compile the query;", "$", "STATEMENT", "=", "$", "DB", "->", ...
Runs a compiled Statement, i.e prepare @return object Statement
[ "Runs", "a", "compiled", "Statement", "i", ".", "e", "prepare" ]
0635061815fe07a8c63f9514b845d199b3c0d485
https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Activerecord.php#L1147-L1159
1,259
clacy-builders/xml-express-php
src/Markup.php
Markup.complexAttrib
public function complexAttrib($name, $value, $delimiter = ' ', $check = false) { $this->attributes->setComplexAttrib($name, $value, $delimiter, $check); return $this; }
php
public function complexAttrib($name, $value, $delimiter = ' ', $check = false) { $this->attributes->setComplexAttrib($name, $value, $delimiter, $check); return $this; }
[ "public", "function", "complexAttrib", "(", "$", "name", ",", "$", "value", ",", "$", "delimiter", "=", "' '", ",", "$", "check", "=", "false", ")", "{", "$", "this", "->", "attributes", "->", "setComplexAttrib", "(", "$", "name", ",", "$", "value", ...
Sets or appends to a composable attribute. @param string $name Name of the attribute. @param mixed $value One or more (array) values. @param string $delimiter The boundary string. @param boolean $check Whether multiple entries shall be removed or not. @return Xml
[ "Sets", "or", "appends", "to", "a", "composable", "attribute", "." ]
9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0
https://github.com/clacy-builders/xml-express-php/blob/9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0/src/Markup.php#L36-L40
1,260
clacy-builders/xml-express-php
src/Markup.php
Markup.booleanAttrib
public function booleanAttrib($name, $value = true, $comparisonAttribute = null) { $this->attributes->setBooleanAttrib($name, $value, $comparisonAttribute); return $this; }
php
public function booleanAttrib($name, $value = true, $comparisonAttribute = null) { $this->attributes->setBooleanAttrib($name, $value, $comparisonAttribute); return $this; }
[ "public", "function", "booleanAttrib", "(", "$", "name", ",", "$", "value", "=", "true", ",", "$", "comparisonAttribute", "=", "null", ")", "{", "$", "this", "->", "attributes", "->", "setBooleanAttrib", "(", "$", "name", ",", "$", "value", ",", "$", "...
Sets a boolean attribute, if applicable by comparing a value with the value of another attribute. @param string $name Name of the attribute. @param mixed $value Boolean or one or more (array) values. @param string $comparisonAttribute Name of the other attribute to compare with. ...
[ "Sets", "a", "boolean", "attribute", "if", "applicable", "by", "comparing", "a", "value", "with", "the", "value", "of", "another", "attribute", "." ]
9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0
https://github.com/clacy-builders/xml-express-php/blob/9c66fd640738b0e87b05047c3f3b8f1cba8aa7e0/src/Markup.php#L51-L55
1,261
digipolisgent/openbib-id-api
src/Value/Structure/Collection.php
Collection.fromXml
public static function fromXml(\DOMNodeList $xml) { $items = array(); foreach ($xml as $xmlTag) { $items[] = StringLiteral::create($xmlTag->textContent); } return new static($items); }
php
public static function fromXml(\DOMNodeList $xml) { $items = array(); foreach ($xml as $xmlTag) { $items[] = StringLiteral::create($xmlTag->textContent); } return new static($items); }
[ "public", "static", "function", "fromXml", "(", "\\", "DOMNodeList", "$", "xml", ")", "{", "$", "items", "=", "array", "(", ")", ";", "foreach", "(", "$", "xml", "as", "$", "xmlTag", ")", "{", "$", "items", "[", "]", "=", "StringLiteral", "::", "cr...
Builds a Collection object from XML. @param \DOMNodeList $xml The list of xml tags. @return Collection A Collection object.
[ "Builds", "a", "Collection", "object", "from", "XML", "." ]
79f58dec53a91f44333d10fa4ef79f85f31fc2de
https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/Structure/Collection.php#L38-L45
1,262
digipolisgent/openbib-id-api
src/Value/Structure/Collection.php
Collection.first
public function first() { $this->getIterator()->rewind(); return $this->getIterator()->count() ? $this->getIterator() ->current() : false; }
php
public function first() { $this->getIterator()->rewind(); return $this->getIterator()->count() ? $this->getIterator() ->current() : false; }
[ "public", "function", "first", "(", ")", "{", "$", "this", "->", "getIterator", "(", ")", "->", "rewind", "(", ")", ";", "return", "$", "this", "->", "getIterator", "(", ")", "->", "count", "(", ")", "?", "$", "this", "->", "getIterator", "(", ")",...
Gets the first item from the collection. @return StringLiteral|false The first item from the collection, false if the collection is empty.
[ "Gets", "the", "first", "item", "from", "the", "collection", "." ]
79f58dec53a91f44333d10fa4ef79f85f31fc2de
https://github.com/digipolisgent/openbib-id-api/blob/79f58dec53a91f44333d10fa4ef79f85f31fc2de/src/Value/Structure/Collection.php#L61-L66
1,263
PSESD/cascade-core-types
TypeIndividual/models/ObjectIndividual.php
ObjectIndividual.getPhotoEmail
public function getPhotoEmail() { $email = false; $emailType = Yii::$app->collectors['types']->getOne('EmailAddress'); if (empty($emailType->object)) { return false; } foreach ($this->children($emailType->object->primaryModel, ['where' => ['primary_child' => 1]]) ...
php
public function getPhotoEmail() { $email = false; $emailType = Yii::$app->collectors['types']->getOne('EmailAddress'); if (empty($emailType->object)) { return false; } foreach ($this->children($emailType->object->primaryModel, ['where' => ['primary_child' => 1]]) ...
[ "public", "function", "getPhotoEmail", "(", ")", "{", "$", "email", "=", "false", ";", "$", "emailType", "=", "Yii", "::", "$", "app", "->", "collectors", "[", "'types'", "]", "->", "getOne", "(", "'EmailAddress'", ")", ";", "if", "(", "empty", "(", ...
Get photo email. @return [[@doctodo return_type:getPhotoEmail]] [[@doctodo return_description:getPhotoEmail]]
[ "Get", "photo", "email", "." ]
5a2bc524bd89545f0f28230e34518c9f92e7db1f
https://github.com/PSESD/cascade-core-types/blob/5a2bc524bd89545f0f28230e34518c9f92e7db1f/TypeIndividual/models/ObjectIndividual.php#L130-L146
1,264
studyportals/Utils
src/XML.php
XML.loadSimpleXML
public static function loadSimpleXML($xml_file, $verify_dtd = true){ $options = ($verify_dtd ? LIBXML_DTDVALID : null); libxml_clear_errors(); $SimpleXML = @simplexml_load_file($xml_file, null, $options); $LibXMLError = libxml_get_last_error(); if($SimpleXML === false || $LibXMLError instanceof \LibXMLErro...
php
public static function loadSimpleXML($xml_file, $verify_dtd = true){ $options = ($verify_dtd ? LIBXML_DTDVALID : null); libxml_clear_errors(); $SimpleXML = @simplexml_load_file($xml_file, null, $options); $LibXMLError = libxml_get_last_error(); if($SimpleXML === false || $LibXMLError instanceof \LibXMLErro...
[ "public", "static", "function", "loadSimpleXML", "(", "$", "xml_file", ",", "$", "verify_dtd", "=", "true", ")", "{", "$", "options", "=", "(", "$", "verify_dtd", "?", "LIBXML_DTDVALID", ":", "null", ")", ";", "libxml_clear_errors", "(", ")", ";", "$", "...
Load and verify an XML-file using SimpleXML. <p>The optional second parameter {@link $verify_dtd} can be used to disable verification of the XML DTD upon loading. By default the DTD is verified.</p> <p>When an error occurs this methods throws a XMLException.</p> @param string $xml_file @param boolean $verify_dtd @re...
[ "Load", "and", "verify", "an", "XML", "-", "file", "using", "SimpleXML", "." ]
eab69ca10ce3261480164cf8108ae7020459c847
https://github.com/studyportals/Utils/blob/eab69ca10ce3261480164cf8108ae7020459c847/src/XML.php#L38-L66
1,265
marando/phpSOFA
src/Marando/IAU/iauGst00a.php
iauGst00a.Gst00a
public static function Gst00a($uta, $utb, $tta, $ttb) { $gmst00; $ee00a; $gst; $gmst00 = IAU::Gmst00($uta, $utb, $tta, $ttb); $ee00a = IAU::Ee00a($tta, $ttb); $gst = IAU::Anp($gmst00 + $ee00a); return $gst; }
php
public static function Gst00a($uta, $utb, $tta, $ttb) { $gmst00; $ee00a; $gst; $gmst00 = IAU::Gmst00($uta, $utb, $tta, $ttb); $ee00a = IAU::Ee00a($tta, $ttb); $gst = IAU::Anp($gmst00 + $ee00a); return $gst; }
[ "public", "static", "function", "Gst00a", "(", "$", "uta", ",", "$", "utb", ",", "$", "tta", ",", "$", "ttb", ")", "{", "$", "gmst00", ";", "$", "ee00a", ";", "$", "gst", ";", "$", "gmst00", "=", "IAU", "::", "Gmst00", "(", "$", "uta", ",", "...
- - - - - - - - - - i a u G s t 0 0 a - - - - - - - - - - Greenwich apparent sidereal time (consistent with IAU 2000 resolutions). This function is part of the International Astronomical Union's SOFA (Standards Of Fundamental Astronomy) software collection. Status: canonical model. Given: uta,utb double UT1 ...
[ "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "i", "a", "u", "G", "s", "t", "0", "0", "a", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-" ]
757fa49fe335ae1210eaa7735473fd4388b13f07
https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauGst00a.php#L86-L96
1,266
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.addPermission
public function addPermission($permission) { if (is_array($permission) || $permission instanceof \Traversable) return $this->addMultiplePermissions($permission); else return $this->addSinglePermission($permission); }
php
public function addPermission($permission) { if (is_array($permission) || $permission instanceof \Traversable) return $this->addMultiplePermissions($permission); else return $this->addSinglePermission($permission); }
[ "public", "function", "addPermission", "(", "$", "permission", ")", "{", "if", "(", "is_array", "(", "$", "permission", ")", "||", "$", "permission", "instanceof", "\\", "Traversable", ")", "return", "$", "this", "->", "addMultiplePermissions", "(", "$", "pe...
Add a permission to the role. The argument can be the permission name, ID, Permission object, or an array of the previous @param $permission array|\Traversable|string|integer The permission to add to the current role @return \Searsaw\Drawbridge\Models\BridgePermission|\InvalidArgumentException
[ "Add", "a", "permission", "to", "the", "role", ".", "The", "argument", "can", "be", "the", "permission", "name", "ID", "Permission", "object", "or", "an", "array", "of", "the", "previous" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L67-L73
1,267
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.addSinglePermission
public function addSinglePermission($permission) { if (is_string($permission)) return $this->addPermissionByName($permission); elseif (is_numeric($permission)) return $this->addPermissionById($permission); elseif ($permission instanceof BridgePermission) r...
php
public function addSinglePermission($permission) { if (is_string($permission)) return $this->addPermissionByName($permission); elseif (is_numeric($permission)) return $this->addPermissionById($permission); elseif ($permission instanceof BridgePermission) r...
[ "public", "function", "addSinglePermission", "(", "$", "permission", ")", "{", "if", "(", "is_string", "(", "$", "permission", ")", ")", "return", "$", "this", "->", "addPermissionByName", "(", "$", "permission", ")", ";", "elseif", "(", "is_numeric", "(", ...
Add a single permission. The argument is a string, integer, or instance of BridgePermission @param $permission string|integer|\Searsaw\Drawbridge\Models\BridgePermission @throws \InvalidArgumentException @return \Searsaw\Drawbridge\Models\BridgePermission
[ "Add", "a", "single", "permission", ".", "The", "argument", "is", "a", "string", "integer", "or", "instance", "of", "BridgePermission" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L97-L107
1,268
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.addPermissionByName
public function addPermissionByName($permission_name) { $permission = static::$app['db']->connection() ->table('permissions')->where('name', '=', $permission_name)->first(); if (! $permission) return new \RuntimeException('No permission with that name found.'); if (...
php
public function addPermissionByName($permission_name) { $permission = static::$app['db']->connection() ->table('permissions')->where('name', '=', $permission_name)->first(); if (! $permission) return new \RuntimeException('No permission with that name found.'); if (...
[ "public", "function", "addPermissionByName", "(", "$", "permission_name", ")", "{", "$", "permission", "=", "static", "::", "$", "app", "[", "'db'", "]", "->", "connection", "(", ")", "->", "table", "(", "'permissions'", ")", "->", "where", "(", "'name'", ...
Add a single permission to the role by name @param $permission_name string The name of the permission to add @throws \UnexpectedValueException @throws \RuntimeException @return \Searsaw\Drawbridge\Models\BridgePermission
[ "Add", "a", "single", "permission", "to", "the", "role", "by", "name" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L119-L133
1,269
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.addPermissionByObject
public function addPermissionByObject(BridgePermission $permission_obj) { if (! $permission_obj->exists) $permission_obj->save(); $permission_id = $permission_obj->getKey(); return $this->addPermissionById($permission_id); }
php
public function addPermissionByObject(BridgePermission $permission_obj) { if (! $permission_obj->exists) $permission_obj->save(); $permission_id = $permission_obj->getKey(); return $this->addPermissionById($permission_id); }
[ "public", "function", "addPermissionByObject", "(", "BridgePermission", "$", "permission_obj", ")", "{", "if", "(", "!", "$", "permission_obj", "->", "exists", ")", "$", "permission_obj", "->", "save", "(", ")", ";", "$", "permission_id", "=", "$", "permission...
Add a single permission to the role by using the Permission object @param $permission_obj \Searsaw\Drawbridge\Models\BridgePermission The Permission object to add @return \Searsaw\Drawbridge\Models\BridgePermission
[ "Add", "a", "single", "permission", "to", "the", "role", "by", "using", "the", "Permission", "object" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L154-L162
1,270
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.hasPermission
public function hasPermission($permission) { $permissions = $this->permissions; foreach ($permissions as $permission_obj) if ($this->checkPermission($permission, $permission_obj)) return true; return false; }
php
public function hasPermission($permission) { $permissions = $this->permissions; foreach ($permissions as $permission_obj) if ($this->checkPermission($permission, $permission_obj)) return true; return false; }
[ "public", "function", "hasPermission", "(", "$", "permission", ")", "{", "$", "permissions", "=", "$", "this", "->", "permissions", ";", "foreach", "(", "$", "permissions", "as", "$", "permission_obj", ")", "if", "(", "$", "this", "->", "checkPermission", ...
Checks to see if a role has a certain permission @param $permission string|integer|\Searsaw\Drawbridge\Models\BridgePermission The permission to check @return bool
[ "Checks", "to", "see", "if", "a", "role", "has", "a", "certain", "permission" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L171-L179
1,271
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.checkPermission
public function checkPermission($check, BridgePermission $has) { if (is_string($check)) return $this->checkPermissionByName($check, $has); elseif (is_numeric($check)) return $this->checkPermissionById($check, $has); elseif ($check instanceof BridgePermission) ...
php
public function checkPermission($check, BridgePermission $has) { if (is_string($check)) return $this->checkPermissionByName($check, $has); elseif (is_numeric($check)) return $this->checkPermissionById($check, $has); elseif ($check instanceof BridgePermission) ...
[ "public", "function", "checkPermission", "(", "$", "check", ",", "BridgePermission", "$", "has", ")", "{", "if", "(", "is_string", "(", "$", "check", ")", ")", "return", "$", "this", "->", "checkPermissionByName", "(", "$", "check", ",", "$", "has", ")",...
Checks to see if a given permission is equal to a permission the user already has @param $check string|integer|\Searsaw\Drawbridge\Models\BridgePermission The permission to check @param $has \Searsaw\Drawbridge\Models\BridgePermission The permission the user has to check against @return mixed @throws \InvalidArgument...
[ "Checks", "to", "see", "if", "a", "given", "permission", "is", "equal", "to", "a", "permission", "the", "user", "already", "has" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L190-L200
1,272
searsaw/Drawbridge
src/Searsaw/Drawbridge/models/BridgeRole.php
BridgeRole.checkPermissionByObject
public function checkPermissionByObject(BridgePermission $check, BridgePermission $has) { return $this->checkPermissionById($check->id, $has); }
php
public function checkPermissionByObject(BridgePermission $check, BridgePermission $has) { return $this->checkPermissionById($check->id, $has); }
[ "public", "function", "checkPermissionByObject", "(", "BridgePermission", "$", "check", ",", "BridgePermission", "$", "has", ")", "{", "return", "$", "this", "->", "checkPermissionById", "(", "$", "check", "->", "id", ",", "$", "has", ")", ";", "}" ]
Check to see if the Permission provided is the same as the BridgePermission object passed in @param BridgePermission $check The object to check @param BridgePermission $has The object to check against @return bool
[ "Check", "to", "see", "if", "the", "Permission", "provided", "is", "the", "same", "as", "the", "BridgePermission", "object", "passed", "in" ]
156bd8238a623d245fbbbb509eb5dd148338f5a6
https://github.com/searsaw/Drawbridge/blob/156bd8238a623d245fbbbb509eb5dd148338f5a6/src/Searsaw/Drawbridge/models/BridgeRole.php#L245-L248
1,273
vincentshiqi/laravel-p-pdo-via-oci8
src/Pdo/Oci8.php
Oci8.query
public function query($statement, $fetchMode = null, $modeArg = null, array $ctorArgs = array()) { $stmt = $this->prepare($statement); $stmt->execute(); if ($fetchMode) { $stmt->setFetchMode($fetchMode, $modeArg, $ctorArgs); } return $stmt; }
php
public function query($statement, $fetchMode = null, $modeArg = null, array $ctorArgs = array()) { $stmt = $this->prepare($statement); $stmt->execute(); if ($fetchMode) { $stmt->setFetchMode($fetchMode, $modeArg, $ctorArgs); } return $stmt; }
[ "public", "function", "query", "(", "$", "statement", ",", "$", "fetchMode", "=", "null", ",", "$", "modeArg", "=", "null", ",", "array", "$", "ctorArgs", "=", "array", "(", ")", ")", "{", "$", "stmt", "=", "$", "this", "->", "prepare", "(", "$", ...
Executes an SQL statement, returning the results as a Vincent\Pdo\Oci8\Statement object. @param string $statement The SQL statement to prepare and execute. @param int|null $fetchMode The fetch mode must be one of the PDO::FETCH_* constants. @param mixed|null $modeArg Column number, class name or object. @param array|n...
[ "Executes", "an", "SQL", "statement", "returning", "the", "results", "as", "a", "Vincent", "\\", "Pdo", "\\", "Oci8", "\\", "Statement", "object", "." ]
748857d12342c7ef8d75f2b4abb58aaddbef57f6
https://github.com/vincentshiqi/laravel-p-pdo-via-oci8/blob/748857d12342c7ef8d75f2b4abb58aaddbef57f6/src/Pdo/Oci8.php#L248-L257
1,274
rseyferth/activerecord
lib/Relationship.php
AbstractRelationship.constructInnerJoinSql
public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null) { if ($usingThrough) { $joinTable = $fromTable; $joinTableName = $fromTable->getFullyQualifiedTableName(); $fromTableName = Table::load($this->className)->getFullyQualifiedTableName(); } else { $joinTable =...
php
public function constructInnerJoinSql(Table $fromTable, $usingThrough=false, $alias=null) { if ($usingThrough) { $joinTable = $fromTable; $joinTableName = $fromTable->getFullyQualifiedTableName(); $fromTableName = Table::load($this->className)->getFullyQualifiedTableName(); } else { $joinTable =...
[ "public", "function", "constructInnerJoinSql", "(", "Table", "$", "fromTable", ",", "$", "usingThrough", "=", "false", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "$", "usingThrough", ")", "{", "$", "joinTable", "=", "$", "fromTable", ";", "$", ...
Creates INNER JOIN SQL for associations. @param Table $from_table the table used for the FROM SQL statement @param bool $using_through is this a THROUGH relationship? @param string $alias a table alias for when a table is being joined twice @return string SQL INNER JOIN fragment
[ "Creates", "INNER", "JOIN", "SQL", "for", "associations", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Relationship.php#L331-L377
1,275
rseyferth/activerecord
lib/Relationship.php
HasMany.getForeignKeyForNewAssociation
private function getForeignKeyForNewAssociation(Model $model) { $this->setKeys($model); $primaryKey = Inflector::instance()->variablize($this->foreignKey[0]); return array( $primaryKey => $model->id, ); }
php
private function getForeignKeyForNewAssociation(Model $model) { $this->setKeys($model); $primaryKey = Inflector::instance()->variablize($this->foreignKey[0]); return array( $primaryKey => $model->id, ); }
[ "private", "function", "getForeignKeyForNewAssociation", "(", "Model", "$", "model", ")", "{", "$", "this", "->", "setKeys", "(", "$", "model", ")", ";", "$", "primaryKey", "=", "Inflector", "::", "instance", "(", ")", "->", "variablize", "(", "$", "this",...
Get an array containing the key and value of the foreign key for the association @param Model $model @access private @return array
[ "Get", "an", "array", "containing", "the", "key", "and", "value", "of", "the", "foreign", "key", "for", "the", "association" ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Relationship.php#L539-L547
1,276
jaeger-app/regex
src/Regex.php
Regex.getInstance
private function getInstance() { if (is_null($this->instance)) { $this->instance = \RegexGuard\Factory::getGuard(); } return $this->instance; }
php
private function getInstance() { if (is_null($this->instance)) { $this->instance = \RegexGuard\Factory::getGuard(); } return $this->instance; }
[ "private", "function", "getInstance", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "instance", ")", ")", "{", "$", "this", "->", "instance", "=", "\\", "RegexGuard", "\\", "Factory", "::", "getGuard", "(", ")", ";", "}", "return", "$"...
Returns an instance of the library @return \RegexGuard\RegexGuard
[ "Returns", "an", "instance", "of", "the", "library" ]
89dc4d55d79fc933725a9aebeb23d3e676cd8820
https://github.com/jaeger-app/regex/blob/89dc4d55d79fc933725a9aebeb23d3e676cd8820/src/Regex.php#L37-L44
1,277
jaeger-app/regex
src/Regex.php
Regex.match
public function match($pattern, $subject) { if (! $this->validate($pattern)) { return false; } return $this->getInstance()->match($pattern, $subject); }
php
public function match($pattern, $subject) { if (! $this->validate($pattern)) { return false; } return $this->getInstance()->match($pattern, $subject); }
[ "public", "function", "match", "(", "$", "pattern", ",", "$", "subject", ")", "{", "if", "(", "!", "$", "this", "->", "validate", "(", "$", "pattern", ")", ")", "{", "return", "false", ";", "}", "return", "$", "this", "->", "getInstance", "(", ")",...
Matches a regular expression @param string $pattern The regular expression to execute @param string $subject The string to search within @return boolean
[ "Matches", "a", "regular", "expression" ]
89dc4d55d79fc933725a9aebeb23d3e676cd8820
https://github.com/jaeger-app/regex/blob/89dc4d55d79fc933725a9aebeb23d3e676cd8820/src/Regex.php#L67-L74
1,278
jmpantoja/planb-utils
src/Beautifier/Template/Line.php
Line.getWords
private function getWords(string $template): array { $flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY; return (array) preg_split(self::WORD_DELIMITER, $template, -1, $flags); }
php
private function getWords(string $template): array { $flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY; return (array) preg_split(self::WORD_DELIMITER, $template, -1, $flags); }
[ "private", "function", "getWords", "(", "string", "$", "template", ")", ":", "array", "{", "$", "flags", "=", "PREG_SPLIT_DELIM_CAPTURE", "|", "PREG_SPLIT_NO_EMPTY", ";", "return", "(", "array", ")", "preg_split", "(", "self", "::", "WORD_DELIMITER", ",", "$",...
Devuelve una lista con las palabras que componen la linea @param string $template @return mixed[]
[ "Devuelve", "una", "lista", "con", "las", "palabras", "que", "componen", "la", "linea" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Line.php#L79-L84
1,279
jmpantoja/planb-utils
src/Beautifier/Template/Line.php
Line.getTokens
private function getTokens(string $word): array { $flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY; return (array) preg_split(self::TOKEN_DELIMITER, $word, -1, $flags); }
php
private function getTokens(string $word): array { $flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY; return (array) preg_split(self::TOKEN_DELIMITER, $word, -1, $flags); }
[ "private", "function", "getTokens", "(", "string", "$", "word", ")", ":", "array", "{", "$", "flags", "=", "PREG_SPLIT_DELIM_CAPTURE", "|", "PREG_SPLIT_NO_EMPTY", ";", "return", "(", "array", ")", "preg_split", "(", "self", "::", "TOKEN_DELIMITER", ",", "$", ...
Devuelve los tokens que componen una palabra @param string $word @return mixed[]
[ "Devuelve", "los", "tokens", "que", "componen", "una", "palabra" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Line.php#L93-L98
1,280
jmpantoja/planb-utils
src/Beautifier/Template/Line.php
Line.parse
public function parse(callable $callback, int $width): string { $tokens = []; foreach ($this as $token) { $token->setLineWidth($width); $tokens[] = call_user_func($callback, $token); } return implode('', $tokens); }
php
public function parse(callable $callback, int $width): string { $tokens = []; foreach ($this as $token) { $token->setLineWidth($width); $tokens[] = call_user_func($callback, $token); } return implode('', $tokens); }
[ "public", "function", "parse", "(", "callable", "$", "callback", ",", "int", "$", "width", ")", ":", "string", "{", "$", "tokens", "=", "[", "]", ";", "foreach", "(", "$", "this", "as", "$", "token", ")", "{", "$", "token", "->", "setLineWidth", "(...
Devuelve esta linea en forma de string, usando un callback para resolver cada token @param callable $callback @param int $width @return string
[ "Devuelve", "esta", "linea", "en", "forma", "de", "string", "usando", "un", "callback", "para", "resolver", "cada", "token" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Line.php#L120-L129
1,281
jmpantoja/planb-utils
src/Beautifier/Template/Line.php
Line.getWidth
public function getWidth(): int { $total = 0; foreach ($this as $token) { $total += $token->width(); } return $total; }
php
public function getWidth(): int { $total = 0; foreach ($this as $token) { $total += $token->width(); } return $total; }
[ "public", "function", "getWidth", "(", ")", ":", "int", "{", "$", "total", "=", "0", ";", "foreach", "(", "$", "this", "as", "$", "token", ")", "{", "$", "total", "+=", "$", "token", "->", "width", "(", ")", ";", "}", "return", "$", "total", ";...
Devuelve el ancho del linea @return int
[ "Devuelve", "el", "ancho", "del", "linea" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Line.php#L137-L145
1,282
phlexible/media-manager
Upload/UploadHandler.php
UploadHandler.handle
public function handle(UploadedFile $uploadedFile, $folderId, $userId) { $uploadFileSource = new UploadedFileSource($uploadedFile); $volume = $this->volumeManager->getByFolderId($folderId); $folder = $volume->findFolder($folderId); $file = $volume->findFileByPath($folder->getPath()....
php
public function handle(UploadedFile $uploadedFile, $folderId, $userId) { $uploadFileSource = new UploadedFileSource($uploadedFile); $volume = $this->volumeManager->getByFolderId($folderId); $folder = $volume->findFolder($folderId); $file = $volume->findFileByPath($folder->getPath()....
[ "public", "function", "handle", "(", "UploadedFile", "$", "uploadedFile", ",", "$", "folderId", ",", "$", "userId", ")", "{", "$", "uploadFileSource", "=", "new", "UploadedFileSource", "(", "$", "uploadedFile", ")", ";", "$", "volume", "=", "$", "this", "-...
Handle upload. @param UploadedFile $uploadedFile @param string $folderId @param string $userId @return TempFile|ExtendedFileInterface
[ "Handle", "upload", "." ]
e4835062c9be575fc0e5ab67f25f02a50a85a7f6
https://github.com/phlexible/media-manager/blob/e4835062c9be575fc0e5ab67f25f02a50a85a7f6/Upload/UploadHandler.php#L96-L124
1,283
kettari/tallanto-client-api-bundle
Api/Method/TallantoGetClassesVisitsMethod.php
TallantoGetClassesVisitsMethod.getVisits
public function getVisits($items) { $result = []; foreach ($items as $item) { $result[] = new Visit($item); } return $result; }
php
public function getVisits($items) { $result = []; foreach ($items as $item) { $result[] = new Visit($item); } return $result; }
[ "public", "function", "getVisits", "(", "$", "items", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "items", "as", "$", "item", ")", "{", "$", "result", "[", "]", "=", "new", "Visit", "(", "$", "item", ")", ";", "}", "return...
Returns array of visits. @param array $items @return array
[ "Returns", "array", "of", "visits", "." ]
09863d2b0fed306cc1218ed602ba6c6ad461c3da
https://github.com/kettari/tallanto-client-api-bundle/blob/09863d2b0fed306cc1218ed602ba6c6ad461c3da/Api/Method/TallantoGetClassesVisitsMethod.php#L95-L103
1,284
wigedev/simple-mvc
src/Utility/ModuleControllerLoader.php
ModuleControllerLoader.loadModule
protected function loadModule() : void { $fqn = $this->getFullyQualifiedClass($this->response->getModule(), $this->response->getController()); $the_module = new $fqn(); call_user_func_array(array($the_module, $this->getActionMethodName($this->response->getAction())), [$this->response->getVar...
php
protected function loadModule() : void { $fqn = $this->getFullyQualifiedClass($this->response->getModule(), $this->response->getController()); $the_module = new $fqn(); call_user_func_array(array($the_module, $this->getActionMethodName($this->response->getAction())), [$this->response->getVar...
[ "protected", "function", "loadModule", "(", ")", ":", "void", "{", "$", "fqn", "=", "$", "this", "->", "getFullyQualifiedClass", "(", "$", "this", "->", "response", "->", "getModule", "(", ")", ",", "$", "this", "->", "response", "->", "getController", "...
Load a module as requested and mapped by the router.
[ "Load", "a", "module", "as", "requested", "and", "mapped", "by", "the", "router", "." ]
b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94
https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/ModuleControllerLoader.php#L69-L74
1,285
wigedev/simple-mvc
src/Utility/ModuleControllerLoader.php
ModuleControllerLoader.loadErrorModule
protected function loadErrorModule() : void { $fqn = $this->getFullyQualifiedClass('index', 'index'); $the_module = new $fqn(); $action = $this->getActionMethodName((string)$this->response->getStatusCode()); if (method_exists($fqn, $action)) { call_user_func_array(array($...
php
protected function loadErrorModule() : void { $fqn = $this->getFullyQualifiedClass('index', 'index'); $the_module = new $fqn(); $action = $this->getActionMethodName((string)$this->response->getStatusCode()); if (method_exists($fqn, $action)) { call_user_func_array(array($...
[ "protected", "function", "loadErrorModule", "(", ")", ":", "void", "{", "$", "fqn", "=", "$", "this", "->", "getFullyQualifiedClass", "(", "'index'", ",", "'index'", ")", ";", "$", "the_module", "=", "new", "$", "fqn", "(", ")", ";", "$", "action", "="...
Load an error module based on the error code.
[ "Load", "an", "error", "module", "based", "on", "the", "error", "code", "." ]
b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94
https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/ModuleControllerLoader.php#L79-L90
1,286
wigedev/simple-mvc
src/Utility/ModuleControllerLoader.php
ModuleControllerLoader.getFullyQualifiedClass
protected function getFullyQualifiedClass(string $module_name, string $controller_class) : string { return 'Application\\Module\\' . $this->getModuleName($module_name) . '\\Controller\\' . $this->getControllerName($controller_class); }
php
protected function getFullyQualifiedClass(string $module_name, string $controller_class) : string { return 'Application\\Module\\' . $this->getModuleName($module_name) . '\\Controller\\' . $this->getControllerName($controller_class); }
[ "protected", "function", "getFullyQualifiedClass", "(", "string", "$", "module_name", ",", "string", "$", "controller_class", ")", ":", "string", "{", "return", "'Application\\\\Module\\\\'", ".", "$", "this", "->", "getModuleName", "(", "$", "module_name", ")", "...
Get the fully qualified class name of the controller. @param string $module_name @param string $controller_class @return string
[ "Get", "the", "fully", "qualified", "class", "name", "of", "the", "controller", "." ]
b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94
https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/ModuleControllerLoader.php#L98-L101
1,287
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.getConnection
protected function getConnection($nameDB = NULL){ //Leo archivo de configuracion de BD si es la primera vez if(self::$config_db == NULL){ self::$config_db= $this->context->readConfigurationFile($this->configFile); } //Consulta la bd actual si no se indico opcion print_r(self:...
php
protected function getConnection($nameDB = NULL){ //Leo archivo de configuracion de BD si es la primera vez if(self::$config_db == NULL){ self::$config_db= $this->context->readConfigurationFile($this->configFile); } //Consulta la bd actual si no se indico opcion print_r(self:...
[ "protected", "function", "getConnection", "(", "$", "nameDB", "=", "NULL", ")", "{", "//Leo archivo de configuracion de BD si es la primera vez", "if", "(", "self", "::", "$", "config_db", "==", "NULL", ")", "{", "self", "::", "$", "config_db", "=", "$", "this",...
Abre una conexion en base a la configuracion de la BD @param string $nameDB @return \PDO @throws \PDOException
[ "Abre", "una", "conexion", "en", "base", "a", "la", "configuracion", "de", "la", "BD" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L69-L117
1,288
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.catchError
protected function catchError($error){ if($this->connection->inTransaction()){ $this->errorTran[]= $error; $this->stateTran= FALSE; } $this->lastError= $error; }
php
protected function catchError($error){ if($this->connection->inTransaction()){ $this->errorTran[]= $error; $this->stateTran= FALSE; } $this->lastError= $error; }
[ "protected", "function", "catchError", "(", "$", "error", ")", "{", "if", "(", "$", "this", "->", "connection", "->", "inTransaction", "(", ")", ")", "{", "$", "this", "->", "errorTran", "[", "]", "=", "$", "error", ";", "$", "this", "->", "stateTran...
Almacena los errores @param string $error
[ "Almacena", "los", "errores" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L122-L129
1,289
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.connect
public function connect($nameDB = NULL, $configFile = NULL){ if($configFile != NULL){ $this->configFile= $configFile; self::$config_db= NULL; } $this->connection= $this->getConnection($nameDB); }
php
public function connect($nameDB = NULL, $configFile = NULL){ if($configFile != NULL){ $this->configFile= $configFile; self::$config_db= NULL; } $this->connection= $this->getConnection($nameDB); }
[ "public", "function", "connect", "(", "$", "nameDB", "=", "NULL", ",", "$", "configFile", "=", "NULL", ")", "{", "if", "(", "$", "configFile", "!=", "NULL", ")", "{", "$", "this", "->", "configFile", "=", "$", "configFile", ";", "self", "::", "$", ...
Realiza la conexion a la base indicada o por defecto @param string $nameDB
[ "Realiza", "la", "conexion", "a", "la", "base", "indicada", "o", "por", "defecto" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L139-L145
1,290
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.select
public function select($select, $distinct = FALSE){ if($distinct){ $this->select= 'DISTINCT '; }else{ $this->select= ''; } $this->select .= $select; }
php
public function select($select, $distinct = FALSE){ if($distinct){ $this->select= 'DISTINCT '; }else{ $this->select= ''; } $this->select .= $select; }
[ "public", "function", "select", "(", "$", "select", ",", "$", "distinct", "=", "FALSE", ")", "{", "if", "(", "$", "distinct", ")", "{", "$", "this", "->", "select", "=", "'DISTINCT '", ";", "}", "else", "{", "$", "this", "->", "select", "=", "''", ...
Arma el Select de la consulta @param string $select @param bool $distinct
[ "Arma", "el", "Select", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L177-L184
1,291
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.where
public function where($conditions, array $values){ if($this->where != ''){$this->where.='AND ';} $this->where.= $conditions . ' '; $this->where_values = array_merge($this->where_values, $values); }
php
public function where($conditions, array $values){ if($this->where != ''){$this->where.='AND ';} $this->where.= $conditions . ' '; $this->where_values = array_merge($this->where_values, $values); }
[ "public", "function", "where", "(", "$", "conditions", ",", "array", "$", "values", ")", "{", "if", "(", "$", "this", "->", "where", "!=", "''", ")", "{", "$", "this", "->", "where", ".=", "'AND '", ";", "}", "$", "this", "->", "where", ".=", "$"...
Arma el where de la consulta @param string $conditions @param array $values
[ "Arma", "el", "where", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L206-L210
1,292
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.where_like
public function where_like($field, $match, $joker='both', $not=FALSE){ if($this->where != ''){$this->where.='AND ';} $this->like($field, $match, $joker, $not); }
php
public function where_like($field, $match, $joker='both', $not=FALSE){ if($this->where != ''){$this->where.='AND ';} $this->like($field, $match, $joker, $not); }
[ "public", "function", "where_like", "(", "$", "field", ",", "$", "match", ",", "$", "joker", "=", "'both'", ",", "$", "not", "=", "FALSE", ")", "{", "if", "(", "$", "this", "->", "where", "!=", "''", ")", "{", "$", "this", "->", "where", ".=", ...
Arma el where like de la consutla @param string $field @param string $match @param string $joker @param bool $not
[ "Arma", "el", "where", "like", "de", "la", "consutla" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L228-L231
1,293
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.like
protected function like($field, $match, $joker='both', $not=FALSE){ $this->where.= $field . ' '; if($not){$this->where.= 'NOT ';} $this->where.= 'LIKE '; switch ($joker){ case 'both': $this->where.= "'%$match%' "; break; case 'afte...
php
protected function like($field, $match, $joker='both', $not=FALSE){ $this->where.= $field . ' '; if($not){$this->where.= 'NOT ';} $this->where.= 'LIKE '; switch ($joker){ case 'both': $this->where.= "'%$match%' "; break; case 'afte...
[ "protected", "function", "like", "(", "$", "field", ",", "$", "match", ",", "$", "joker", "=", "'both'", ",", "$", "not", "=", "FALSE", ")", "{", "$", "this", "->", "where", ".=", "$", "field", ".", "' '", ";", "if", "(", "$", "not", ")", "{", ...
Arma el Like para el where and o or @param string $field @param string $match @param string $joker @param bool $not
[ "Arma", "el", "Like", "para", "el", "where", "and", "o", "or" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L250-L265
1,294
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.where_in
public function where_in($field, array $values, $not=FALSE){ if($this->where != ''){$this->where.='AND ';} $this->in($field, $values, $not); }
php
public function where_in($field, array $values, $not=FALSE){ if($this->where != ''){$this->where.='AND ';} $this->in($field, $values, $not); }
[ "public", "function", "where_in", "(", "$", "field", ",", "array", "$", "values", ",", "$", "not", "=", "FALSE", ")", "{", "if", "(", "$", "this", "->", "where", "!=", "''", ")", "{", "$", "this", "->", "where", ".=", "'AND '", ";", "}", "$", "...
Arma el where in de la consulta @param string $field @param array $values @param bool $not
[ "Arma", "el", "where", "in", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L272-L275
1,295
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.or_where_in
public function or_where_in($field, array $values, $not=FALSE){ if($this->where != ''){$this->where.='OR ';} $this->in($field, $values, $not); }
php
public function or_where_in($field, array $values, $not=FALSE){ if($this->where != ''){$this->where.='OR ';} $this->in($field, $values, $not); }
[ "public", "function", "or_where_in", "(", "$", "field", ",", "array", "$", "values", ",", "$", "not", "=", "FALSE", ")", "{", "if", "(", "$", "this", "->", "where", "!=", "''", ")", "{", "$", "this", "->", "where", ".=", "'OR '", ";", "}", "$", ...
Arma el where in con or de la consulta @param string $field @param array $values @param bool $not
[ "Arma", "el", "where", "in", "con", "or", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L282-L285
1,296
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.in
protected function in($field, array $values, $not=FALSE){ $this->where.= $field . ' '; if($not){$this->where.= 'NOT ';} $this->where.= 'IN ('; foreach ($values as $value) { $this->where.= "'$value',"; } $this->where= rtrim($this->where, ','); $this->wh...
php
protected function in($field, array $values, $not=FALSE){ $this->where.= $field . ' '; if($not){$this->where.= 'NOT ';} $this->where.= 'IN ('; foreach ($values as $value) { $this->where.= "'$value',"; } $this->where= rtrim($this->where, ','); $this->wh...
[ "protected", "function", "in", "(", "$", "field", ",", "array", "$", "values", ",", "$", "not", "=", "FALSE", ")", "{", "$", "this", "->", "where", ".=", "$", "field", ".", "' '", ";", "if", "(", "$", "not", ")", "{", "$", "this", "->", "where"...
Arma el in para el where and o or @param string $field @param array $values @param bool $not
[ "Arma", "el", "in", "para", "el", "where", "and", "o", "or" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L292-L301
1,297
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.group
public function group($group){ if(is_array($group)){ $this->group= 'GROUP BY '; foreach ($group as $value) { $this->group .= $value.','; } $this->group= rtrim($this->group, ','); $this->group.=' '; }else{ $this->grou...
php
public function group($group){ if(is_array($group)){ $this->group= 'GROUP BY '; foreach ($group as $value) { $this->group .= $value.','; } $this->group= rtrim($this->group, ','); $this->group.=' '; }else{ $this->grou...
[ "public", "function", "group", "(", "$", "group", ")", "{", "if", "(", "is_array", "(", "$", "group", ")", ")", "{", "$", "this", "->", "group", "=", "'GROUP BY '", ";", "foreach", "(", "$", "group", "as", "$", "value", ")", "{", "$", "this", "->...
Arma el group de la consulta @param string $group
[ "Arma", "el", "group", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L306-L317
1,298
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.having
public function having($conditions, array $values){ if($this->having != ''){$this->having.='AND ';} $this->having.= $conditions . ' '; $this->where_values = array_merge($this->where_values, $values); }
php
public function having($conditions, array $values){ if($this->having != ''){$this->having.='AND ';} $this->having.= $conditions . ' '; $this->where_values = array_merge($this->where_values, $values); }
[ "public", "function", "having", "(", "$", "conditions", ",", "array", "$", "values", ")", "{", "if", "(", "$", "this", "->", "having", "!=", "''", ")", "{", "$", "this", "->", "having", ".=", "'AND '", ";", "}", "$", "this", "->", "having", ".=", ...
Arma el having de la consulta @param string $conditions @param array $values
[ "Arma", "el", "having", "de", "la", "consulta" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L323-L327
1,299
edunola13/core-modules
src/DataBaseAR.php
DataBaseAR.get
public function get(){ $res= FALSE; try{ //Armo y preparo la consulta $query= $this->prepareSelect($this->select, $this->from, $this->where, $this->group, $this->having, $this->order, $this->limit); //Ejecuto la consulta $query->execute($this->where_values...
php
public function get(){ $res= FALSE; try{ //Armo y preparo la consulta $query= $this->prepareSelect($this->select, $this->from, $this->where, $this->group, $this->having, $this->order, $this->limit); //Ejecuto la consulta $query->execute($this->where_values...
[ "public", "function", "get", "(", ")", "{", "$", "res", "=", "FALSE", ";", "try", "{", "//Armo y preparo la consulta", "$", "query", "=", "$", "this", "->", "prepareSelect", "(", "$", "this", "->", "select", ",", "$", "this", "->", "from", ",", "$", ...
Devuelve el resultado de la consulta armada de forma ActiveRecord @return \PDOStatement o FALSE @throws \PDOException
[ "Devuelve", "el", "resultado", "de", "la", "consulta", "armada", "de", "forma", "ActiveRecord" ]
2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364
https://github.com/edunola13/core-modules/blob/2a2e9b89bb61cc28e548412e1d6c9bbb44bc5364/src/DataBaseAR.php#L359-L377