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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20,500 | Innmind/neo4j-dbal | src/Transactions.php | Transactions.commit | public function commit(): self
{
($this->fulfill)(
new Request(
$this->current()->commitEndpoint(),
Method::post(),
new ProtocolVersion(1, 1),
$this->headers,
$this->body
)
);
$this->trans... | php | public function commit(): self
{
($this->fulfill)(
new Request(
$this->current()->commitEndpoint(),
Method::post(),
new ProtocolVersion(1, 1),
$this->headers,
$this->body
)
);
$this->trans... | [
"public",
"function",
"commit",
"(",
")",
":",
"self",
"{",
"(",
"$",
"this",
"->",
"fulfill",
")",
"(",
"new",
"Request",
"(",
"$",
"this",
"->",
"current",
"(",
")",
"->",
"commitEndpoint",
"(",
")",
",",
"Method",
"::",
"post",
"(",
")",
",",
... | Commit the current transaction
@return self | [
"Commit",
"the",
"current",
"transaction"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L120-L134 |
20,501 | Innmind/neo4j-dbal | src/Transactions.php | Transactions.rollback | public function rollback(): self
{
($this->fulfill)(
new Request(
$this->current()->endpoint(),
Method::delete(),
new ProtocolVersion(1, 1)
)
);
$this->transactions = $this->transactions->dropEnd(1);
return $thi... | php | public function rollback(): self
{
($this->fulfill)(
new Request(
$this->current()->endpoint(),
Method::delete(),
new ProtocolVersion(1, 1)
)
);
$this->transactions = $this->transactions->dropEnd(1);
return $thi... | [
"public",
"function",
"rollback",
"(",
")",
":",
"self",
"{",
"(",
"$",
"this",
"->",
"fulfill",
")",
"(",
"new",
"Request",
"(",
"$",
"this",
"->",
"current",
"(",
")",
"->",
"endpoint",
"(",
")",
",",
"Method",
"::",
"delete",
"(",
")",
",",
"n... | Rollback the current transaction
@return self | [
"Rollback",
"the",
"current",
"transaction"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Transactions.php#L141-L153 |
20,502 | nabab/bbn | src/bbn/ide/directories.php | directories.rem_dir_opt | private function rem_dir_opt($d){
$sub_files = bbn\file\dir::scan($d);
$files = [];
foreach ( $sub_files as $sub ){
if ( is_file($sub) ){
// Add it to files to be closed
array_push($files, $this->real_to_url($sub));
// Remove file's options
$this->options->remove($this-... | php | private function rem_dir_opt($d){
$sub_files = bbn\file\dir::scan($d);
$files = [];
foreach ( $sub_files as $sub ){
if ( is_file($sub) ){
// Add it to files to be closed
array_push($files, $this->real_to_url($sub));
// Remove file's options
$this->options->remove($this-... | [
"private",
"function",
"rem_dir_opt",
"(",
"$",
"d",
")",
"{",
"$",
"sub_files",
"=",
"bbn",
"\\",
"file",
"\\",
"dir",
"::",
"scan",
"(",
"$",
"d",
")",
";",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"sub_files",
"as",
"$",
"sub",
... | Deletes all files' options of a folder and returns an array of these files.
@param string $d The folder's path
@return array | [
"Deletes",
"all",
"files",
"options",
"of",
"a",
"folder",
"and",
"returns",
"an",
"array",
"of",
"these",
"files",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L125-L143 |
20,503 | nabab/bbn | src/bbn/ide/directories.php | directories.superior_sctrl | private function superior_sctrl($tab, $path=''){
if ( ($pos = strpos($tab, '_ctrl')) ){
// Fix the right path
$bits = explode('/', $path);
$count = \strlen(substr($tab, 0, $pos));
if ( !empty($bits) ){
while ( $count >= 0 ){
array_pop($bits);
$count--;
}
... | php | private function superior_sctrl($tab, $path=''){
if ( ($pos = strpos($tab, '_ctrl')) ){
// Fix the right path
$bits = explode('/', $path);
$count = \strlen(substr($tab, 0, $pos));
if ( !empty($bits) ){
while ( $count >= 0 ){
array_pop($bits);
$count--;
}
... | [
"private",
"function",
"superior_sctrl",
"(",
"$",
"tab",
",",
"$",
"path",
"=",
"''",
")",
"{",
"if",
"(",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"tab",
",",
"'_ctrl'",
")",
")",
")",
"{",
"// Fix the right path",
"$",
"bits",
"=",
"explode",
"... | Checks if the file is a superior super-controller and returns the corrected name and path
@param string $tab The tab'name from file's URL
@param string $path The file's path from file's URL
@return array | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"superior",
"super",
"-",
"controller",
"and",
"returns",
"the",
"corrected",
"name",
"and",
"path"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L152-L171 |
20,504 | nabab/bbn | src/bbn/ide/directories.php | directories.real_to_id | public function real_to_id($file){
$timer = new bbn\util\timer();
$timer->start('real_to_id');
$url = self::real_to_url($file);
$dir = self::dir(self::dir_from_url($url));
if ( !empty($dir) &&
\defined($dir['bbn_path'])
){
$bbn_p = constant($dir['bbn_path']);
if ( strpos($file,... | php | public function real_to_id($file){
$timer = new bbn\util\timer();
$timer->start('real_to_id');
$url = self::real_to_url($file);
$dir = self::dir(self::dir_from_url($url));
if ( !empty($dir) &&
\defined($dir['bbn_path'])
){
$bbn_p = constant($dir['bbn_path']);
if ( strpos($file,... | [
"public",
"function",
"real_to_id",
"(",
"$",
"file",
")",
"{",
"$",
"timer",
"=",
"new",
"bbn",
"\\",
"util",
"\\",
"timer",
"(",
")",
";",
"$",
"timer",
"->",
"start",
"(",
"'real_to_id'",
")",
";",
"$",
"url",
"=",
"self",
"::",
"real_to_url",
"... | Returns the file's ID from the real file's path.
@param string $file The real file's path
@todo Fix the slowness!
@return bool|string | [
"Returns",
"the",
"file",
"s",
"ID",
"from",
"the",
"real",
"file",
"s",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L289-L331 |
20,505 | nabab/bbn | src/bbn/ide/directories.php | directories.url_to_real | public function url_to_real($url){
if ( ($dn = $this->dir_from_url($url)) &&
($dir = $this->dir($dn)) &&
($res = $this->get_root_path($dn))
){
$bits = explode('/', substr($url, \strlen($dn), \strlen($url)));
if ( !empty($dir['tabs']) && !empty($bits) ){
// Tab's nane
$tab... | php | public function url_to_real($url){
if ( ($dn = $this->dir_from_url($url)) &&
($dir = $this->dir($dn)) &&
($res = $this->get_root_path($dn))
){
$bits = explode('/', substr($url, \strlen($dn), \strlen($url)));
if ( !empty($dir['tabs']) && !empty($bits) ){
// Tab's nane
$tab... | [
"public",
"function",
"url_to_real",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"(",
"$",
"dn",
"=",
"$",
"this",
"->",
"dir_from_url",
"(",
"$",
"url",
")",
")",
"&&",
"(",
"$",
"dir",
"=",
"$",
"this",
"->",
"dir",
"(",
"$",
"dn",
")",
")",
"&&"... | Gets the real file's path from an URL
@param string $url The file's URL
@return bool|string | [
"Gets",
"the",
"real",
"file",
"s",
"path",
"from",
"an",
"URL"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L339-L392 |
20,506 | nabab/bbn | src/bbn/ide/directories.php | directories.dir_from_url | public function dir_from_url($url){
$dir = false;
foreach ( $this->dirs() as $i => $d ){
if ( (strpos($url, $i) === 0) &&
(\strlen($i) > \strlen($dir) )
){
$dir = $i;
break;
}
}
return $dir;
} | php | public function dir_from_url($url){
$dir = false;
foreach ( $this->dirs() as $i => $d ){
if ( (strpos($url, $i) === 0) &&
(\strlen($i) > \strlen($dir) )
){
$dir = $i;
break;
}
}
return $dir;
} | [
"public",
"function",
"dir_from_url",
"(",
"$",
"url",
")",
"{",
"$",
"dir",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"dirs",
"(",
")",
"as",
"$",
"i",
"=>",
"$",
"d",
")",
"{",
"if",
"(",
"(",
"strpos",
"(",
"$",
"url",
",",
"$"... | Returns the dir's name from an URL
@param string $url
@return bool|int|string | [
"Returns",
"the",
"dir",
"s",
"name",
"from",
"an",
"URL"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L400-L411 |
20,507 | nabab/bbn | src/bbn/ide/directories.php | directories.url_to_id | public function url_to_id($url){
if ( $file = $this->url_to_real($url) ){
return $this->real_to_id($file);
}
return false;
} | php | public function url_to_id($url){
if ( $file = $this->url_to_real($url) ){
return $this->real_to_id($file);
}
return false;
} | [
"public",
"function",
"url_to_id",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"url_to_real",
"(",
"$",
"url",
")",
")",
"{",
"return",
"$",
"this",
"->",
"real_to_id",
"(",
"$",
"file",
")",
";",
"}",
"return",
"fa... | Returns the file's ID from its URL
@param string $url The file's URL
@return bool|string | [
"Returns",
"the",
"file",
"s",
"ID",
"from",
"its",
"URL"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L429-L434 |
20,508 | nabab/bbn | src/bbn/ide/directories.php | directories.id_to_url | public function id_to_url($id){
if ( $file = $this->id_to_real($id) ){
return $this->real_to_url($file);
}
return false;
} | php | public function id_to_url($id){
if ( $file = $this->id_to_real($id) ){
return $this->real_to_url($file);
}
return false;
} | [
"public",
"function",
"id_to_url",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"id_to_real",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"real_to_url",
"(",
"$",
"file",
")",
";",
"}",
"return",
"fals... | Returns the file's URL from its ID
@param string $id The file's ID
@return bool|string | [
"Returns",
"the",
"file",
"s",
"URL",
"from",
"its",
"ID"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L442-L447 |
20,509 | nabab/bbn | src/bbn/ide/directories.php | directories.get_root_path | public function get_root_path($code){
/** @var array $dir The directory configuration */
$dir = $this->dir($code);
if ( $dir ){
$path = $this->decipher_path(bbn\str::parse_path($dir['bbn_path'].(!empty($dir['path']) ? '/' . $dir['path'] : '')));
$r = bbn\str::parse_path($path.'/');
return... | php | public function get_root_path($code){
/** @var array $dir The directory configuration */
$dir = $this->dir($code);
if ( $dir ){
$path = $this->decipher_path(bbn\str::parse_path($dir['bbn_path'].(!empty($dir['path']) ? '/' . $dir['path'] : '')));
$r = bbn\str::parse_path($path.'/');
return... | [
"public",
"function",
"get_root_path",
"(",
"$",
"code",
")",
"{",
"/** @var array $dir The directory configuration */",
"$",
"dir",
"=",
"$",
"this",
"->",
"dir",
"(",
"$",
"code",
")",
";",
"if",
"(",
"$",
"dir",
")",
"{",
"$",
"path",
"=",
"$",
"this"... | Gets the real root path from a directory's id as recorded in the options.
@param string $code The dir's name (code)
@return bool|string | [
"Gets",
"the",
"real",
"root",
"path",
"from",
"a",
"directory",
"s",
"id",
"as",
"recorded",
"in",
"the",
"options",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L455-L465 |
20,510 | nabab/bbn | src/bbn/ide/directories.php | directories.dirs | public function dirs($code=false){
$all = $this->options->full_soptions(self::_dev_path());
$cats = [];
$r = [];
foreach ( $all as $a ){
if ( \defined($a['bbn_path']) ){
$k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);
if ( !isset($cats[$a['id_alias']]) ){
... | php | public function dirs($code=false){
$all = $this->options->full_soptions(self::_dev_path());
$cats = [];
$r = [];
foreach ( $all as $a ){
if ( \defined($a['bbn_path']) ){
$k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);
if ( !isset($cats[$a['id_alias']]) ){
... | [
"public",
"function",
"dirs",
"(",
"$",
"code",
"=",
"false",
")",
"{",
"$",
"all",
"=",
"$",
"this",
"->",
"options",
"->",
"full_soptions",
"(",
"self",
"::",
"_dev_path",
"(",
")",
")",
";",
"$",
"cats",
"=",
"[",
"]",
";",
"$",
"r",
"=",
"[... | Make dirs' configurations
@param string|bool $code The dir's name (code)
@return array|bool | [
"Make",
"dirs",
"configurations"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L552-L581 |
20,511 | nabab/bbn | src/bbn/ide/directories.php | directories.set_preferences | public function set_preferences($id_user, $id_file, $md5, array $cfg = null, bbn\user\preferences $pref = null){
if ( !empty($id_user) && !empty($id_file) && !empty($pref) ){
$change['md5'] = $md5;
if ( !empty($cfg['selections']) ){
$change['selections'] = $cfg['selections'];
}
if ( ... | php | public function set_preferences($id_user, $id_file, $md5, array $cfg = null, bbn\user\preferences $pref = null){
if ( !empty($id_user) && !empty($id_file) && !empty($pref) ){
$change['md5'] = $md5;
if ( !empty($cfg['selections']) ){
$change['selections'] = $cfg['selections'];
}
if ( ... | [
"public",
"function",
"set_preferences",
"(",
"$",
"id_user",
",",
"$",
"id_file",
",",
"$",
"md5",
",",
"array",
"$",
"cfg",
"=",
"null",
",",
"bbn",
"\\",
"user",
"\\",
"preferences",
"$",
"pref",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"... | Sets user's preferences for a file.
@param string $id_user The user's id
@param string $id_file The file's id
@param string $md5 The file's md5
@param array|null $cfg
@param bbn\user\preferences|null $pref
@return bool | [
"Sets",
"user",
"s",
"preferences",
"for",
"a",
"file",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L944-L961 |
20,512 | nabab/bbn | src/bbn/ide/directories.php | directories.change_ext | public function change_ext($ext, $file){
if ( !empty($ext) &&
!empty($file) &&
file_exists($file)
){
$pi = pathinfo($file);
$new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext;
bbn\file\dir::move($file, $new, true);
return [
'file' => $new,
'file_url' => $this-... | php | public function change_ext($ext, $file){
if ( !empty($ext) &&
!empty($file) &&
file_exists($file)
){
$pi = pathinfo($file);
$new = $pi['dirname'].'/'.$pi['filename'].'.'.$ext;
bbn\file\dir::move($file, $new, true);
return [
'file' => $new,
'file_url' => $this-... | [
"public",
"function",
"change_ext",
"(",
"$",
"ext",
",",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"ext",
")",
"&&",
"!",
"empty",
"(",
"$",
"file",
")",
"&&",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"$",
"pi",
"=",
"... | Changes the extension to a file.
@param string $ext The new extension
@param string $file The file to change
@return array | [
"Changes",
"the",
"extension",
"to",
"a",
"file",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1576-L1590 |
20,513 | nabab/bbn | src/bbn/ide/directories.php | directories.history | public function history($url){
if ( !empty($url) &&
( $dir = $this->dir_from_url($url) ) &&
( $dir_cfg = $this->dir($dir) ) &&
\defined('BBN_USER_PATH')
){
$res = [];
$all = [];
// IDE backup path
$path = BBN_USER_PATH."ide/backup/$dir";
// Remove dir name from ur... | php | public function history($url){
if ( !empty($url) &&
( $dir = $this->dir_from_url($url) ) &&
( $dir_cfg = $this->dir($dir) ) &&
\defined('BBN_USER_PATH')
){
$res = [];
$all = [];
// IDE backup path
$path = BBN_USER_PATH."ide/backup/$dir";
// Remove dir name from ur... | [
"public",
"function",
"history",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"url",
")",
"&&",
"(",
"$",
"dir",
"=",
"$",
"this",
"->",
"dir_from_url",
"(",
"$",
"url",
")",
")",
"&&",
"(",
"$",
"dir_cfg",
"=",
"$",
"this",
... | Returns all backup history of a file.
@param string $url The file's URL
@return array|bool | [
"Returns",
"all",
"backup",
"history",
"of",
"a",
"file",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/ide/directories.php#L1819-L1867 |
20,514 | willhoffmann/domuserp-php | src/DataReceiver.php | DataReceiver.payload | public function payload(array $data)
{
foreach ($data as $key => $value) {
$this->data->{$key} = $value;
}
return $this;
} | php | public function payload(array $data)
{
foreach ($data as $key => $value) {
$this->data->{$key} = $value;
}
return $this;
} | [
"public",
"function",
"payload",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"{",
"$",
"key",
"}",
"=",
"$",
"value",
";",
"}",
"return",
"$"... | Payload the request
@param array $data
@return $this | [
"Payload",
"the",
"request"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/DataReceiver.php#L44-L51 |
20,515 | willhoffmann/domuserp-php | src/DataReceiver.php | DataReceiver.toArray | public function toArray()
{
$this->data->id = $this->id;
return json_decode(json_encode($this->data), true);
} | php | public function toArray()
{
$this->data->id = $this->id;
return json_decode(json_encode($this->data), true);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"id",
"=",
"$",
"this",
"->",
"id",
";",
"return",
"json_decode",
"(",
"json_encode",
"(",
"$",
"this",
"->",
"data",
")",
",",
"true",
")",
";",
"}"
] | Get the request data
@return array | [
"Get",
"the",
"request",
"data"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/DataReceiver.php#L58-L63 |
20,516 | Innmind/neo4j-dbal | src/Result/Result.php | Result.fromRaw | public static function fromRaw(array $response): self
{
$data = $response['data'] ?? [];
return new self(
self::buildNodes($data),
self::buildRelationships($data),
self::buildRows($response)
);
} | php | public static function fromRaw(array $response): self
{
$data = $response['data'] ?? [];
return new self(
self::buildNodes($data),
self::buildRelationships($data),
self::buildRows($response)
);
} | [
"public",
"static",
"function",
"fromRaw",
"(",
"array",
"$",
"response",
")",
":",
"self",
"{",
"$",
"data",
"=",
"$",
"response",
"[",
"'data'",
"]",
"??",
"[",
"]",
";",
"return",
"new",
"self",
"(",
"self",
"::",
"buildNodes",
"(",
"$",
"data",
... | Build a result object out of a standard neo4j rest api response
@param array $response
@return self | [
"Build",
"a",
"result",
"object",
"out",
"of",
"a",
"standard",
"neo4j",
"rest",
"api",
"response"
] | 12cb71e698cc0f4d55b7f2eb40f7b353c778a20b | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Result/Result.php#L38-L47 |
20,517 | willhoffmann/domuserp-php | src/Resources/Categories/Secondary/Subcategories.php | Subcategories.getList | public function getList(array $query = [])
{
$list = $this->pagination(
self::DOMUSERP_API_OPERACIONAL . '/categorias/' . $this->categoryId . '/subcategorias',
$query
);
return $list;
} | php | public function getList(array $query = [])
{
$list = $this->pagination(
self::DOMUSERP_API_OPERACIONAL . '/categorias/' . $this->categoryId . '/subcategorias',
$query
);
return $list;
} | [
"public",
"function",
"getList",
"(",
"array",
"$",
"query",
"=",
"[",
"]",
")",
"{",
"$",
"list",
"=",
"$",
"this",
"->",
"pagination",
"(",
"self",
"::",
"DOMUSERP_API_OPERACIONAL",
".",
"'/categorias/'",
".",
"$",
"this",
"->",
"categoryId",
".",
"'/s... | List of subcategories
@param array $query
@return array|string
@throws \GuzzleHttp\Exception\GuzzleException | [
"List",
"of",
"subcategories"
] | 44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6 | https://github.com/willhoffmann/domuserp-php/blob/44e77a4f02b0252bc26cae4c0e6b2b7d578f10a6/src/Resources/Categories/Secondary/Subcategories.php#L35-L43 |
20,518 | alevilar/ristorantino-vendor | Risto/Utility/WsPaxaposConnect.php | WsPaxaposConnect.__convertLindoArray | public static function __convertLindoArray($mesa){
$mesanew = $mesa['Mesa'];
unset($mesa['Mesa']);
foreach ( $mesa as $mkey=>$mvalue) {
$mesanew[$mkey] = $mvalue;
}
return $mesanew;
} | php | public static function __convertLindoArray($mesa){
$mesanew = $mesa['Mesa'];
unset($mesa['Mesa']);
foreach ( $mesa as $mkey=>$mvalue) {
$mesanew[$mkey] = $mvalue;
}
return $mesanew;
} | [
"public",
"static",
"function",
"__convertLindoArray",
"(",
"$",
"mesa",
")",
"{",
"$",
"mesanew",
"=",
"$",
"mesa",
"[",
"'Mesa'",
"]",
";",
"unset",
"(",
"$",
"mesa",
"[",
"'Mesa'",
"]",
")",
";",
"foreach",
"(",
"$",
"mesa",
"as",
"$",
"mkey",
"... | Hace un array para que sea compatible con la versin anterior del ristorantino
donde se enviaba un js con interval | [
"Hace",
"un",
"array",
"para",
"que",
"sea",
"compatible",
"con",
"la",
"versin",
"anterior",
"del",
"ristorantino",
"donde",
"se",
"enviaba",
"un",
"js",
"con",
"interval"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Utility/WsPaxaposConnect.php#L18-L28 |
20,519 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multiparts/multipart_related.php | ezcMailMultipartRelated.getRelatedParts | public function getRelatedParts()
{
if ( is_null( $this->getMainPart() ) )
{
return array_slice( $this->parts, 0 );
}
return array_slice( $this->parts, 1 );
} | php | public function getRelatedParts()
{
if ( is_null( $this->getMainPart() ) )
{
return array_slice( $this->parts, 0 );
}
return array_slice( $this->parts, 1 );
} | [
"public",
"function",
"getRelatedParts",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getMainPart",
"(",
")",
")",
")",
"{",
"return",
"array_slice",
"(",
"$",
"this",
"->",
"parts",
",",
"0",
")",
";",
"}",
"return",
"array_slice",
... | Returns the mail parts associated with this multipart.
@return array(ezcMailPart) | [
"Returns",
"the",
"mail",
"parts",
"associated",
"with",
"this",
"multipart",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multiparts/multipart_related.php#L125-L132 |
20,520 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multiparts/multipart_related.php | ezcMailMultipartRelated.getRelatedPartByID | public function getRelatedPartByID( $cid )
{
$parts = $this->getRelatedParts();
foreach ( $parts as $part )
{
if ( ( $part->getHeader( 'Content-ID' ) !== '' ) &&
( $part->getHeader( 'Content-ID' ) == "<$cid>" ) )
{
return $part;
... | php | public function getRelatedPartByID( $cid )
{
$parts = $this->getRelatedParts();
foreach ( $parts as $part )
{
if ( ( $part->getHeader( 'Content-ID' ) !== '' ) &&
( $part->getHeader( 'Content-ID' ) == "<$cid>" ) )
{
return $part;
... | [
"public",
"function",
"getRelatedPartByID",
"(",
"$",
"cid",
")",
"{",
"$",
"parts",
"=",
"$",
"this",
"->",
"getRelatedParts",
"(",
")",
";",
"foreach",
"(",
"$",
"parts",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"(",
"$",
"part",
"->",
"getHeader",
... | Returns the part associated with the passed Content-ID.
@param string $cid
@return ezcMailPart | [
"Returns",
"the",
"part",
"associated",
"with",
"the",
"passed",
"Content",
"-",
"ID",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parts/multiparts/multipart_related.php#L140-L152 |
20,521 | dflydev/dflydev-stack-firewall | src/Dflydev/Stack/Firewall/Matcher.php | Matcher.match | public function match(Request $request)
{
foreach ($this->firewalls as $firewall) {
if ($firewall['method'] !== null && $request->getMethod() !== $firewall['method']) {
continue;
}
if ($firewall['exact_match']) {
if ($request->getPathInfo(... | php | public function match(Request $request)
{
foreach ($this->firewalls as $firewall) {
if ($firewall['method'] !== null && $request->getMethod() !== $firewall['method']) {
continue;
}
if ($firewall['exact_match']) {
if ($request->getPathInfo(... | [
"public",
"function",
"match",
"(",
"Request",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"firewalls",
"as",
"$",
"firewall",
")",
"{",
"if",
"(",
"$",
"firewall",
"[",
"'method'",
"]",
"!==",
"null",
"&&",
"$",
"request",
"->",
"ge... | Find the matching path | [
"Find",
"the",
"matching",
"path"
] | eecaf0f2cd63104c726539bf713c72659142a81e | https://github.com/dflydev/dflydev-stack-firewall/blob/eecaf0f2cd63104c726539bf713c72659142a81e/src/Dflydev/Stack/Firewall/Matcher.php#L45-L62 |
20,522 | kossmoss/yii2-google-maps-api | GoogleMaps.php | GoogleMaps.map | public static function map($options = null)
{
if (empty(self::$_google)) {
self::$_google = new GoogleMapAPI();
self::$_google->_minify_js = false;
// Apply options
if (is_array($options)) {
foreach ($options as $key => $value) {
self::$_google->$key = $value;
}
};
}
r... | php | public static function map($options = null)
{
if (empty(self::$_google)) {
self::$_google = new GoogleMapAPI();
self::$_google->_minify_js = false;
// Apply options
if (is_array($options)) {
foreach ($options as $key => $value) {
self::$_google->$key = $value;
}
};
}
r... | [
"public",
"static",
"function",
"map",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"_google",
")",
")",
"{",
"self",
"::",
"$",
"_google",
"=",
"new",
"GoogleMapAPI",
"(",
")",
";",
"self",
"::",
"$",
"... | Returns GoogleMaps instance to work with
@param mixed $options Map options array
@return GoogleMapAPI | [
"Returns",
"GoogleMaps",
"instance",
"to",
"work",
"with"
] | 8a994c173031d7ece3cfedd30b971258616579d2 | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/GoogleMaps.php#L57-L72 |
20,523 | kossmoss/yii2-google-maps-api | GoogleMaps.php | GoogleMaps.coordsByAddress | public static function coordsByAddress($searchString)
{
$result = false;
try {
// we must be sure we don't send queries too frequently to avoid be banned by Google Maps API
if (self::$_googleTimeout != 0) {
$timeToWait = self::$_lastGoogleSearchTime + self::$_googleTimeout - time();
if ($timeT... | php | public static function coordsByAddress($searchString)
{
$result = false;
try {
// we must be sure we don't send queries too frequently to avoid be banned by Google Maps API
if (self::$_googleTimeout != 0) {
$timeToWait = self::$_lastGoogleSearchTime + self::$_googleTimeout - time();
if ($timeT... | [
"public",
"static",
"function",
"coordsByAddress",
"(",
"$",
"searchString",
")",
"{",
"$",
"result",
"=",
"false",
";",
"try",
"{",
"// we must be sure we don't send queries too frequently to avoid be banned by Google Maps API\r",
"if",
"(",
"self",
"::",
"$",
"_googleTi... | Search coordinates by address
@param string $searchString search query with address
@return array|bool | [
"Search",
"coordinates",
"by",
"address"
] | 8a994c173031d7ece3cfedd30b971258616579d2 | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/GoogleMaps.php#L80-L106 |
20,524 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.callEvent | public function callEvent($event_name)
{
$classname = get_called_class();
if (!isset(static::$callbacks[$classname][$event_name])) {
return;
}
foreach (static::$callbacks[$classname][$event_name] as $callback) {
$callback($this);
}
} | php | public function callEvent($event_name)
{
$classname = get_called_class();
if (!isset(static::$callbacks[$classname][$event_name])) {
return;
}
foreach (static::$callbacks[$classname][$event_name] as $callback) {
$callback($this);
}
} | [
"public",
"function",
"callEvent",
"(",
"$",
"event_name",
")",
"{",
"$",
"classname",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"callbacks",
"[",
"$",
"classname",
"]",
"[",
"$",
"event_name",
"]",
")",... | Call an event on this entity, calling the registering
callbacks.
@param string $event_name | [
"Call",
"an",
"event",
"on",
"this",
"entity",
"calling",
"the",
"registering",
"callbacks",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L184-L194 |
20,525 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.getRelation | public function getRelation($name)
{
if (array_key_exists($name, $this->relation_objects)) {
return $this->relation_objects[$name];
}
$relation = self::getRelationDefinition($name);
$this->relation_objects[$name] = $this->fetchRelation($relation);
return $this-... | php | public function getRelation($name)
{
if (array_key_exists($name, $this->relation_objects)) {
return $this->relation_objects[$name];
}
$relation = self::getRelationDefinition($name);
$this->relation_objects[$name] = $this->fetchRelation($relation);
return $this-... | [
"public",
"function",
"getRelation",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"relation_objects",
")",
")",
"{",
"return",
"$",
"this",
"->",
"relation_objects",
"[",
"$",
"name",
"]",
";",
"}... | Get the named related object. If the database has not been
queried it will be fetched automatically. If the database has
been queried the original result will be returned.
@param string $name The name of the relation | [
"Get",
"the",
"named",
"related",
"object",
".",
"If",
"the",
"database",
"has",
"not",
"been",
"queried",
"it",
"will",
"be",
"fetched",
"automatically",
".",
"If",
"the",
"database",
"has",
"been",
"queried",
"the",
"original",
"result",
"will",
"be",
"r... | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L262-L273 |
20,526 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.fetchRelation | protected function fetchRelation(array $relation)
{
/* a relation is of the form
* [$type, $foreign_class, $foreign_column, $column]
*/
list($type, $foreign_class, $foreign_column, $column) = $relation;
switch ($type) {
case 'has_one':
return $this->fet... | php | protected function fetchRelation(array $relation)
{
/* a relation is of the form
* [$type, $foreign_class, $foreign_column, $column]
*/
list($type, $foreign_class, $foreign_column, $column) = $relation;
switch ($type) {
case 'has_one':
return $this->fet... | [
"protected",
"function",
"fetchRelation",
"(",
"array",
"$",
"relation",
")",
"{",
"/* a relation is of the form\n * [$type, $foreign_class, $foreign_column, $column]\n */",
"list",
"(",
"$",
"type",
",",
"$",
"foreign_class",
",",
"$",
"foreign_column",
",",
... | Fetch a related entity from the database.
@param array $relation The relation to fetch. | [
"Fetch",
"a",
"related",
"entity",
"from",
"the",
"database",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L327-L343 |
20,527 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.fetchOneToOne | protected function fetchOneToOne($foreign_class, $foreign_column, $column)
{
return $foreign_class::selectOne($this->connection)
->where($foreign_column, '=', $this->getRaw($column))
->execute();
} | php | protected function fetchOneToOne($foreign_class, $foreign_column, $column)
{
return $foreign_class::selectOne($this->connection)
->where($foreign_column, '=', $this->getRaw($column))
->execute();
} | [
"protected",
"function",
"fetchOneToOne",
"(",
"$",
"foreign_class",
",",
"$",
"foreign_column",
",",
"$",
"column",
")",
"{",
"return",
"$",
"foreign_class",
"::",
"selectOne",
"(",
"$",
"this",
"->",
"connection",
")",
"->",
"where",
"(",
"$",
"foreign_col... | Query the database for a one to one relationship.
@param string $foreign_class The class name of the related entity
@param string $foreign_column The name of the column on the other table
@param string $column The name of column on this table | [
"Query",
"the",
"database",
"for",
"a",
"one",
"to",
"one",
"relationship",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L352-L357 |
20,528 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.fetchOneToMany | protected function fetchOneToMany($foreign_class, $foreign_column, $column)
{
return $foreign_class::select($this->connection)
->where($foreign_column, '=', $this->getRaw($column))
->execute();
} | php | protected function fetchOneToMany($foreign_class, $foreign_column, $column)
{
return $foreign_class::select($this->connection)
->where($foreign_column, '=', $this->getRaw($column))
->execute();
} | [
"protected",
"function",
"fetchOneToMany",
"(",
"$",
"foreign_class",
",",
"$",
"foreign_column",
",",
"$",
"column",
")",
"{",
"return",
"$",
"foreign_class",
"::",
"select",
"(",
"$",
"this",
"->",
"connection",
")",
"->",
"where",
"(",
"$",
"foreign_colum... | Query the database for a one to many relationship.
@param string $foreign_class The class name of the related entity
@param string $foreign_column The name of the column on the other table
@param string $column The name of column on this table | [
"Query",
"the",
"database",
"for",
"a",
"one",
"to",
"many",
"relationship",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L366-L371 |
20,529 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.getValues | public function getValues()
{
$return = array();
foreach ($this->values as $k => $v) {
$return[$k] = $this->get($k);
}
return $return;
} | php | public function getValues()
{
$return = array();
foreach ($this->values as $k => $v) {
$return[$k] = $this->get($k);
}
return $return;
} | [
"public",
"function",
"getValues",
"(",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"return",
"[",
"$",
"k",
"]",
"=",
"$",
"this",
"->",
"g... | Get all values. Getter methods will be called on the values.
@return array The values | [
"Get",
"all",
"values",
".",
"Getter",
"methods",
"will",
"be",
"called",
"on",
"the",
"values",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L378-L386 |
20,530 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.setRelation | public function setRelation($name, $related_object)
{
//if no related object is supplied, set it to false (an array
//value of null will not pass an isset() check on the
//relation_objects array).
if (!$related_object) {
$related_object = false;
}
$this->... | php | public function setRelation($name, $related_object)
{
//if no related object is supplied, set it to false (an array
//value of null will not pass an isset() check on the
//relation_objects array).
if (!$related_object) {
$related_object = false;
}
$this->... | [
"public",
"function",
"setRelation",
"(",
"$",
"name",
",",
"$",
"related_object",
")",
"{",
"//if no related object is supplied, set it to false (an array",
"//value of null will not pass an isset() check on the",
"//relation_objects array).",
"if",
"(",
"!",
"$",
"related_objec... | Set the named related object.
@param string $name The name of the relation
@param mixed $related_object The related object | [
"Set",
"the",
"named",
"related",
"object",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L451-L461 |
20,531 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.unsetRelation | public function unsetRelation($name, $value)
{
list($type, $foreign_class, $foreign_column, $column) = static::getRelationDefinition($name);
//no need to get the relation, the column is on this object.
if ($type === 'belongs_to') {
$this->setRaw($column, $value);
$th... | php | public function unsetRelation($name, $value)
{
list($type, $foreign_class, $foreign_column, $column) = static::getRelationDefinition($name);
//no need to get the relation, the column is on this object.
if ($type === 'belongs_to') {
$this->setRaw($column, $value);
$th... | [
"public",
"function",
"unsetRelation",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"list",
"(",
"$",
"type",
",",
"$",
"foreign_class",
",",
"$",
"foreign_column",
",",
"$",
"column",
")",
"=",
"static",
"::",
"getRelationDefinition",
"(",
"$",
"name"... | Unset a related object and assign the joining column a
value. If the related object has not been fetched, it will be
fetched and the joining column changed.
@param string $name The name of the relation
@param mixed $value The value to assign to the joining column | [
"Unset",
"a",
"related",
"object",
"and",
"assign",
"the",
"joining",
"column",
"a",
"value",
".",
"If",
"the",
"related",
"object",
"has",
"not",
"been",
"fetched",
"it",
"will",
"be",
"fetched",
"and",
"the",
"joining",
"column",
"changed",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L500-L532 |
20,532 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.setValues | public function setValues(array $values = array())
{
foreach ($values as $k => $v) {
$this->set($k, $v);
}
return $this;
} | php | public function setValues(array $values = array())
{
foreach ($values as $k => $v) {
$this->set($k, $v);
}
return $this;
} | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"k",
",",
"$",
"v",
")",
";",
"}",
... | Set an array of values. Setter methods will be called if they
exist.
@param array $values The array of values to set | [
"Set",
"an",
"array",
"of",
"values",
".",
"Setter",
"methods",
"will",
"be",
"called",
"if",
"they",
"exist",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L540-L547 |
20,533 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.setValuesRaw | public function setValuesRaw($values = array())
{
foreach ($values as $key => $value) {
$this->setRaw($key, $value);
}
return $this;
} | php | public function setValuesRaw($values = array())
{
foreach ($values as $key => $value) {
$this->setRaw($key, $value);
}
return $this;
} | [
"public",
"function",
"setValuesRaw",
"(",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setRaw",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
... | Set an array of values. Setter methods will not be called.
@param array $values The array of values to set | [
"Set",
"an",
"array",
"of",
"values",
".",
"Setter",
"methods",
"will",
"not",
"be",
"called",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L554-L561 |
20,534 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.insert | public function insert()
{
if ($this->stored) {
throw new \LogicException("You may not insert an already stored entity");
}
$this->callEvent('insert');
if (empty($this->modified)) {
return;
}
$values = array_intersect_key($this->values, $thi... | php | public function insert()
{
if ($this->stored) {
throw new \LogicException("You may not insert an already stored entity");
}
$this->callEvent('insert');
if (empty($this->modified)) {
return;
}
$values = array_intersect_key($this->values, $thi... | [
"public",
"function",
"insert",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stored",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"You may not insert an already stored entity\"",
")",
";",
"}",
"$",
"this",
"->",
"callEvent",
"(",
"'insert'",
"... | Persist this entity to the database using an insert query. | [
"Persist",
"this",
"entity",
"to",
"the",
"database",
"using",
"an",
"insert",
"query",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L603-L620 |
20,535 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.getPrimaryKey | protected function getPrimaryKey()
{
if (!isset($this->values[static::$primary_key])) {
throw new \LogicException('Primary key not set');
}
return $this->current_index ?: $this->values[static::$primary_key];
} | php | protected function getPrimaryKey()
{
if (!isset($this->values[static::$primary_key])) {
throw new \LogicException('Primary key not set');
}
return $this->current_index ?: $this->values[static::$primary_key];
} | [
"protected",
"function",
"getPrimaryKey",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"static",
"::",
"$",
"primary_key",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Primary key not set'",
")",
";... | Get the primary key for this entity as it is stored in the
database. If the key has been updated but not saved, the
original value will be returned.
@return string The primary key of the entity | [
"Get",
"the",
"primary",
"key",
"for",
"this",
"entity",
"as",
"it",
"is",
"stored",
"in",
"the",
"database",
".",
"If",
"the",
"key",
"has",
"been",
"updated",
"but",
"not",
"saved",
"the",
"original",
"value",
"will",
"be",
"returned",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L629-L636 |
20,536 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.update | public function update()
{
$this->callEvent('update');
if (empty($this->modified)) {
return;
}
$values = array_intersect_key($this->values, $this->modified);
$where = [static::$primary_key => $this->getPrimaryKey()];
$this->connection->update(static::$tab... | php | public function update()
{
$this->callEvent('update');
if (empty($this->modified)) {
return;
}
$values = array_intersect_key($this->values, $this->modified);
$where = [static::$primary_key => $this->getPrimaryKey()];
$this->connection->update(static::$tab... | [
"public",
"function",
"update",
"(",
")",
"{",
"$",
"this",
"->",
"callEvent",
"(",
"'update'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"modified",
")",
")",
"{",
"return",
";",
"}",
"$",
"values",
"=",
"array_intersect_key",
"(",
"$",
... | Update this entity in the database. | [
"Update",
"this",
"entity",
"in",
"the",
"database",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L649-L660 |
20,537 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.setStored | public function setStored($stored = true)
{
$this->stored = (bool) $stored;
$this->modified = $stored ? [] : $this->values;
return $this;
} | php | public function setStored($stored = true)
{
$this->stored = (bool) $stored;
$this->modified = $stored ? [] : $this->values;
return $this;
} | [
"public",
"function",
"setStored",
"(",
"$",
"stored",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"stored",
"=",
"(",
"bool",
")",
"$",
"stored",
";",
"$",
"this",
"->",
"modified",
"=",
"$",
"stored",
"?",
"[",
"]",
":",
"$",
"this",
"->",
"value... | Set whether this entity is stored in the database or not.
@param bool $stored True if stored, false if not | [
"Set",
"whether",
"this",
"entity",
"is",
"stored",
"in",
"the",
"database",
"or",
"not",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L667-L673 |
20,538 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.delete | public function delete()
{
$where = [static::$primary_key => $this->getPrimaryKey()];
$this->connection->delete(static::$table, $where);
$this->setStored(false);
return $this;
} | php | public function delete()
{
$where = [static::$primary_key => $this->getPrimaryKey()];
$this->connection->delete(static::$table, $where);
$this->setStored(false);
return $this;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"where",
"=",
"[",
"static",
"::",
"$",
"primary_key",
"=>",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
"]",
";",
"$",
"this",
"->",
"connection",
"->",
"delete",
"(",
"static",
"::",
"$",
"table... | Delete this entity from the database.
@return Entity This entity | [
"Delete",
"this",
"entity",
"from",
"the",
"database",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L699-L707 |
20,539 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.create | public static function create(Connection $connection, $amount = 0)
{
$entities = [];
for ($i = 0; $i < (int) $amount; $i++) {
$entities[] = new static($connection);
}
return static::newCollection($entities);
} | php | public static function create(Connection $connection, $amount = 0)
{
$entities = [];
for ($i = 0; $i < (int) $amount; $i++) {
$entities[] = new static($connection);
}
return static::newCollection($entities);
} | [
"public",
"static",
"function",
"create",
"(",
"Connection",
"$",
"connection",
",",
"$",
"amount",
"=",
"0",
")",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"(",
"int",
")",
"$",
"amount",
";"... | Create a new collection with an amount of empty entities.
@param Connection $connection A connection instance
@param int $amount The amount of new Entities to create | [
"Create",
"a",
"new",
"collection",
"with",
"an",
"amount",
"of",
"empty",
"entities",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L737-L745 |
20,540 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.selectSQL | public static function selectSQL(Connection $connection, $sql, array $parameters = [], array $field_mapping = [])
{
$stmt = $connection->prepare($sql);
$stmt->execute($parameters);
$results = array();
while ($result = $stmt->fetch()) {
foreach ($field_mapping as $result_c... | php | public static function selectSQL(Connection $connection, $sql, array $parameters = [], array $field_mapping = [])
{
$stmt = $connection->prepare($sql);
$stmt->execute($parameters);
$results = array();
while ($result = $stmt->fetch()) {
foreach ($field_mapping as $result_c... | [
"public",
"static",
"function",
"selectSQL",
"(",
"Connection",
"$",
"connection",
",",
"$",
"sql",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"field_mapping",
"=",
"[",
"]",
")",
"{",
"$",
"stmt",
"=",
"$",
"connection",
"->",
... | Select all entities matching an SQL query, and return the
results as a collection.
@param Connection $connection A connection instance
@param string $sql The SQL query
@param array $parameters Any bound parameters required for the query
@param array $field_mapping An array of result columns ... | [
"Select",
"all",
"entities",
"matching",
"an",
"SQL",
"query",
"and",
"return",
"the",
"results",
"as",
"a",
"collection",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L758-L786 |
20,541 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.selectOneSQL | public static function selectOneSQL(Connection $connection, $sql, array $parameters = [], array $field_mapping = [])
{
$stmt = $connection->prepare($sql);
$stmt->execute($parameters);
$result = $stmt->fetch();
if ($result) {
foreach ($field_mapping as $result_column => $e... | php | public static function selectOneSQL(Connection $connection, $sql, array $parameters = [], array $field_mapping = [])
{
$stmt = $connection->prepare($sql);
$stmt->execute($parameters);
$result = $stmt->fetch();
if ($result) {
foreach ($field_mapping as $result_column => $e... | [
"public",
"static",
"function",
"selectOneSQL",
"(",
"Connection",
"$",
"connection",
",",
"$",
"sql",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"field_mapping",
"=",
"[",
"]",
")",
"{",
"$",
"stmt",
"=",
"$",
"connection",
"->... | Select a single entity matching an SQL query. If more than one
row is matched by the query, only the first entity will be
returned.
@param Connection $connection A connection instance
@param string $sql The SQL query
@param array $parameters Any bound parameters required for the query
@param a... | [
"Select",
"a",
"single",
"entity",
"matching",
"an",
"SQL",
"query",
".",
"If",
"more",
"than",
"one",
"row",
"is",
"matched",
"by",
"the",
"query",
"only",
"the",
"first",
"entity",
"will",
"be",
"returned",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L800-L825 |
20,542 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.select | public static function select(Connection $connection)
{
return new EntitySelector(AbstractSelector::fromConnection($connection, static::$table, static::$types), get_called_class());
} | php | public static function select(Connection $connection)
{
return new EntitySelector(AbstractSelector::fromConnection($connection, static::$table, static::$types), get_called_class());
} | [
"public",
"static",
"function",
"select",
"(",
"Connection",
"$",
"connection",
")",
"{",
"return",
"new",
"EntitySelector",
"(",
"AbstractSelector",
"::",
"fromConnection",
"(",
"$",
"connection",
",",
"static",
"::",
"$",
"table",
",",
"static",
"::",
"$",
... | Select entities using an EntitySelector instance.
@param Connection $connection A connection instance
@return EntitySelector A selector instance | [
"Select",
"entities",
"using",
"an",
"EntitySelector",
"instance",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L833-L836 |
20,543 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.selectOne | public static function selectOne(Connection $connection)
{
$selector = new EntitySelector(AbstractSelector::fromConnection($connection, static::$table, static::$types), get_called_class());
return $selector->one();
} | php | public static function selectOne(Connection $connection)
{
$selector = new EntitySelector(AbstractSelector::fromConnection($connection, static::$table, static::$types), get_called_class());
return $selector->one();
} | [
"public",
"static",
"function",
"selectOne",
"(",
"Connection",
"$",
"connection",
")",
"{",
"$",
"selector",
"=",
"new",
"EntitySelector",
"(",
"AbstractSelector",
"::",
"fromConnection",
"(",
"$",
"connection",
",",
"static",
"::",
"$",
"table",
",",
"static... | Select a single entity using an EntitySelector instance.
@param Connection $connection A connection instance
@return EntitySelector A selector instance | [
"Select",
"a",
"single",
"entity",
"using",
"an",
"EntitySelector",
"instance",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L844-L849 |
20,544 | glynnforrest/active-doctrine | src/ActiveDoctrine/Entity/Entity.php | Entity.selectPrimaryKey | public static function selectPrimaryKey(Connection $connection, $primary_key)
{
return static::selectOne($connection)
->where(static::$primary_key, $primary_key)
->execute();
} | php | public static function selectPrimaryKey(Connection $connection, $primary_key)
{
return static::selectOne($connection)
->where(static::$primary_key, $primary_key)
->execute();
} | [
"public",
"static",
"function",
"selectPrimaryKey",
"(",
"Connection",
"$",
"connection",
",",
"$",
"primary_key",
")",
"{",
"return",
"static",
"::",
"selectOne",
"(",
"$",
"connection",
")",
"->",
"where",
"(",
"static",
"::",
"$",
"primary_key",
",",
"$",... | Select a single entity matching a primary key.
@param Connection $connection A connection instance
@param mixed $primary_key The primary key
@return Entity|null The entity, or null if not found | [
"Select",
"a",
"single",
"entity",
"matching",
"a",
"primary",
"key",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Entity/Entity.php#L858-L863 |
20,545 | alevilar/ristorantino-vendor | Mesa/Controller/MozosController.php | MozosController.mesas_abiertas | public function mesas_abiertas( $microtime = 0 ) {
$lastAccess = null;
$type = 'created';
if ( $microtime != 0 ) {
$type = 'modified';
$lastAccess = $this->Session->read('lastAccess');
// setear el nuevo lastAccess
... | php | public function mesas_abiertas( $microtime = 0 ) {
$lastAccess = null;
$type = 'created';
if ( $microtime != 0 ) {
$type = 'modified';
$lastAccess = $this->Session->read('lastAccess');
// setear el nuevo lastAccess
... | [
"public",
"function",
"mesas_abiertas",
"(",
"$",
"microtime",
"=",
"0",
")",
"{",
"$",
"lastAccess",
"=",
"null",
";",
"$",
"type",
"=",
"'created'",
";",
"if",
"(",
"$",
"microtime",
"!=",
"0",
")",
"{",
"$",
"type",
"=",
"'modified'",
";",
"$",
... | Me devuelve las mesas abiertas de cada mozo
@param boolean $microtime microtime desde donde yo quiero tomar omo referencia a la hora de traer las mesas | [
"Me",
"devuelve",
"las",
"mesas",
"abiertas",
"de",
"cada",
"mozo"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Mesa/Controller/MozosController.php#L108-L137 |
20,546 | ouropencode/dachi | src/Logger.php | Logger.handle_error | public static function handle_error($errno, $errstr, $errfile, $errline) {
if (!(error_reporting() & $errno))
return false;
self::error(sprintf("%s [%s] %s. Line: %s. File: %s", human_error_code($errno), $errno, $errstr, $errline, $errfile));
return true;
} | php | public static function handle_error($errno, $errstr, $errfile, $errline) {
if (!(error_reporting() & $errno))
return false;
self::error(sprintf("%s [%s] %s. Line: %s. File: %s", human_error_code($errno), $errno, $errstr, $errline, $errfile));
return true;
} | [
"public",
"static",
"function",
"handle_error",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"if",
"(",
"!",
"(",
"error_reporting",
"(",
")",
"&",
"$",
"errno",
")",
")",
"return",
"false",
";",
"self",
... | This function is called when a PHP error occurs. It is unadivsed to call
this function manually.
@internal
@param int $errno The error number
@param string $errstr The error message
@param string $errfile The file that caused the error
@param int $errline The line that caused the error
@return bool | [
"This",
"function",
"is",
"called",
"when",
"a",
"PHP",
"error",
"occurs",
".",
"It",
"is",
"unadivsed",
"to",
"call",
"this",
"function",
"manually",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Logger.php#L93-L99 |
20,547 | ouropencode/dachi | src/Logger.php | Logger.filament | private static function filament($type, $arguments) {
$uniqId = md5($type . json_encode($arguments));
if(isset(self::$log[$uniqId]))
return ++self::$log[$uniqId]["count"];
self::$log[$uniqId] = array(
"count" => 1,
"type" => $type,
"arguments" => $arguments
);
return true;
} | php | private static function filament($type, $arguments) {
$uniqId = md5($type . json_encode($arguments));
if(isset(self::$log[$uniqId]))
return ++self::$log[$uniqId]["count"];
self::$log[$uniqId] = array(
"count" => 1,
"type" => $type,
"arguments" => $arguments
);
return true;
} | [
"private",
"static",
"function",
"filament",
"(",
"$",
"type",
",",
"$",
"arguments",
")",
"{",
"$",
"uniqId",
"=",
"md5",
"(",
"$",
"type",
".",
"json_encode",
"(",
"$",
"arguments",
")",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"log"... | Add a log entry to the filament log. This log is sent to the filament
server after script execution.
@internal
@param string $type The log message.
@param array $arguments An array of the log arguments.
@return bool | [
"Add",
"a",
"log",
"entry",
"to",
"the",
"filament",
"log",
".",
"This",
"log",
"is",
"sent",
"to",
"the",
"filament",
"server",
"after",
"script",
"execution",
"."
] | a0e1daf269d0345afbb859ce20ef9da6decd7efe | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Logger.php#L128-L140 |
20,548 | hametuha/wpametu | src/WPametu/Utility/StringHelper.php | StringHelper.hyphen_to_camel | public function hyphen_to_camel( $string, $upper_first = false ) {
$str = preg_replace_callback( '/-(.)/u', function ( $match ) {
return strtoupper( $match[1] );
}, strtolower( $string ) );
if ( $upper_first ) {
$str = ucfirst( $str );
}
return $str;
} | php | public function hyphen_to_camel( $string, $upper_first = false ) {
$str = preg_replace_callback( '/-(.)/u', function ( $match ) {
return strtoupper( $match[1] );
}, strtolower( $string ) );
if ( $upper_first ) {
$str = ucfirst( $str );
}
return $str;
} | [
"public",
"function",
"hyphen_to_camel",
"(",
"$",
"string",
",",
"$",
"upper_first",
"=",
"false",
")",
"{",
"$",
"str",
"=",
"preg_replace_callback",
"(",
"'/-(.)/u'",
",",
"function",
"(",
"$",
"match",
")",
"{",
"return",
"strtoupper",
"(",
"$",
"match... | Make hyphenated string to camel case
@param string $string
@param bool $upper_first Retuns Uppercase first letter if true. Defalt false.
@return string | [
"Make",
"hyphenated",
"string",
"to",
"camel",
"case"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/StringHelper.php#L36-L45 |
20,549 | hametuha/wpametu | src/WPametu/Utility/StringHelper.php | StringHelper.post_type_label | public function post_type_label( $singular_name, $multiple_name = '', $as_object = false ) {
if ( ! $multiple_name ) {
$multiple_name = $singular_name;
}
$labels = [
'name' => $multiple_name,
'singular_name' => $singular_name,
'add_new' => $this->__( 'Add new' ),
'add_... | php | public function post_type_label( $singular_name, $multiple_name = '', $as_object = false ) {
if ( ! $multiple_name ) {
$multiple_name = $singular_name;
}
$labels = [
'name' => $multiple_name,
'singular_name' => $singular_name,
'add_new' => $this->__( 'Add new' ),
'add_... | [
"public",
"function",
"post_type_label",
"(",
"$",
"singular_name",
",",
"$",
"multiple_name",
"=",
"''",
",",
"$",
"as_object",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"multiple_name",
")",
"{",
"$",
"multiple_name",
"=",
"$",
"singular_name",
";",
... | Returns post type label shorthand.
@param string $singular_name
@param string $multiple_name Optional.
@param bool $as_object
@return array|\stdClass | [
"Returns",
"post",
"type",
"label",
"shorthand",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/StringHelper.php#L107-L129 |
20,550 | hametuha/wpametu | src/WPametu/Utility/StringHelper.php | StringHelper.get_taxonomy_label | public function get_taxonomy_label( $singular_name, $multiple_name = '', $hierarchical = false, $as_object = false ) {
if ( ! $multiple_name ) {
$multiple_name = $singular_name;
}
$labels = [
'name' => $multiple_name,
'singular_name' => $singular_name,
'search_items'... | php | public function get_taxonomy_label( $singular_name, $multiple_name = '', $hierarchical = false, $as_object = false ) {
if ( ! $multiple_name ) {
$multiple_name = $singular_name;
}
$labels = [
'name' => $multiple_name,
'singular_name' => $singular_name,
'search_items'... | [
"public",
"function",
"get_taxonomy_label",
"(",
"$",
"singular_name",
",",
"$",
"multiple_name",
"=",
"''",
",",
"$",
"hierarchical",
"=",
"false",
",",
"$",
"as_object",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"multiple_name",
")",
"{",
"$",
"mult... | Returns taxonomy label shorthand.
@param string $singular_name
@param string $multiple_name If empty, singular_name will be used.
@param bool $hierarchical Default false.
@param bool $as_object Default false. If true, returns as Object
@return array|\stdClass | [
"Returns",
"taxonomy",
"label",
"shorthand",
"."
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/StringHelper.php#L142-L166 |
20,551 | hametuha/wpametu | src/WPametu/Utility/StringHelper.php | StringHelper.extract_host | public function extract_host( $url ) {
$string = (string) $url;
if ( preg_match( '@https?://([^/\?#]+)@u', $url, $match ) ) {
return $match[1];
} else {
return $url;
}
} | php | public function extract_host( $url ) {
$string = (string) $url;
if ( preg_match( '@https?://([^/\?#]+)@u', $url, $match ) ) {
return $match[1];
} else {
return $url;
}
} | [
"public",
"function",
"extract_host",
"(",
"$",
"url",
")",
"{",
"$",
"string",
"=",
"(",
"string",
")",
"$",
"url",
";",
"if",
"(",
"preg_match",
"(",
"'@https?://([^/\\?#]+)@u'",
",",
"$",
"url",
",",
"$",
"match",
")",
")",
"{",
"return",
"$",
"ma... | Extract host value from url
@param string $url
@return string | [
"Extract",
"host",
"value",
"from",
"url"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/StringHelper.php#L175-L182 |
20,552 | ekuiter/feature-php | FeaturePhp/Model/Model.php | Model.getFeature | public function getFeature($featureName, $permissive = false) {
$feature = Feature::findByName($this->features, $featureName, $permissive);
if (!$feature)
throw new ModelException("the model has no feature named \"$featureName\"");
return $feature;
} | php | public function getFeature($featureName, $permissive = false) {
$feature = Feature::findByName($this->features, $featureName, $permissive);
if (!$feature)
throw new ModelException("the model has no feature named \"$featureName\"");
return $feature;
} | [
"public",
"function",
"getFeature",
"(",
"$",
"featureName",
",",
"$",
"permissive",
"=",
"false",
")",
"{",
"$",
"feature",
"=",
"Feature",
"::",
"findByName",
"(",
"$",
"this",
"->",
"features",
",",
"$",
"featureName",
",",
"$",
"permissive",
")",
";"... | Returns a feature in the feature model with a given name.
@param string $featureName
@param bool $permissive
@return Feature | [
"Returns",
"a",
"feature",
"in",
"the",
"feature",
"model",
"with",
"a",
"given",
"name",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Model/Model.php#L72-L77 |
20,553 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_oracle.php | ezcQuerySelectOracle.prepare | public function prepare()
{
if ( $this->fromString == null || $this->fromString == '' )
{
$this->from( $this->getDummyTableName() );
}
return parent::prepare();
} | php | public function prepare()
{
if ( $this->fromString == null || $this->fromString == '' )
{
$this->from( $this->getDummyTableName() );
}
return parent::prepare();
} | [
"public",
"function",
"prepare",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fromString",
"==",
"null",
"||",
"$",
"this",
"->",
"fromString",
"==",
"''",
")",
"{",
"$",
"this",
"->",
"from",
"(",
"$",
"this",
"->",
"getDummyTableName",
"(",
")",
... | Handles preparing query.
Overrides ezcQuery->prepare()
Adds "FROM dual" to the select if no FROM clause specified
i.e. fixes queries like "SELECT 1+1" to work in Oracle.
@return PDOStatement | [
"Handles",
"preparing",
"query",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/query_select_oracle.php#L170-L177 |
20,554 | hametuha/wpametu | src/WPametu/Utility/Formatter.php | Formatter.to_string | public static function to_string( \DOMDocument $dom ) {
$html5 = new HTML5();
preg_match( '/<body>(.*)<\/body>/s', $html5->saveHTML( $dom ), $match );
return $match[1];
} | php | public static function to_string( \DOMDocument $dom ) {
$html5 = new HTML5();
preg_match( '/<body>(.*)<\/body>/s', $html5->saveHTML( $dom ), $match );
return $match[1];
} | [
"public",
"static",
"function",
"to_string",
"(",
"\\",
"DOMDocument",
"$",
"dom",
")",
"{",
"$",
"html5",
"=",
"new",
"HTML5",
"(",
")",
";",
"preg_match",
"(",
"'/<body>(.*)<\\/body>/s'",
",",
"$",
"html5",
"->",
"saveHTML",
"(",
"$",
"dom",
")",
",",
... | Return body as string
@param \DOMDocument $dom
@return mixed | [
"Return",
"body",
"as",
"string"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Utility/Formatter.php#L45-L50 |
20,555 | ekuiter/feature-php | FeaturePhp/Collaboration/ClassComposer.php | ClassComposer.refine | public function refine($role) {
$fileSource = $role->getFileSpecification()->getSource();
$parser = (new fphp\Helper\PhpParser())->parseFile($fileSource);
$ast = $parser->getAst();
$class = $parser->getExactlyOneClass($fileSource);
if (!$this->targetClass) { // not refining, but... | php | public function refine($role) {
$fileSource = $role->getFileSpecification()->getSource();
$parser = (new fphp\Helper\PhpParser())->parseFile($fileSource);
$ast = $parser->getAst();
$class = $parser->getExactlyOneClass($fileSource);
if (!$this->targetClass) { // not refining, but... | [
"public",
"function",
"refine",
"(",
"$",
"role",
")",
"{",
"$",
"fileSource",
"=",
"$",
"role",
"->",
"getFileSpecification",
"(",
")",
"->",
"getSource",
"(",
")",
";",
"$",
"parser",
"=",
"(",
"new",
"fphp",
"\\",
"Helper",
"\\",
"PhpParser",
"(",
... | Returns a new class composer containing a role's refinements.
@param Role $role
@return ClassComposer | [
"Returns",
"a",
"new",
"class",
"composer",
"containing",
"a",
"role",
"s",
"refinements",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Collaboration/ClassComposer.php#L90-L110 |
20,556 | ekuiter/feature-php | FeaturePhp/Collaboration/ClassComposer.php | ClassComposer.getContent | public function getContent() {
$class = new \PhpParser\Node\Stmt\Class_($this->targetClass);
$this->extendClass($class);
$ast = array_merge($this->ast, array($class));
$code = fphp\Helper\PhpParser::astToString($ast);
return new fphp\File\TextFileContent($code);
} | php | public function getContent() {
$class = new \PhpParser\Node\Stmt\Class_($this->targetClass);
$this->extendClass($class);
$ast = array_merge($this->ast, array($class));
$code = fphp\Helper\PhpParser::astToString($ast);
return new fphp\File\TextFileContent($code);
} | [
"public",
"function",
"getContent",
"(",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"PhpParser",
"\\",
"Node",
"\\",
"Stmt",
"\\",
"Class_",
"(",
"$",
"this",
"->",
"targetClass",
")",
";",
"$",
"this",
"->",
"extendClass",
"(",
"$",
"class",
")",
";"... | Returns the refined file's content.
@return \FeaturePhp\File\TextFileContent | [
"Returns",
"the",
"refined",
"file",
"s",
"content",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Collaboration/ClassComposer.php#L116-L122 |
20,557 | surebert/surebert-framework | src/sb/Controller/Toolkit.php | Toolkit.grabFile | protected function grabFile($file, $root)
{
$data = '';
if (is_file($root . '/' . $file)) {
$this->loaded_files[] = $file;
$file = $root . '/' . $file;
$data = file_get_contents($file);
if (!strstr($file, 'sb.js')) {
preg_match_all("... | php | protected function grabFile($file, $root)
{
$data = '';
if (is_file($root . '/' . $file)) {
$this->loaded_files[] = $file;
$file = $root . '/' . $file;
$data = file_get_contents($file);
if (!strstr($file, 'sb.js')) {
preg_match_all("... | [
"protected",
"function",
"grabFile",
"(",
"$",
"file",
",",
"$",
"root",
")",
"{",
"$",
"data",
"=",
"''",
";",
"if",
"(",
"is_file",
"(",
"$",
"root",
".",
"'/'",
".",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"loaded_files",
"[",
"]",
"=... | Grabs a file
@param string $file The file to load
@param string $root The root to load
@return string The file data | [
"Grabs",
"a",
"file"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Toolkit.php#L134-L166 |
20,558 | surebert/surebert-framework | src/sb/Controller/Toolkit.php | Toolkit.basic | public function basic()
{
if (!isset($this->request->get['noexpire'])) {
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 259200));
}
header("Content-type: application/x-javascript");
$version = '';
if (isset($this->request->get['v'])) {
... | php | public function basic()
{
if (!isset($this->request->get['noexpire'])) {
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 259200));
}
header("Content-type: application/x-javascript");
$version = '';
if (isset($this->request->get['v'])) {
... | [
"public",
"function",
"basic",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"request",
"->",
"get",
"[",
"'noexpire'",
"]",
")",
")",
"{",
"header",
"(",
"'Expires: '",
".",
"gmdate",
"(",
"'D, d M Y H:i:s \\G\\M\\T'",
",",
"time",
"... | Serves out the most common surebert toolkit files
@servable true | [
"Serves",
"out",
"the",
"most",
"common",
"surebert",
"toolkit",
"files"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Controller/Toolkit.php#L204-L261 |
20,559 | tigron/skeleton-file | lib/Skeleton/File/Util.php | Util.detect_mime_type | public static function detect_mime_type($path) {
$handle = finfo_open(FILEINFO_MIME);
$mime_type = finfo_file($handle, $path);
if (strpos($mime_type, ';')) {
$mime_type = preg_replace('/;.*/', ' ', $mime_type);
}
return trim($mime_type);
} | php | public static function detect_mime_type($path) {
$handle = finfo_open(FILEINFO_MIME);
$mime_type = finfo_file($handle, $path);
if (strpos($mime_type, ';')) {
$mime_type = preg_replace('/;.*/', ' ', $mime_type);
}
return trim($mime_type);
} | [
"public",
"static",
"function",
"detect_mime_type",
"(",
"$",
"path",
")",
"{",
"$",
"handle",
"=",
"finfo_open",
"(",
"FILEINFO_MIME",
")",
";",
"$",
"mime_type",
"=",
"finfo_file",
"(",
"$",
"handle",
",",
"$",
"path",
")",
";",
"if",
"(",
"strpos",
... | Get the mime_type of a file
@access public
@param string $file The path to the file
@return string $mime_type | [
"Get",
"the",
"mime_type",
"of",
"a",
"file"
] | 97978d49f179f07c76380ddc8919b8a7d56dee61 | https://github.com/tigron/skeleton-file/blob/97978d49f179f07c76380ddc8919b8a7d56dee61/lib/Skeleton/File/Util.php#L99-L108 |
20,560 | LeaseCloud/leasecloud-php-sdk | src/Order.php | Order.status | public static function status($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/status';
list($ret) = parent::staticRequest('get', $url, []);
return $ret;
} | php | public static function status($orderId)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/status';
list($ret) = parent::staticRequest('get', $url, []);
return $ret;
} | [
"public",
"static",
"function",
"status",
"(",
"$",
"orderId",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"$",
"url",
"=",
"$",
"url",
".",
"'/'",
".",
"$",
"orderId",
".",
"'/status'",
";",
"list",
"(",
"$",
"ret",
")"... | Get status information about an order
@param string $orderId
@return mixed | [
"Get",
"status",
"information",
"about",
"an",
"order"
] | 091b073dd4f79ba915a68c0ed151bd9bfa61e7ca | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Order.php#L27-L34 |
20,561 | LeaseCloud/leasecloud-php-sdk | src/Order.php | Order.shipped | public static function shipped($orderId, $shippedAt = 0)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/shipped';
list($ret, $code) = parent::staticRequest('post', $url, [
'shippedAt' => date('c', $shippedAt ? $shippedAt : time()),
]);
return (obje... | php | public static function shipped($orderId, $shippedAt = 0)
{
$url = static::classUrl();
$url = $url . '/' . $orderId . '/shipped';
list($ret, $code) = parent::staticRequest('post', $url, [
'shippedAt' => date('c', $shippedAt ? $shippedAt : time()),
]);
return (obje... | [
"public",
"static",
"function",
"shipped",
"(",
"$",
"orderId",
",",
"$",
"shippedAt",
"=",
"0",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"classUrl",
"(",
")",
";",
"$",
"url",
"=",
"$",
"url",
".",
"'/'",
".",
"$",
"orderId",
".",
"'/shipped'",
... | Tell LeaseCloud that an order is shipped
@param string $orderId
@param int $shippedAt Unix timestamp
@return object | [
"Tell",
"LeaseCloud",
"that",
"an",
"order",
"is",
"shipped"
] | 091b073dd4f79ba915a68c0ed151bd9bfa61e7ca | https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/Order.php#L61-L73 |
20,562 | ntd/silverstripe-carousel | code/CarouselPage.php | CarouselImageExtension.getCarouselEditFields | public function getCarouselEditFields()
{
// This is *required* otherwise TinyMCE in SilverStripe 3.3 will
// not be enabled and the <textarea> will simply disappear
// without apparent reasons
if (method_exists('HtmlEditorConfig', 'require_js')) {
HtmlEditorConfig::requi... | php | public function getCarouselEditFields()
{
// This is *required* otherwise TinyMCE in SilverStripe 3.3 will
// not be enabled and the <textarea> will simply disappear
// without apparent reasons
if (method_exists('HtmlEditorConfig', 'require_js')) {
HtmlEditorConfig::requi... | [
"public",
"function",
"getCarouselEditFields",
"(",
")",
"{",
"// This is *required* otherwise TinyMCE in SilverStripe 3.3 will",
"// not be enabled and the <textarea> will simply disappear",
"// without apparent reasons",
"if",
"(",
"method_exists",
"(",
"'HtmlEditorConfig'",
",",
"'r... | Retrieve the fields used by SortableUploadField internal form.
@return FieldList | [
"Retrieve",
"the",
"fields",
"used",
"by",
"SortableUploadField",
"internal",
"form",
"."
] | 1475f48f404b702b58480eacb2fea01011b30e55 | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L59-L71 |
20,563 | ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.getCMSFields | public function getCMSFields()
{
$fields = parent::getCMSFields();
$field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
$field->setFolderName($this->getClassFolder());
$field->setFileEditFields('getCarouselEditFields');
$root = $fields->fieldByName(... | php | public function getCMSFields()
{
$fields = parent::getCMSFields();
$field = SortableUploadField::create('Images', _t('CarouselPage.db_Images'));
$field->setFolderName($this->getClassFolder());
$field->setFileEditFields('getCarouselEditFields');
$root = $fields->fieldByName(... | [
"public",
"function",
"getCMSFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getCMSFields",
"(",
")",
";",
"$",
"field",
"=",
"SortableUploadField",
"::",
"create",
"(",
"'Images'",
",",
"_t",
"(",
"'CarouselPage.db_Images'",
")",
")",
";",
"$... | Add the "Images" tab to the content form of the page.
The images are linked to the page with a many-many relationship,
so if an image is shared among different carousels there is no
need to upload it multiple times.
@return FieldList | [
"Add",
"the",
"Images",
"tab",
"to",
"the",
"content",
"form",
"of",
"the",
"page",
"."
] | 1475f48f404b702b58480eacb2fea01011b30e55 | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L184-L202 |
20,564 | ntd/silverstripe-carousel | code/CarouselPage.php | CarouselPage.getSettingsFields | public function getSettingsFields()
{
$fields = parent::getSettingsFields();
$settings = FieldGroup::create(
FieldGroup::create(
NumericField::create('Width', _t('CarouselPage.db_Width')),
NumericField::create('Height', _t('CarouselPage.db_Height')),
... | php | public function getSettingsFields()
{
$fields = parent::getSettingsFields();
$settings = FieldGroup::create(
FieldGroup::create(
NumericField::create('Width', _t('CarouselPage.db_Width')),
NumericField::create('Height', _t('CarouselPage.db_Height')),
... | [
"public",
"function",
"getSettingsFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getSettingsFields",
"(",
")",
";",
"$",
"settings",
"=",
"FieldGroup",
"::",
"create",
"(",
"FieldGroup",
"::",
"create",
"(",
"NumericField",
"::",
"create",
"(",... | Add carousel related fields to the page settings.
Every CarouselPage instance can have its own settings, that is
different pages can own carousels of different sizes.
@return FieldList | [
"Add",
"carousel",
"related",
"fields",
"to",
"the",
"page",
"settings",
"."
] | 1475f48f404b702b58480eacb2fea01011b30e55 | https://github.com/ntd/silverstripe-carousel/blob/1475f48f404b702b58480eacb2fea01011b30e55/code/CarouselPage.php#L212-L228 |
20,565 | unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.parse | public function parse() {
$css = new Parser(file_get_contents($this->path));
$this->leanCSS = $css->parse();
$this->blubberCSS = clone $this->leanCSS;
} | php | public function parse() {
$css = new Parser(file_get_contents($this->path));
$this->leanCSS = $css->parse();
$this->blubberCSS = clone $this->leanCSS;
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"css",
"=",
"new",
"Parser",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"path",
")",
")",
";",
"$",
"this",
"->",
"leanCSS",
"=",
"$",
"css",
"->",
"parse",
"(",
")",
";",
"$",
"this",
"->... | Begins parsing the CSS file | [
"Begins",
"parsing",
"the",
"CSS",
"file"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L44-L49 |
20,566 | unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.saveBlubber | public function saveBlubber() {
$fh = fopen($this->getDirname().'/'.$this->getBlubberName(),'w');
fwrite($fh, $this->blubberCSS->render());
} | php | public function saveBlubber() {
$fh = fopen($this->getDirname().'/'.$this->getBlubberName(),'w');
fwrite($fh, $this->blubberCSS->render());
} | [
"public",
"function",
"saveBlubber",
"(",
")",
"{",
"$",
"fh",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getDirname",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getBlubberName",
"(",
")",
",",
"'w'",
")",
";",
"fwrite",
"(",
"$",
"fh",
",",
"$",... | Saves the "blubber" CSS to the filesystem | [
"Saves",
"the",
"blubber",
"CSS",
"to",
"the",
"filesystem"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L102-L105 |
20,567 | unclecheese/silverstripe-blubber | code/CSSBlubberFile.php | CSSBlubberFile.saveLean | public function saveLean() {
$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
fwrite($fh, $this->leanCSS->render());
} | php | public function saveLean() {
$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
fwrite($fh, $this->leanCSS->render());
} | [
"public",
"function",
"saveLean",
"(",
")",
"{",
"$",
"fh",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getDirname",
"(",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getLeanName",
"(",
")",
",",
"'w'",
")",
";",
"fwrite",
"(",
"$",
"fh",
",",
"$",
"th... | Saves the "lean" CSS to the filesystem | [
"Saves",
"the",
"lean",
"CSS",
"to",
"the",
"filesystem"
] | f2549bd5eddeb0ca0303a3c09be4a8136fcc6661 | https://github.com/unclecheese/silverstripe-blubber/blob/f2549bd5eddeb0ca0303a3c09be4a8136fcc6661/code/CSSBlubberFile.php#L110-L113 |
20,568 | dlehren/omnipay-cardknox | src/Message/AbstractRequest.php | AbstractRequest.getBaseData | protected function getBaseData()
{
$data = array();
$data['xKey'] = $this->getCardknoxKey();
$data['xVersion'] = '4.5.4';
$data['xSoftwareName'] = 'omnipay';
$data['xSoftwareVersion'] = '1';
$data['xCommand'] = $this->action;
return $data;
} | php | protected function getBaseData()
{
$data = array();
$data['xKey'] = $this->getCardknoxKey();
$data['xVersion'] = '4.5.4';
$data['xSoftwareName'] = 'omnipay';
$data['xSoftwareVersion'] = '1';
$data['xCommand'] = $this->action;
return $data;
} | [
"protected",
"function",
"getBaseData",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"data",
"[",
"'xKey'",
"]",
"=",
"$",
"this",
"->",
"getCardknoxKey",
"(",
")",
";",
"$",
"data",
"[",
"'xVersion'",
"]",
"=",
"'4.5.4'",
";",
"$"... | Base data used only for the API. | [
"Base",
"data",
"used",
"only",
"for",
"the",
"API",
"."
] | 69af1f5bffafa6e27957a7114bd6c9c454854985 | https://github.com/dlehren/omnipay-cardknox/blob/69af1f5bffafa6e27957a7114bd6c9c454854985/src/Message/AbstractRequest.php#L81-L91 |
20,569 | canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.build | protected function build()
{
$sql = $this->start . "\n"
. ($this->from ? $this->from . "\n" : null)
. ($this->join ? $this->join : null)
. ($this->set ? $this->set . "\n" : null)
. ($this->where ? $this->where . "\n" : null)
... | php | protected function build()
{
$sql = $this->start . "\n"
. ($this->from ? $this->from . "\n" : null)
. ($this->join ? $this->join : null)
. ($this->set ? $this->set . "\n" : null)
. ($this->where ? $this->where . "\n" : null)
... | [
"protected",
"function",
"build",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"start",
".",
"\"\\n\"",
".",
"(",
"$",
"this",
"->",
"from",
"?",
"$",
"this",
"->",
"from",
".",
"\"\\n\"",
":",
"null",
")",
".",
"(",
"$",
"this",
"->",
"j... | Build the SQL query from its parts.
@return string as SQL query | [
"Build",
"the",
"SQL",
"query",
"from",
"its",
"parts",
"."
] | c26a8a1537a8d8c2dcee305167980a57384b4e77 | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L64-L78 |
20,570 | canax/database-query-builder | src/DatabaseQueryBuilder/QueryBuilderTrait.php | QueryBuilderTrait.rightJoin | public function rightJoin($table, $condition)
{
if ($this->dialect == 'sqlite') {
throw new BuildException("SQLite does not support RIGHT JOIN");
}
return $this->createJoin($table, $condition, 'RIGHT OUTER');
} | php | public function rightJoin($table, $condition)
{
if ($this->dialect == 'sqlite') {
throw new BuildException("SQLite does not support RIGHT JOIN");
}
return $this->createJoin($table, $condition, 'RIGHT OUTER');
} | [
"public",
"function",
"rightJoin",
"(",
"$",
"table",
",",
"$",
"condition",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dialect",
"==",
"'sqlite'",
")",
"{",
"throw",
"new",
"BuildException",
"(",
"\"SQLite does not support RIGHT JOIN\"",
")",
";",
"}",
"retur... | Build the right join part.
@param string $table name of table.
@param string $condition to join.
@throws \Anax\Database\BuildException when dialect does not support.
@return $this | [
"Build",
"the",
"right",
"join",
"part",
"."
] | c26a8a1537a8d8c2dcee305167980a57384b4e77 | https://github.com/canax/database-query-builder/blob/c26a8a1537a8d8c2dcee305167980a57384b4e77/src/DatabaseQueryBuilder/QueryBuilderTrait.php#L390-L397 |
20,571 | alevilar/ristorantino-vendor | Stats/Model/CustomQuery.php | CustomQuery.paginateCount | function paginateCount($conditions, $recursive){
$sql = $this->sql;
return count($this->query($sql));
} | php | function paginateCount($conditions, $recursive){
$sql = $this->sql;
return count($this->query($sql));
} | [
"function",
"paginateCount",
"(",
"$",
"conditions",
",",
"$",
"recursive",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
";",
"return",
"count",
"(",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
")",
")",
";",
"}"
] | Esta funcion sobreescribe a la del paginador. Como son
consultas guardadas en la tabla query, tengo que calcular
la cantidad de registros para que pagine bien.
@param $conditions, $recursive
@return cantidad de registro. | [
"Esta",
"funcion",
"sobreescribe",
"a",
"la",
"del",
"paginador",
".",
"Como",
"son",
"consultas",
"guardadas",
"en",
"la",
"tabla",
"query",
"tengo",
"que",
"calcular",
"la",
"cantidad",
"de",
"registros",
"para",
"que",
"pagine",
"bien",
"."
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Stats/Model/CustomQuery.php#L25-L29 |
20,572 | alevilar/ristorantino-vendor | Stats/Model/CustomQuery.php | CustomQuery.paginate | function paginate($conditions, $fields, $order, $limit, $page, $recursive){
$sql = $this->sql;
$sql .= " LIMIT " . $this->limit . " ";
$sql .= " OFFSET " . (($page - 1) * $this->limit);
return $this->query($sql);
} | php | function paginate($conditions, $fields, $order, $limit, $page, $recursive){
$sql = $this->sql;
$sql .= " LIMIT " . $this->limit . " ";
$sql .= " OFFSET " . (($page - 1) * $this->limit);
return $this->query($sql);
} | [
"function",
"paginate",
"(",
"$",
"conditions",
",",
"$",
"fields",
",",
"$",
"order",
",",
"$",
"limit",
",",
"$",
"page",
",",
"$",
"recursive",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"sql",
";",
"$",
"sql",
".=",
"\" LIMIT \"",
".",
"$"... | Esta funcion sobreescribe a la del paginador. Como son
consultas guardadas en la tabla query, tengo que
reescribir el limit y el offset para poder mostrar por pantalla
@param $conditions, $recursive
@return registros paginados. | [
"Esta",
"funcion",
"sobreescribe",
"a",
"la",
"del",
"paginador",
".",
"Como",
"son",
"consultas",
"guardadas",
"en",
"la",
"tabla",
"query",
"tengo",
"que",
"reescribir",
"el",
"limit",
"y",
"el",
"offset",
"para",
"poder",
"mostrar",
"por",
"pantalla"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Stats/Model/CustomQuery.php#L39-L46 |
20,573 | jnaxo/country-codes | src/Store/ApiManager.php | ApiManager.respondWithItem | protected function respondWithItem(
$item,
$resource_name = '',
array $links = [],
array $included = []
) {
$resource = new Item($item, $resource_name, $links, $included);
return $this->respondWithArray($resource->toArray());
} | php | protected function respondWithItem(
$item,
$resource_name = '',
array $links = [],
array $included = []
) {
$resource = new Item($item, $resource_name, $links, $included);
return $this->respondWithArray($resource->toArray());
} | [
"protected",
"function",
"respondWithItem",
"(",
"$",
"item",
",",
"$",
"resource_name",
"=",
"''",
",",
"array",
"$",
"links",
"=",
"[",
"]",
",",
"array",
"$",
"included",
"=",
"[",
"]",
")",
"{",
"$",
"resource",
"=",
"new",
"Item",
"(",
"$",
"i... | Response with item
@param Object $item
@param $resource_name
@param array $links
@param array $included
@return Json Object | [
"Response",
"with",
"item"
] | ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9 | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/src/Store/ApiManager.php#L20-L28 |
20,574 | mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php | PageToIntegerTransformer.transform | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof Page)) {
throw new TransformationFailedException('Expected an instance of a concrete5 page object.');
}
return intval($value->getCollectio... | php | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof Page)) {
throw new TransformationFailedException('Expected an instance of a concrete5 page object.');
}
return intval($value->getCollectio... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"Page",
")",
")",
"{",
... | Converts a concrete5 page object to an integer.
@param \Concrete\Core\Page\Page $value The page object value
@return int The integer value
@throws TransformationFailedException If the given value is not an
instance of Concrete\Core\Page\Page. | [
"Converts",
"a",
"concrete5",
"page",
"object",
"to",
"an",
"integer",
"."
] | 41a93c293d986574ec5cade8a7c8700e083dbaaa | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/PageToIntegerTransformer.php#L33-L42 |
20,575 | Opifer/EavBundle | DependencyInjection/OpiferEavExtension.php | OpiferEavExtension.getParameters | public function getParameters(array $config)
{
$params = [
'opifer_eav.attribute_class' => $config['attribute_class'],
'opifer_eav.media_class' => $config['media_class'],
'opifer_eav.nestable_class' => $config['nestable_class'],
'opifer_eav.option_class' ... | php | public function getParameters(array $config)
{
$params = [
'opifer_eav.attribute_class' => $config['attribute_class'],
'opifer_eav.media_class' => $config['media_class'],
'opifer_eav.nestable_class' => $config['nestable_class'],
'opifer_eav.option_class' ... | [
"public",
"function",
"getParameters",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"params",
"=",
"[",
"'opifer_eav.attribute_class'",
"=>",
"$",
"config",
"[",
"'attribute_class'",
"]",
",",
"'opifer_eav.media_class'",
"=>",
"$",
"config",
"[",
"'media_class'",
... | Simplifying parameter syntax
@param array $config
@return array | [
"Simplifying",
"parameter",
"syntax"
] | 4236fdc28b7574dac43f420704d0fc3c04905a4c | https://github.com/Opifer/EavBundle/blob/4236fdc28b7574dac43f420704d0fc3c04905a4c/DependencyInjection/OpiferEavExtension.php#L35-L51 |
20,576 | Opifer/EavBundle | DependencyInjection/OpiferEavExtension.php | OpiferEavExtension.prepend | public function prepend(ContainerBuilder $container)
{
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
$parameters = $this->getParameters($config);
foreach ($parameters as $key => $value) {
... | php | public function prepend(ContainerBuilder $container)
{
$configs = $container->getExtensionConfig($this->getAlias());
$config = $this->processConfiguration(new Configuration(), $configs);
$parameters = $this->getParameters($config);
foreach ($parameters as $key => $value) {
... | [
"public",
"function",
"prepend",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configs",
"=",
"$",
"container",
"->",
"getExtensionConfig",
"(",
"$",
"this",
"->",
"getAlias",
"(",
")",
")",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"proce... | Prepend our config before other bundles, so we can preset
their config with our parameters
@param ContainerBuilder $container
@return void | [
"Prepend",
"our",
"config",
"before",
"other",
"bundles",
"so",
"we",
"can",
"preset",
"their",
"config",
"with",
"our",
"parameters"
] | 4236fdc28b7574dac43f420704d0fc3c04905a4c | https://github.com/Opifer/EavBundle/blob/4236fdc28b7574dac43f420704d0fc3c04905a4c/DependencyInjection/OpiferEavExtension.php#L61-L97 |
20,577 | MASNathan/Parser | src/Type/Json.php | Json.encode | public static function encode($data, $prettyPrint = false)
{
if ($prettyPrint) {
// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
return json_encode($data, J... | php | public static function encode($data, $prettyPrint = false)
{
if ($prettyPrint) {
// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant
if (version_compare(PHP_VERSION, '5.4.0', '>=') && defined('JSON_PRETTY_PRINT')) {
return json_encode($data, J... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"prettyPrint",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"prettyPrint",
")",
"{",
"// Check if the PHP version is >= 5.4 and has the JSON_PRETTY_PRINT constant",
"if",
"(",
"version_compare",
"(",
"... | Encodes an array to json strutcture
@param array $data Data to encode
@param boolean $prettyPrint True to output the encoded data a little bit more readable for the humans
@return string | [
"Encodes",
"an",
"array",
"to",
"json",
"strutcture"
] | 0f55402b99b1e071bdcd6277b9268f783ca25e34 | https://github.com/MASNathan/Parser/blob/0f55402b99b1e071bdcd6277b9268f783ca25e34/src/Type/Json.php#L15-L28 |
20,578 | heidelpay/PhpDoc | src/phpDocumentor/Transformer/ServiceProvider.php | ServiceProvider.provideTemplatingSystem | protected function provideTemplatingSystem(Application $app)
{
$templateDir = __DIR__ . '/../../../data/templates';
// when installed using composer the templates are in a different folder
$composerTemplatePath = __DIR__ . '/../../../../templates';
if (file_exists($composerTemplateP... | php | protected function provideTemplatingSystem(Application $app)
{
$templateDir = __DIR__ . '/../../../data/templates';
// when installed using composer the templates are in a different folder
$composerTemplatePath = __DIR__ . '/../../../../templates';
if (file_exists($composerTemplateP... | [
"protected",
"function",
"provideTemplatingSystem",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"templateDir",
"=",
"__DIR__",
".",
"'/../../../data/templates'",
";",
"// when installed using composer the templates are in a different folder",
"$",
"composerTemplatePath",
"="... | Initializes the templating system in the container.
@param Application $app
@return void | [
"Initializes",
"the",
"templating",
"system",
"in",
"the",
"container",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/ServiceProvider.php#L207-L244 |
20,579 | j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.getIndentationPrefix | public function getIndentationPrefix($times = 1)
{
if (!is_integer($times)) {
throw new \InvalidArgumentException('The times parameter has to be an integer');
}
$indentation = '';
for ($i = 0; $i < $times; $i++) {
$indentation .= $this->getTemplate()->getInd... | php | public function getIndentationPrefix($times = 1)
{
if (!is_integer($times)) {
throw new \InvalidArgumentException('The times parameter has to be an integer');
}
$indentation = '';
for ($i = 0; $i < $times; $i++) {
$indentation .= $this->getTemplate()->getInd... | [
"public",
"function",
"getIndentationPrefix",
"(",
"$",
"times",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"is_integer",
"(",
"$",
"times",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The times parameter has to be an integer'",
")",
";",
... | Returns all the indentation that should be put before the current line
@param int $times
@return string
@throws \InvalidArgumentException | [
"Returns",
"all",
"the",
"indentation",
"that",
"should",
"be",
"put",
"before",
"the",
"current",
"line"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L88-L101 |
20,580 | j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.convertLinesToCode | public function convertLinesToCode(array $lines) {
if (0 === count($lines)) {
return '';
}
if (0 !== strlen($this->getTemplate()->getIndentationPrefix())) {
foreach ($lines as $lineNumber => $line) {
if (null === $line) {
unset($lines[... | php | public function convertLinesToCode(array $lines) {
if (0 === count($lines)) {
return '';
}
if (0 !== strlen($this->getTemplate()->getIndentationPrefix())) {
foreach ($lines as $lineNumber => $line) {
if (null === $line) {
unset($lines[... | [
"public",
"function",
"convertLinesToCode",
"(",
"array",
"$",
"lines",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"lines",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"0",
"!==",
"strlen",
"(",
"$",
"this",
"->",
"getTemplate",
"(... | Converts an array of lines into code, including the current indentation
@param array $lines
@return string | [
"Converts",
"an",
"array",
"of",
"lines",
"into",
"code",
"including",
"the",
"current",
"indentation"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L110-L126 |
20,581 | j-d/draggy | src/Draggy/Autocode/Templates/Template.php | Template.getBlurbLines | public function getBlurbLines()
{
$lines = [];
$lines[] = '';
$lines[] = '/************************************************************************************************';
$lines[] = ' ** THIS IS AN AUTOMATICALLY GENERATED BASE FILE AND SHOULD NOT BE MANUALLY EDITED **... | php | public function getBlurbLines()
{
$lines = [];
$lines[] = '';
$lines[] = '/************************************************************************************************';
$lines[] = ' ** THIS IS AN AUTOMATICALLY GENERATED BASE FILE AND SHOULD NOT BE MANUALLY EDITED **... | [
"public",
"function",
"getBlurbLines",
"(",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"''",
";",
"$",
"lines",
"[",
"]",
"=",
"'/************************************************************************************************'",
";",
... | Get the default Blurb
@return string | [
"Get",
"the",
"default",
"Blurb"
] | 97ffc66e1aacb5f685d7aac5251c4abb8888d4bb | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/Templates/Template.php#L133-L153 |
20,582 | nabab/bbn | src/bbn/user/permissions.php | permissions.from_path | public function from_path(string $path, $type = 'page'): ?string
{
$parent = null;
if ( $root = $this->opt->from_code($type, self::$option_root_id) ){
$parts = explode('/', $path);
$parent = $root;
foreach ( $parts as $i => $p ){
$is_not_last = $i < (\count($parts) - 1);
if (... | php | public function from_path(string $path, $type = 'page'): ?string
{
$parent = null;
if ( $root = $this->opt->from_code($type, self::$option_root_id) ){
$parts = explode('/', $path);
$parent = $root;
foreach ( $parts as $i => $p ){
$is_not_last = $i < (\count($parts) - 1);
if (... | [
"public",
"function",
"from_path",
"(",
"string",
"$",
"path",
",",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"string",
"{",
"$",
"parent",
"=",
"null",
";",
"if",
"(",
"$",
"root",
"=",
"$",
"this",
"->",
"opt",
"->",
"from_code",
"(",
"$",
"ty... | Returns the option's ID corresponds to the given path.
@param string $path
@param string $type
@return null|string | [
"Returns",
"the",
"option",
"s",
"ID",
"corresponds",
"to",
"the",
"given",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L76-L96 |
20,583 | nabab/bbn | src/bbn/user/permissions.php | permissions.get_all | public function get_all(string $id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->options($id_option ?: $this->get_current());
}
return null;
} | php | public function get_all(string $id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->options($id_option ?: $this->get_current());
}
return null;
} | [
"public",
"function",
"get_all",
"(",
"string",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
... | Returns the full list of permissions existing in the given option
@param null|string $id_option
@param string $type
@return null|array | [
"Returns",
"the",
"full",
"list",
"of",
"permissions",
"existing",
"in",
"the",
"given",
"option"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L153-L159 |
20,584 | nabab/bbn | src/bbn/user/permissions.php | permissions.get_full | public function get_full($id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->full_options($id_option ?: $this->get_current());
}
return null;
} | php | public function get_full($id_option = null, string $type = 'page'): ?array
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->full_options($id_option ?: $this->get_current());
}
return null;
} | [
"public",
"function",
"get_full",
"(",
"$",
"id_option",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"typ... | Returns the full list of permissions existing in the given option with all the current user's preferences
@param null|string $id_option
@param string $type
@return array|bool|false | [
"Returns",
"the",
"full",
"list",
"of",
"permissions",
"existing",
"in",
"the",
"given",
"option",
"with",
"all",
"the",
"current",
"user",
"s",
"preferences"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L168-L174 |
20,585 | nabab/bbn | src/bbn/user/permissions.php | permissions.is | public function is(string $path, string $type = 'page'): ?string
{
return $this->from_path($path, $type);
} | php | public function is(string $path, string $type = 'page'): ?string
{
return $this->from_path($path, $type);
} | [
"public",
"function",
"is",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"string",
"{",
"return",
"$",
"this",
"->",
"from_path",
"(",
"$",
"path",
",",
"$",
"type",
")",
";",
"}"
] | Checks if an option corresponds to the given path.
@param string $path
@param string $type
@return null|string | [
"Checks",
"if",
"an",
"option",
"corresponds",
"to",
"the",
"given",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L236-L239 |
20,586 | nabab/bbn | src/bbn/user/permissions.php | permissions.customize | public function customize(array $arr): array
{
$res = [];
if ( isset($arr[0]) ){
foreach ( $arr as $a ){
if ( isset($a['id']) && $this->has($a['id']) ){
$res[] = $a;
}
}
}
else if ( isset($arr['items']) ){
$res = $arr;
unset($res['items']);
forea... | php | public function customize(array $arr): array
{
$res = [];
if ( isset($arr[0]) ){
foreach ( $arr as $a ){
if ( isset($a['id']) && $this->has($a['id']) ){
$res[] = $a;
}
}
}
else if ( isset($arr['items']) ){
$res = $arr;
unset($res['items']);
forea... | [
"public",
"function",
"customize",
"(",
"array",
"$",
"arr",
")",
":",
"array",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"arr",
"[",
"0",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"a",
")",
"{",
"i... | Adapts a given array of options' to user's permissions
@param array $arr
@return array | [
"Adapts",
"a",
"given",
"array",
"of",
"options",
"to",
"user",
"s",
"permissions"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L247-L270 |
20,587 | nabab/bbn | src/bbn/user/permissions.php | permissions.add | public function add(string $id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->set_by_option($id_option, []);
}
return null;
} | php | public function add(string $id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->set_by_option($id_option, []);
}
return null;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"id_option",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"int",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"type",
")",
... | Grants a new permission to a user or a group
@param null|string $id_option
@param string $type
@return int | [
"Grants",
"a",
"new",
"permission",
"to",
"a",
"user",
"or",
"a",
"group"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L278-L284 |
20,588 | nabab/bbn | src/bbn/user/permissions.php | permissions.remove | public function remove($id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->delete($id_option);
}
return null;
} | php | public function remove($id_option, string $type = 'page'): ?int
{
if ( $id_option = $this->_get_id_option($id_option, $type) ){
return $this->pref->delete($id_option);
}
return null;
} | [
"public",
"function",
"remove",
"(",
"$",
"id_option",
",",
"string",
"$",
"type",
"=",
"'page'",
")",
":",
"?",
"int",
"{",
"if",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"_get_id_option",
"(",
"$",
"id_option",
",",
"$",
"type",
")",
")",
"... | Deletes a preference for a path or an ID.
@param null|string $id_option
@param string $type
@return null|int | [
"Deletes",
"a",
"preference",
"for",
"a",
"path",
"or",
"an",
"ID",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L293-L299 |
20,589 | nabab/bbn | src/bbn/user/permissions.php | permissions.read_option | public function read_option(string $id_option = null): ?bool
{
if ( bbn\str::is_uid($id_option) ){
$root = self::get_option_id('options');
$id_to_check = $this->opt->from_code('opt'.$id_option, $root);
return $this->has($id_to_check, 'options');
}
return null;
} | php | public function read_option(string $id_option = null): ?bool
{
if ( bbn\str::is_uid($id_option) ){
$root = self::get_option_id('options');
$id_to_check = $this->opt->from_code('opt'.$id_option, $root);
return $this->has($id_to_check, 'options');
}
return null;
} | [
"public",
"function",
"read_option",
"(",
"string",
"$",
"id_option",
"=",
"null",
")",
":",
"?",
"bool",
"{",
"if",
"(",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id_option",
")",
")",
"{",
"$",
"root",
"=",
"self",
"::",
"get_option_id",
"(",
... | Checks if the category represented by the given option ID is readable by the current user
@param string|null $id_option
@return bool|null | [
"Checks",
"if",
"the",
"category",
"represented",
"by",
"the",
"given",
"option",
"ID",
"is",
"readable",
"by",
"the",
"current",
"user"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/user/permissions.php#L307-L315 |
20,590 | Erdiko/core | src/View.php | View.renderMustache | public function renderMustache($filename, $data) {
// This is for mustache compatibility
$data['getView'] = function($name, $data) {
return $this->getView($name, $data);
};
return parent::renderMustache($filename, $data);
} | php | public function renderMustache($filename, $data) {
// This is for mustache compatibility
$data['getView'] = function($name, $data) {
return $this->getView($name, $data);
};
return parent::renderMustache($filename, $data);
} | [
"public",
"function",
"renderMustache",
"(",
"$",
"filename",
",",
"$",
"data",
")",
"{",
"// This is for mustache compatibility",
"$",
"data",
"[",
"'getView'",
"]",
"=",
"function",
"(",
"$",
"name",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->... | Attach getView function to the mustache view | [
"Attach",
"getView",
"function",
"to",
"the",
"mustache",
"view"
] | c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6 | https://github.com/Erdiko/core/blob/c7947ee973b0ad2fd05a6d1d8ce45696618c8fa6/src/View.php#L31-L37 |
20,591 | PayBreak/foundation | src/Decision/Condition/AbstractCondition.php | AbstractCondition.availableTypes | public static function availableTypes()
{
return [
self::CONDITION_EQUAL,
self::CONDITION_NOT_EQUAL,
self::CONDITION_GREATER_THAN,
self::CONDITION_LESS_THAN,
self::CONDITION_GREATER_THAN_OR_EQUAL_TO,
self::CONDITION_LESS_THAN_OR_EQUAL_T... | php | public static function availableTypes()
{
return [
self::CONDITION_EQUAL,
self::CONDITION_NOT_EQUAL,
self::CONDITION_GREATER_THAN,
self::CONDITION_LESS_THAN,
self::CONDITION_GREATER_THAN_OR_EQUAL_TO,
self::CONDITION_LESS_THAN_OR_EQUAL_T... | [
"public",
"static",
"function",
"availableTypes",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"CONDITION_EQUAL",
",",
"self",
"::",
"CONDITION_NOT_EQUAL",
",",
"self",
"::",
"CONDITION_GREATER_THAN",
",",
"self",
"::",
"CONDITION_LESS_THAN",
",",
"self",
"::",
"... | All Available ConditionInterface Types
@return array | [
"All",
"Available",
"ConditionInterface",
"Types"
] | 3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4 | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Decision/Condition/AbstractCondition.php#L166-L179 |
20,592 | eghojansu/moe | src/Silet.php | Silet.filter | function filter($key=NULL,$func=NULL) {
if (!$key)
return array_keys($this->filter);
if (!$func)
return $this->filter[$key];
$this->filter[$key]=$func;
} | php | function filter($key=NULL,$func=NULL) {
if (!$key)
return array_keys($this->filter);
if (!$func)
return $this->filter[$key];
$this->filter[$key]=$func;
} | [
"function",
"filter",
"(",
"$",
"key",
"=",
"NULL",
",",
"$",
"func",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"key",
")",
"return",
"array_keys",
"(",
"$",
"this",
"->",
"filter",
")",
";",
"if",
"(",
"!",
"$",
"func",
")",
"return",
"$",
... | register token filter
@param string $key
@param string $func
@return array | [
"register",
"token",
"filter"
] | f58ec75a3116d1a572782256e2b38bb9aab95e3c | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Silet.php#L132-L138 |
20,593 | tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeSuccessData | protected function seeSuccessData($data = null)
{
collect($data)->each(function ($value, $key) {
if (is_array($value)) {
$this->seeSuccessData($value);
} else {
$this->seeJson([$key => $value]);
}
});
return $this;
} | php | protected function seeSuccessData($data = null)
{
collect($data)->each(function ($value, $key) {
if (is_array($value)) {
$this->seeSuccessData($value);
} else {
$this->seeJson([$key => $value]);
}
});
return $this;
} | [
"protected",
"function",
"seeSuccessData",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"collect",
"(",
"$",
"data",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
... | Assert that the response data contains given values.
@param mixed $data
@return $this | [
"Assert",
"that",
"the",
"response",
"data",
"contains",
"given",
"values",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L88-L99 |
20,594 | tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.getSuccessData | protected function getSuccessData($attributes = null)
{
$rawData = $this->decodeResponseJson()['data'];
if (is_null($attributes)) {
return $rawData;
} elseif (is_string($attributes)) {
return array_get($rawData, $attributes);
}
$data = [];
f... | php | protected function getSuccessData($attributes = null)
{
$rawData = $this->decodeResponseJson()['data'];
if (is_null($attributes)) {
return $rawData;
} elseif (is_string($attributes)) {
return array_get($rawData, $attributes);
}
$data = [];
f... | [
"protected",
"function",
"getSuccessData",
"(",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"rawData",
"=",
"$",
"this",
"->",
"decodeResponseJson",
"(",
")",
"[",
"'data'",
"]",
";",
"if",
"(",
"is_null",
"(",
"$",
"attributes",
")",
")",
"{",
"ret... | Decodes JSON response and returns the data.
@param string|array|null $attributes
@return array | [
"Decodes",
"JSON",
"response",
"and",
"returns",
"the",
"data",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L107-L124 |
20,595 | tttptd/laravel-responder | src/Traits/MakesApiRequests.php | MakesApiRequests.seeError | protected function seeError(string $error, int $status = null)
{
if (! is_null($status)) {
$this->seeStatusCode($status);
}
if ($this->app->config->get('responder.status_code')) {
$this->seeJson([
'status' => $status
]);
}
... | php | protected function seeError(string $error, int $status = null)
{
if (! is_null($status)) {
$this->seeStatusCode($status);
}
if ($this->app->config->get('responder.status_code')) {
$this->seeJson([
'status' => $status
]);
}
... | [
"protected",
"function",
"seeError",
"(",
"string",
"$",
"error",
",",
"int",
"$",
"status",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"status",
")",
")",
"{",
"$",
"this",
"->",
"seeStatusCode",
"(",
"$",
"status",
")",
";",
"}",... | Assert that the response is a valid error response.
@param string $error
@param int|null $status
@return $this | [
"Assert",
"that",
"the",
"response",
"is",
"a",
"valid",
"error",
"response",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/MakesApiRequests.php#L133-L152 |
20,596 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserService.php | UserService.generateRandomPassword | public function generateRandomPassword()
{
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
... | php | public function generateRandomPassword()
{
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
... | [
"public",
"function",
"generateRandomPassword",
"(",
")",
"{",
"$",
"alphabet",
"=",
"\"abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789\"",
";",
"$",
"pass",
"=",
"array",
"(",
")",
";",
"$",
"alphaLength",
"=",
"strlen",
"(",
"$",
"alphabet",
")",
"-... | Geneate Radmon password. | [
"Geneate",
"Radmon",
"password",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserService.php#L118-L128 |
20,597 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserService.php | UserService.isUnique | public function isUnique($username, $email, $dni = null, $code = null)
{
$entities = $this->getEm()->getRepository("AmulenUserBundle:User")->findByUniques($username, $email, $dni, $code);
return count($entities) <= 0;
} | php | public function isUnique($username, $email, $dni = null, $code = null)
{
$entities = $this->getEm()->getRepository("AmulenUserBundle:User")->findByUniques($username, $email, $dni, $code);
return count($entities) <= 0;
} | [
"public",
"function",
"isUnique",
"(",
"$",
"username",
",",
"$",
"email",
",",
"$",
"dni",
"=",
"null",
",",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"entities",
"=",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"getRepository",
"(",
"\"AmulenUserBun... | Check if is unique.
@param [type] $username [description]
@param [type] $email [description]
@param [type] $phone [description]
@param [type] $dni [description]
@param [type] $code [description]
@return boolean [description] | [
"Check",
"if",
"is",
"unique",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserService.php#L152-L156 |
20,598 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserService.php | UserService.getAuthToken | public function getAuthToken($user, $plainPassword, $firewall, $roles = array())
{
// Here, "public" is the name of the firewall in your security.yml
$token = new UsernamePasswordToken($user, $user->getPlainPassword(), $firewall, $roles);
// For older versions of Symfony, use security.conte... | php | public function getAuthToken($user, $plainPassword, $firewall, $roles = array())
{
// Here, "public" is the name of the firewall in your security.yml
$token = new UsernamePasswordToken($user, $user->getPlainPassword(), $firewall, $roles);
// For older versions of Symfony, use security.conte... | [
"public",
"function",
"getAuthToken",
"(",
"$",
"user",
",",
"$",
"plainPassword",
",",
"$",
"firewall",
",",
"$",
"roles",
"=",
"array",
"(",
")",
")",
"{",
"// Here, \"public\" is the name of the firewall in your security.yml",
"$",
"token",
"=",
"new",
"Usernam... | Get by Code.
@param [type] $user [user to auth]
@param [type] $user [user's plain password]
@param [type] $firewall [name in security.yml]
@param [type] $roles [user's roles]
@return [bool] token [description] | [
"Get",
"by",
"Code",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserService.php#L177-L186 |
20,599 | flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Service/UserService.php | UserService.uploadImage | public function uploadImage(User $entity)
{
/* the file property can be empty if the field is not required */
if (null === $entity->getFile()) {
return $entity;
}
$uploadBaseDir = $this->container->getParameter("user_avatar_basedir");
$uploadDir = $this->contain... | php | public function uploadImage(User $entity)
{
/* the file property can be empty if the field is not required */
if (null === $entity->getFile()) {
return $entity;
}
$uploadBaseDir = $this->container->getParameter("user_avatar_basedir");
$uploadDir = $this->contain... | [
"public",
"function",
"uploadImage",
"(",
"User",
"$",
"entity",
")",
"{",
"/* the file property can be empty if the field is not required */",
"if",
"(",
"null",
"===",
"$",
"entity",
"->",
"getFile",
"(",
")",
")",
"{",
"return",
"$",
"entity",
";",
"}",
"$",
... | Upload user image.
@param User $entity
@return User | [
"Upload",
"user",
"image",
"."
] | 00055834d9f094e63dcd8d66e2fedb822fcddee0 | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Service/UserService.php#L206-L229 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.