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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,700 | emhar/SearchDoctrineBundle | Query/Query.php | Query.buildScoreColumn | protected function buildScoreColumn(array $columns, $searchWordsCount)
{
$scoreExpression = $this->buildScore($columns, $searchWordsCount);
return array(
'expression' => $scoreExpression,
'type' => Type::INTEGER
);
} | php | protected function buildScoreColumn(array $columns, $searchWordsCount)
{
$scoreExpression = $this->buildScore($columns, $searchWordsCount);
return array(
'expression' => $scoreExpression,
'type' => Type::INTEGER
);
} | [
"protected",
"function",
"buildScoreColumn",
"(",
"array",
"$",
"columns",
",",
"$",
"searchWordsCount",
")",
"{",
"$",
"scoreExpression",
"=",
"$",
"this",
"->",
"buildScore",
"(",
"$",
"columns",
",",
"$",
"searchWordsCount",
")",
";",
"return",
"array",
"... | Build score column, with same structure as hit
@param array $columns
@param type $searchWordsCount
@return array | [
"Build",
"score",
"column",
"with",
"same",
"structure",
"as",
"hit"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L208-L215 |
3,701 | emhar/SearchDoctrineBundle | Query/Query.php | Query.buildScore | protected function buildScore(array $columns, $searchWordsCount)
{
$scores = array();
foreach($columns as $column)
{
if($column['scoreFactor'] != 0 && isset($column['expression']))
{
$stringConvertedExpression = $this->convertToString($column['type'], $column['expression']);
$score = $column['score... | php | protected function buildScore(array $columns, $searchWordsCount)
{
$scores = array();
foreach($columns as $column)
{
if($column['scoreFactor'] != 0 && isset($column['expression']))
{
$stringConvertedExpression = $this->convertToString($column['type'], $column['expression']);
$score = $column['score... | [
"protected",
"function",
"buildScore",
"(",
"array",
"$",
"columns",
",",
"$",
"searchWordsCount",
")",
"{",
"$",
"scores",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"columns",
"as",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"column",
"[",
"'s... | Build score expression
@param array $columns
@param type $searchWordsCount
@return string | [
"Build",
"score",
"expression"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L224-L243 |
3,702 | emhar/SearchDoctrineBundle | Query/Query.php | Query.buildJoinExpressions | protected function buildJoinExpressions(array $joins)
{
$joinExpressions = array();
foreach($joins as $joins)
{
$joinExpressions[] = 'LEFT JOIN ' . $joins['table'] . ' ' . $joins['tableAlias']
. ' ON ' . $joins['onClause'];
}
return $joinExpressions;
} | php | protected function buildJoinExpressions(array $joins)
{
$joinExpressions = array();
foreach($joins as $joins)
{
$joinExpressions[] = 'LEFT JOIN ' . $joins['table'] . ' ' . $joins['tableAlias']
. ' ON ' . $joins['onClause'];
}
return $joinExpressions;
} | [
"protected",
"function",
"buildJoinExpressions",
"(",
"array",
"$",
"joins",
")",
"{",
"$",
"joinExpressions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"joins",
"as",
"$",
"joins",
")",
"{",
"$",
"joinExpressions",
"[",
"]",
"=",
"'LEFT JOIN '",
... | Build joins expression
@param array $joins
@return string | [
"Build",
"joins",
"expression"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L275-L284 |
3,703 | emhar/SearchDoctrineBundle | Query/Query.php | Query.convertToString | protected function convertToString($type, $expression)
{
switch($type)
{
case Type::STRING:
case Type::TEXT:
return $expression;
case Type::BIGINT:
case Type::DECIMAL:
case Type::FLOAT:
case Type::INTEGER:
case Type::SMALLINT:
case Type::DATE:
case Type::DATETIME:
case Type::DATET... | php | protected function convertToString($type, $expression)
{
switch($type)
{
case Type::STRING:
case Type::TEXT:
return $expression;
case Type::BIGINT:
case Type::DECIMAL:
case Type::FLOAT:
case Type::INTEGER:
case Type::SMALLINT:
case Type::DATE:
case Type::DATETIME:
case Type::DATET... | [
"protected",
"function",
"convertToString",
"(",
"$",
"type",
",",
"$",
"expression",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"Type",
"::",
"STRING",
":",
"case",
"Type",
"::",
"TEXT",
":",
"return",
"$",
"expression",
";",
"case",
"Typ... | Return string string converted column
@param string $type
@param string $expression
@return string | [
"Return",
"string",
"string",
"converted",
"column"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L293-L313 |
3,704 | emhar/SearchDoctrineBundle | Query/Query.php | Query.mapDatabase | public function mapDatabase(array $databaseMapping, $itemClass, array $hitPositions)
{
$this->databaseMapping = $databaseMapping;
$this->loadFinalType($hitPositions);
$this->loadResultSetMappingAndScorePosition($itemClass, $hitPositions);
$this->finalTypes[$this->scorePos] = Type::INTEGER;
} | php | public function mapDatabase(array $databaseMapping, $itemClass, array $hitPositions)
{
$this->databaseMapping = $databaseMapping;
$this->loadFinalType($hitPositions);
$this->loadResultSetMappingAndScorePosition($itemClass, $hitPositions);
$this->finalTypes[$this->scorePos] = Type::INTEGER;
} | [
"public",
"function",
"mapDatabase",
"(",
"array",
"$",
"databaseMapping",
",",
"$",
"itemClass",
",",
"array",
"$",
"hitPositions",
")",
"{",
"$",
"this",
"->",
"databaseMapping",
"=",
"$",
"databaseMapping",
";",
"$",
"this",
"->",
"loadFinalType",
"(",
"$... | Loads and complete databaseMapping
@param array $databaseMapping
@param string $itemClass
@param array $hitPositions | [
"Loads",
"and",
"complete",
"databaseMapping"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Query/Query.php#L322-L328 |
3,705 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/stringObject.class.php | StringObject.isUTF8 | function isUTF8($str)
{
// astuce pour entrer dans un test booléen ^^
// (si c'est un tableau... ce qui est forcement vrai)
if (is_array($str)) {
$str = implode('', $str);
// retourne FALSE si aucun caractere n'appartient au jeu utf8
return !((ord($str[0... | php | function isUTF8($str)
{
// astuce pour entrer dans un test booléen ^^
// (si c'est un tableau... ce qui est forcement vrai)
if (is_array($str)) {
$str = implode('', $str);
// retourne FALSE si aucun caractere n'appartient au jeu utf8
return !((ord($str[0... | [
"function",
"isUTF8",
"(",
"$",
"str",
")",
"{",
"// astuce pour entrer dans un test booléen ^^",
"// (si c'est un tableau... ce qui est forcement vrai)",
"if",
"(",
"is_array",
"(",
"$",
"str",
")",
")",
"{",
"$",
"str",
"=",
"implode",
"(",
"''",
",",
"$",
"str"... | Fonction permettant de savoir s'il y a des caracteres en utf8 dans la chaine
@param string $str Chaine à tester
@return string | [
"Fonction",
"permettant",
"de",
"savoir",
"s",
"il",
"y",
"a",
"des",
"caracteres",
"en",
"utf8",
"dans",
"la",
"chaine"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/stringObject.class.php#L194-L207 |
3,706 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/stringObject.class.php | StringObject.encodeToUTF8 | function encodeToUTF8($str)
{
$encodage = mb_detect_encoding($str, "UTF-8, ISO-8859-1, ISO-8859-15, windows-1252", true);
$str_utf8 = mb_convert_encoding($str, "UTF-8", $encodage);
return $str_utf8;
} | php | function encodeToUTF8($str)
{
$encodage = mb_detect_encoding($str, "UTF-8, ISO-8859-1, ISO-8859-15, windows-1252", true);
$str_utf8 = mb_convert_encoding($str, "UTF-8", $encodage);
return $str_utf8;
} | [
"function",
"encodeToUTF8",
"(",
"$",
"str",
")",
"{",
"$",
"encodage",
"=",
"mb_detect_encoding",
"(",
"$",
"str",
",",
"\"UTF-8, ISO-8859-1, ISO-8859-15, windows-1252\"",
",",
"true",
")",
";",
"$",
"str_utf8",
"=",
"mb_convert_encoding",
"(",
"$",
"str",
",",... | Fonction d'encodage en utf8 a partir d'autre encodage , pratique => detection
@param string $str Chaine à encoder
@return string | [
"Fonction",
"d",
"encodage",
"en",
"utf8",
"a",
"partir",
"d",
"autre",
"encodage",
"pratique",
"=",
">",
"detection"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/stringObject.class.php#L216-L221 |
3,707 | Archi-Strasbourg/archi-wiki | includes/framework/frameworkClasses/stringObject.class.php | StringObject.getTexteDifferences | public function getTexteDifferences($params = array())
{
$retour = "";
if (isset($params['nouveau']) && isset($params['ancien'])) {
$fd = new filediff(); // appel de la classe filediff integree au framework
$fd->set_textes($params['nouveau'], $params['ancien']);
... | php | public function getTexteDifferences($params = array())
{
$retour = "";
if (isset($params['nouveau']) && isset($params['ancien'])) {
$fd = new filediff(); // appel de la classe filediff integree au framework
$fd->set_textes($params['nouveau'], $params['ancien']);
... | [
"public",
"function",
"getTexteDifferences",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"retour",
"=",
"\"\"",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'nouveau'",
"]",
")",
"&&",
"isset",
"(",
"$",
"params",
"[",
"'ancien'"... | Permet de comparer 2 fichiers
@param array $params Liste de paramètres
@return array | [
"Permet",
"de",
"comparer",
"2",
"fichiers"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/includes/framework/frameworkClasses/stringObject.class.php#L292-L308 |
3,708 | kecik-framework/mvc | MVC/Controller.php | Controller.view | protected function view($file, $param=array()) {
extract($param);
if (!is_array($file)) {
$path = explode('\\', get_class($this));
if (count($path) > 2) {
$view_path = '';
for($i=0; $i<count($path)-2; $i++) {
$view_path .= strtolower($path[$i]).'/';
}
$view_path = Config::get('pat... | php | protected function view($file, $param=array()) {
extract($param);
if (!is_array($file)) {
$path = explode('\\', get_class($this));
if (count($path) > 2) {
$view_path = '';
for($i=0; $i<count($path)-2; $i++) {
$view_path .= strtolower($path[$i]).'/';
}
$view_path = Config::get('pat... | [
"protected",
"function",
"view",
"(",
"$",
"file",
",",
"$",
"param",
"=",
"array",
"(",
")",
")",
"{",
"extract",
"(",
"$",
"param",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"file",
")",
")",
"{",
"$",
"path",
"=",
"explode",
"(",
"'\\\... | view
Funngsi untuk menampilkan view
@param string $file
@param array $param | [
"view",
"Funngsi",
"untuk",
"menampilkan",
"view"
] | 1da3d7f4f4cbb35fa59d8a41c68c49b219763131 | https://github.com/kecik-framework/mvc/blob/1da3d7f4f4cbb35fa59d8a41c68c49b219763131/MVC/Controller.php#L80-L117 |
3,709 | SagePHP/System | src/SagePHP/System/Dialog/PromptDialog.php | PromptDialog.setQuestion | public function setQuestion($question)
{
if (false === is_string($question)) {
throw new \InvalidArgumentException('Question should be a string');
}
$this->question = trim($question) . " " ;
return $this;
} | php | public function setQuestion($question)
{
if (false === is_string($question)) {
throw new \InvalidArgumentException('Question should be a string');
}
$this->question = trim($question) . " " ;
return $this;
} | [
"public",
"function",
"setQuestion",
"(",
"$",
"question",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"question",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Question should be a string'",
")",
";",
"}",
"$",
"thi... | Sets the value of question.
@param string $question the question
@return self | [
"Sets",
"the",
"value",
"of",
"question",
"."
] | 4fbac093c16c65607e75dc31b54be9593b82c56a | https://github.com/SagePHP/System/blob/4fbac093c16c65607e75dc31b54be9593b82c56a/src/SagePHP/System/Dialog/PromptDialog.php#L48-L57 |
3,710 | cosmow/riak | lib/CosmoW/Riak/GridFS.php | GridFS.doFindAndRemove | protected function doFindAndRemove(array $query, array $options = array())
{
$document = parent::doFindAndRemove($query, $options);
if (isset($document)) {
// Remove the file data from the chunks collection
$this->riakCollection->chunks->remove(array('files_id' => $document[... | php | protected function doFindAndRemove(array $query, array $options = array())
{
$document = parent::doFindAndRemove($query, $options);
if (isset($document)) {
// Remove the file data from the chunks collection
$this->riakCollection->chunks->remove(array('files_id' => $document[... | [
"protected",
"function",
"doFindAndRemove",
"(",
"array",
"$",
"query",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"document",
"=",
"parent",
"::",
"doFindAndRemove",
"(",
"$",
"query",
",",
"$",
"options",
")",
";",
"if",
"("... | Execute the findAndModify command with the remove option and delete any
chunks for the document.
@see Collection::doFindAndRemove()
@param array $query
@param array $options
@return array|null | [
"Execute",
"the",
"findAndModify",
"command",
"with",
"the",
"remove",
"option",
"and",
"delete",
"any",
"chunks",
"for",
"the",
"document",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/GridFS.php#L125-L135 |
3,711 | cosmow/riak | lib/CosmoW/Riak/GridFS.php | GridFS.doInsert | protected function doInsert(array &$a, array $options = array())
{
// If there is no file, perform a basic insertion
if ( ! isset($a['file'])) {
parent::doInsert($a, $options);
return;
}
/* If the file is dirty (i.e. it must be persisted), delegate to the
... | php | protected function doInsert(array &$a, array $options = array())
{
// If there is no file, perform a basic insertion
if ( ! isset($a['file'])) {
parent::doInsert($a, $options);
return;
}
/* If the file is dirty (i.e. it must be persisted), delegate to the
... | [
"protected",
"function",
"doInsert",
"(",
"array",
"&",
"$",
"a",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// If there is no file, perform a basic insertion",
"if",
"(",
"!",
"isset",
"(",
"$",
"a",
"[",
"'file'",
"]",
")",
")",
"... | Execute the insert query and persist the GridFSFile if necessary.
@see Collection::doInsert()
@param array $a
@param array $options
@return mixed | [
"Execute",
"the",
"insert",
"query",
"and",
"persist",
"the",
"GridFSFile",
"if",
"necessary",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/GridFS.php#L171-L193 |
3,712 | cosmow/riak | lib/CosmoW/Riak/GridFS.php | GridFS.doSave | protected function doSave(array &$a, array $options = array())
{
if (isset($a['_id'])) {
return $this->doUpdate(array('_id' => $a['_id']), $a, $options);
} else {
return $this->doInsert($a, $options);
}
} | php | protected function doSave(array &$a, array $options = array())
{
if (isset($a['_id'])) {
return $this->doUpdate(array('_id' => $a['_id']), $a, $options);
} else {
return $this->doInsert($a, $options);
}
} | [
"protected",
"function",
"doSave",
"(",
"array",
"&",
"$",
"a",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"a",
"[",
"'_id'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"doUpdate",
"(",
"... | Execute the save query and persist the GridFSFile if necessary.
@see Collection::doSave()
@param array $a
@param array $options
@return mixed | [
"Execute",
"the",
"save",
"query",
"and",
"persist",
"the",
"GridFSFile",
"if",
"necessary",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/GridFS.php#L203-L210 |
3,713 | mpaleo/scaffolder-support | src/Scaffolder/Support/PathParser.php | PathParser.parse | public static function parse($path)
{
$path = explode(':', $path, 2);
if (count($path) == 2)
{
if (head($path) == 'app')
{
$path = app_path(last($path));
}
elseif (head($path) == 'base')
{
$path = ba... | php | public static function parse($path)
{
$path = explode(':', $path, 2);
if (count($path) == 2)
{
if (head($path) == 'app')
{
$path = app_path(last($path));
}
elseif (head($path) == 'base')
{
$path = ba... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"explode",
"(",
"':'",
",",
"$",
"path",
",",
"2",
")",
";",
"if",
"(",
"count",
"(",
"$",
"path",
")",
"==",
"2",
")",
"{",
"if",
"(",
"head",
"(",
"$",
... | Parse a path.
@param $path
@return array|string | [
"Parse",
"a",
"path",
"."
] | d599c88596c65302a984078cd0519221a2d2ceac | https://github.com/mpaleo/scaffolder-support/blob/d599c88596c65302a984078cd0519221a2d2ceac/src/Scaffolder/Support/PathParser.php#L14-L55 |
3,714 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.reset | public function reset()
{
$this->class = null;
$this->with = [];
$this->flags = [];
$this->columns = [];
$this->from = [];
$this->join = [];
$this->where = [];
$this->groupBy = [];
$this->having = [];
$this->ord... | php | public function reset()
{
$this->class = null;
$this->with = [];
$this->flags = [];
$this->columns = [];
$this->from = [];
$this->join = [];
$this->where = [];
$this->groupBy = [];
$this->having = [];
$this->ord... | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"class",
"=",
"null",
";",
"$",
"this",
"->",
"with",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"flags",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"columns",
"=",
"[",
"]",
";",
"$",
... | Reset the query. | [
"Reset",
"the",
"query",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L177-L202 |
3,715 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.quoteColumn | protected function quoteColumn($column)
{
if (($pos = strpos($column, '.')) !== false) {
return $this->db->quoteName(substr($column, 0, $pos)) . '.' . $this->db->quoteName(substr($column, $pos + 1));
}
return $this->db->quoteName($column);
} | php | protected function quoteColumn($column)
{
if (($pos = strpos($column, '.')) !== false) {
return $this->db->quoteName(substr($column, 0, $pos)) . '.' . $this->db->quoteName(substr($column, $pos + 1));
}
return $this->db->quoteName($column);
} | [
"protected",
"function",
"quoteColumn",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"column",
",",
"'.'",
")",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"quoteName",
"(",
"substr"... | Quote a column.
@param $column
@return string | [
"Quote",
"a",
"column",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L428-L435 |
3,716 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.eagerLoadRelations | protected function eagerLoadRelations(array $entities)
{
if (empty($entities)) {
return;
}
if ($this->class === null) {
throw new LogicException('A class must be specified for Eager Loading using the `asClass` method.');
}
foreach ($this->with as $me... | php | protected function eagerLoadRelations(array $entities)
{
if (empty($entities)) {
return;
}
if ($this->class === null) {
throw new LogicException('A class must be specified for Eager Loading using the `asClass` method.');
}
foreach ($this->with as $me... | [
"protected",
"function",
"eagerLoadRelations",
"(",
"array",
"$",
"entities",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"entities",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"class",
"===",
"null",
")",
"{",
"throw",
"new",
"Logi... | Eager load the relationships.
@param Model[] $entities Local entities | [
"Eager",
"load",
"the",
"relationships",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L855-L875 |
3,717 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.getRelation | protected function getRelation($entity, $method)
{
// We need to check the relationship method only at the first local entity, because all entities must be of the same class.
if (!method_exists($entity, $method)) {
throw new LogicException('Call to undefined relationship "' . $method . '... | php | protected function getRelation($entity, $method)
{
// We need to check the relationship method only at the first local entity, because all entities must be of the same class.
if (!method_exists($entity, $method)) {
throw new LogicException('Call to undefined relationship "' . $method . '... | [
"protected",
"function",
"getRelation",
"(",
"$",
"entity",
",",
"$",
"method",
")",
"{",
"// We need to check the relationship method only at the first local entity, because all entities must be of the same class.",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"entity",
",",
"... | Get the relation instance for the given relationship method.
@param Model $entity Instance of the local entity.
@param string $method Name of the relationship method.
@return Relation | [
"Get",
"the",
"relation",
"instance",
"for",
"the",
"given",
"relationship",
"method",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L884-L901 |
3,718 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.hasExactlyOneColumn | private function hasExactlyOneColumn()
{
if (count($this->columns) != 1 || strpos($this->columns[0], '*') !== false) {
return false;
}
if (strpos($this->columns[0], ',') === false) {
return true;
}
// The column expression includes a comma. Is this a... | php | private function hasExactlyOneColumn()
{
if (count($this->columns) != 1 || strpos($this->columns[0], '*') !== false) {
return false;
}
if (strpos($this->columns[0], ',') === false) {
return true;
}
// The column expression includes a comma. Is this a... | [
"private",
"function",
"hasExactlyOneColumn",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"columns",
")",
"!=",
"1",
"||",
"strpos",
"(",
"$",
"this",
"->",
"columns",
"[",
"0",
"]",
",",
"'*'",
")",
"!==",
"false",
")",
"{",
"return... | Determine if the statement has exactly one column.
@return bool | [
"Determine",
"if",
"the",
"statement",
"has",
"exactly",
"one",
"column",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L911-L939 |
3,719 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.aggregate | protected function aggregate($function, $column = null)
{
if ($column === null) {
if ($this->hasExactlyOneColumn()) {
if (($pos = strpos($this->columns[0], ' AS ')) !== false) {
$column = substr($this->columns[0], 0, $pos);
}
el... | php | protected function aggregate($function, $column = null)
{
if ($column === null) {
if ($this->hasExactlyOneColumn()) {
if (($pos = strpos($this->columns[0], ' AS ')) !== false) {
$column = substr($this->columns[0], 0, $pos);
}
el... | [
"protected",
"function",
"aggregate",
"(",
"$",
"function",
",",
"$",
"column",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"column",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasExactlyOneColumn",
"(",
")",
")",
"{",
"if",
"(",
"(",
"$",
... | Execute an aggregate function.
Note, that ORDER BY and LIMIT generally have no effect on the calculation of aggregate functions.
Furthermore, GROUP BY and HAVING BY are omit too, because we wish calculate a aggregate value about all records.
@param string $function
@param string|null $column
@return int|float | [
"Execute",
"an",
"aggregate",
"function",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L951-L989 |
3,720 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.doInsert | protected function doInsert(array $data = [])
{
if (empty($data)) {
$this->insertEmptyRecord();
return $this->db->lastInsertId();
}
if (!is_int(key($data))) {
// single record is inserted
$columns = implode(', ', array_map([$this->db, 'quoteN... | php | protected function doInsert(array $data = [])
{
if (empty($data)) {
$this->insertEmptyRecord();
return $this->db->lastInsertId();
}
if (!is_int(key($data))) {
// single record is inserted
$columns = implode(', ', array_map([$this->db, 'quoteN... | [
"protected",
"function",
"doInsert",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"insertEmptyRecord",
"(",
")",
";",
"return",
"$",
"this",
"->",
"db",
"->",
"lastInser... | Insert rows to the table and return the inserted autoincrement sequence value.
If you insert multiple rows, the method returns dependent to the driver the first or last inserted id!.
@param array $data Values to be updated
@return int|false | [
"Insert",
"rows",
"to",
"the",
"table",
"and",
"return",
"the",
"inserted",
"autoincrement",
"sequence",
"value",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1154-L1198 |
3,721 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.doUpdate | protected function doUpdate(array $data)
{
if (empty($data)) {
throw new InvalidArgumentException('Cannot update an empty record.');
}
$bindings = array_merge($this->bindings['join'], $this->bindings['where']);
$settings = [];
$values = [];
if (empty($b... | php | protected function doUpdate(array $data)
{
if (empty($data)) {
throw new InvalidArgumentException('Cannot update an empty record.');
}
$bindings = array_merge($this->bindings['join'], $this->bindings['where']);
$settings = [];
$values = [];
if (empty($b... | [
"protected",
"function",
"doUpdate",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Cannot update an empty record.'",
")",
";",
"}",
"$",
"bindings",
"=",
"array_me... | Update all records of the query result with th given data and return the number of affected rows.
@param array $data Values to be updated
@return int | [
"Update",
"all",
"records",
"of",
"the",
"query",
"result",
"with",
"th",
"given",
"data",
"and",
"return",
"the",
"number",
"of",
"affected",
"rows",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1279-L1321 |
3,722 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.doDelete | protected function doDelete()
{
$bindings = array_merge($this->bindings['join'], $this->bindings['where']);
$query = 'DELETE'
. $this->buildFrom()
. $this->buildJoin()
. $this->buildWhere();
return $this->db->exec($query, $bindings);
} | php | protected function doDelete()
{
$bindings = array_merge($this->bindings['join'], $this->bindings['where']);
$query = 'DELETE'
. $this->buildFrom()
. $this->buildJoin()
. $this->buildWhere();
return $this->db->exec($query, $bindings);
} | [
"protected",
"function",
"doDelete",
"(",
")",
"{",
"$",
"bindings",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"bindings",
"[",
"'join'",
"]",
",",
"$",
"this",
"->",
"bindings",
"[",
"'where'",
"]",
")",
";",
"$",
"query",
"=",
"'DELETE'",
".",
"$... | Delete all records of the query result and return the number of affected rows.
@return int | [
"Delete",
"all",
"records",
"of",
"the",
"query",
"result",
"and",
"return",
"the",
"number",
"of",
"affected",
"rows",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1385-L1395 |
3,723 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.putBindings | protected function putBindings($clause, array $bindings)
{
if (!empty($bindings)) {
$this->bindings[$clause] = array_merge($this->bindings[$clause], $bindings);
}
} | php | protected function putBindings($clause, array $bindings)
{
if (!empty($bindings)) {
$this->bindings[$clause] = array_merge($this->bindings[$clause], $bindings);
}
} | [
"protected",
"function",
"putBindings",
"(",
"$",
"clause",
",",
"array",
"$",
"bindings",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"bindings",
")",
")",
"{",
"$",
"this",
"->",
"bindings",
"[",
"$",
"clause",
"]",
"=",
"array_merge",
"(",
"$",
... | Put the bindings into the list.
@param string $clause
@param array $bindings | [
"Put",
"the",
"bindings",
"into",
"the",
"list",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1420-L1425 |
3,724 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.compileColumns | protected function compileColumns($columns, $clause)
{
$list = [];
foreach ((array)$columns as $alias => $column) {
if (is_string($column) && preg_match('/^(?:([0-9a-zA-Z$_]+)\.)?([0-9a-zA-Z$_]+)$/s', trim($column), $match)) { // for maximum performance, first check the most common case.... | php | protected function compileColumns($columns, $clause)
{
$list = [];
foreach ((array)$columns as $alias => $column) {
if (is_string($column) && preg_match('/^(?:([0-9a-zA-Z$_]+)\.)?([0-9a-zA-Z$_]+)$/s', trim($column), $match)) { // for maximum performance, first check the most common case.... | [
"protected",
"function",
"compileColumns",
"(",
"$",
"columns",
",",
"$",
"clause",
")",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"columns",
"as",
"$",
"alias",
"=>",
"$",
"column",
")",
"{",
"if",
"(",
"is_stri... | Render the column list.
@param string|array $columns One or more columns or subquery.
@param string $clause Key for the binding list: "select", "group" or "order"
@return array | [
"Render",
"the",
"column",
"list",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1434-L1466 |
3,725 | pletfix/core | src/Services/PDOs/Builders/Builder.php | Builder.buildLimit | protected function buildLimit()
{
return $this->limit !== null ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '';
} | php | protected function buildLimit()
{
return $this->limit !== null ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '';
} | [
"protected",
"function",
"buildLimit",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"limit",
"!==",
"null",
"?",
"' LIMIT '",
".",
"$",
"this",
"->",
"limit",
".",
"(",
"$",
"this",
"->",
"offset",
"?",
"' OFFSET '",
".",
"$",
"this",
"->",
"offset",
... | Builds the `LIMIT ... OFFSET` clause.
@return string | [
"Builds",
"the",
"LIMIT",
"...",
"OFFSET",
"clause",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Builders/Builder.php#L1694-L1697 |
3,726 | cosmow/riak | lib/CosmoW/Riak/Connection.php | Connection.initialize | public function initialize()
{
if ($this->riakClient !== null) {
return;
}
if ($this->eventManager->hasListeners(Events::preConnect)) {
$this->eventManager->dispatchEvent(Events::preConnect, new EventArgs($this));
}
$server = $this->server ?: 'http:/... | php | public function initialize()
{
if ($this->riakClient !== null) {
return;
}
if ($this->eventManager->hasListeners(Events::preConnect)) {
$this->eventManager->dispatchEvent(Events::preConnect, new EventArgs($this));
}
$server = $this->server ?: 'http:/... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"riakClient",
"!==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"eventManager",
"->",
"hasListeners",
"(",
"Events",
"::",
"preConnect",
")",
")",... | Construct the wrapped RiakClient instance if necessary.
This method will dispatch preConnect and postConnect events. | [
"Construct",
"the",
"wrapped",
"RiakClient",
"instance",
"if",
"necessary",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Connection.php#L270-L296 |
3,727 | cosmow/riak | lib/CosmoW/Riak/Connection.php | Connection.convertConnectTimeout | protected function convertConnectTimeout(array $options)
{
if (version_compare(phpversion('mongo'), '1.4.0', '<')) {
return $options;
}
if (isset($options['timeout']) && ! isset($options['connectTimeoutMS'])) {
$options['connectTimeoutMS'] = $options['timeout'];
... | php | protected function convertConnectTimeout(array $options)
{
if (version_compare(phpversion('mongo'), '1.4.0', '<')) {
return $options;
}
if (isset($options['timeout']) && ! isset($options['connectTimeoutMS'])) {
$options['connectTimeoutMS'] = $options['timeout'];
... | [
"protected",
"function",
"convertConnectTimeout",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"version_compare",
"(",
"phpversion",
"(",
"'mongo'",
")",
",",
"'1.4.0'",
",",
"'<'",
")",
")",
"{",
"return",
"$",
"options",
";",
"}",
"if",
"(",
"iss... | Converts "timeout" RiakClient constructor option to "connectTimeoutMS"
for driver versions 1.4.0+.
Note: RiakClient actually allows case-insensitive option names, but
we'll only process the canonical version here.
@param array $options
@return array | [
"Converts",
"timeout",
"RiakClient",
"constructor",
"option",
"to",
"connectTimeoutMS",
"for",
"driver",
"versions",
"1",
".",
"4",
".",
"0",
"+",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Connection.php#L469-L481 |
3,728 | cosmow/riak | lib/CosmoW/Riak/Connection.php | Connection.convertWriteTimeout | protected function convertWriteTimeout(array $options)
{
if (version_compare(phpversion('mongo'), '1.4.0', '<')) {
return $options;
}
if (isset($options['wTimeout']) && ! isset($options['wTimeoutMS'])) {
$options['wTimeoutMS'] = $options['wTimeout'];
unse... | php | protected function convertWriteTimeout(array $options)
{
if (version_compare(phpversion('mongo'), '1.4.0', '<')) {
return $options;
}
if (isset($options['wTimeout']) && ! isset($options['wTimeoutMS'])) {
$options['wTimeoutMS'] = $options['wTimeout'];
unse... | [
"protected",
"function",
"convertWriteTimeout",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"version_compare",
"(",
"phpversion",
"(",
"'mongo'",
")",
",",
"'1.4.0'",
",",
"'<'",
")",
")",
"{",
"return",
"$",
"options",
";",
"}",
"if",
"(",
"isset... | Converts "wTimeout" RiakClient constructor option to "wTimeoutMS" for
driver versions 1.4.0+.
Note: RiakClient actually allows case-insensitive option names, but
we'll only process the canonical version here.
@param array $options
@return array | [
"Converts",
"wTimeout",
"RiakClient",
"constructor",
"option",
"to",
"wTimeoutMS",
"for",
"driver",
"versions",
"1",
".",
"4",
".",
"0",
"+",
"."
] | 49c2bbfbbc036cd38babfeba1e93667ceca5ec0a | https://github.com/cosmow/riak/blob/49c2bbfbbc036cd38babfeba1e93667ceca5ec0a/lib/CosmoW/Riak/Connection.php#L493-L505 |
3,729 | nirvana-msu/yii2-helpers | RbacHelper.php | RbacHelper.createRole | public static function createRole($name, $description)
{
// Create role with a given name and description and add it to RBAC system
$auth = Yii::$app->authManager;
$role = $auth->createRole($name);
$role->description = $description;
$auth->add($role);
return $role;
... | php | public static function createRole($name, $description)
{
// Create role with a given name and description and add it to RBAC system
$auth = Yii::$app->authManager;
$role = $auth->createRole($name);
$role->description = $description;
$auth->add($role);
return $role;
... | [
"public",
"static",
"function",
"createRole",
"(",
"$",
"name",
",",
"$",
"description",
")",
"{",
"// Create role with a given name and description and add it to RBAC system",
"$",
"auth",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
";",
"$",
"role",
"=",
... | Creates role with a given name and description and adds it to RBAC system.
@param string $name
@param string $description
@return Role | [
"Creates",
"role",
"with",
"a",
"given",
"name",
"and",
"description",
"and",
"adds",
"it",
"to",
"RBAC",
"system",
"."
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/RbacHelper.php#L27-L36 |
3,730 | nirvana-msu/yii2-helpers | RbacHelper.php | RbacHelper.createChildPermission | public static function createChildPermission($role, $name, $description)
{
// Create permission with a given name and description and add it to RBAC system
$auth = Yii::$app->authManager;
$permission = $auth->createPermission($name);
$permission->description = $description;
$... | php | public static function createChildPermission($role, $name, $description)
{
// Create permission with a given name and description and add it to RBAC system
$auth = Yii::$app->authManager;
$permission = $auth->createPermission($name);
$permission->description = $description;
$... | [
"public",
"static",
"function",
"createChildPermission",
"(",
"$",
"role",
",",
"$",
"name",
",",
"$",
"description",
")",
"{",
"// Create permission with a given name and description and add it to RBAC system",
"$",
"auth",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authMa... | Creates permission with a given name and description and adds it to RBAC system,
assigning permission to the role.
@param Role $role
@param string $name
@param string $description
@return Permission | [
"Creates",
"permission",
"with",
"a",
"given",
"name",
"and",
"description",
"and",
"adds",
"it",
"to",
"RBAC",
"system",
"assigning",
"permission",
"to",
"the",
"role",
"."
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/RbacHelper.php#L46-L58 |
3,731 | nirvana-msu/yii2-helpers | RbacHelper.php | RbacHelper.removeRuleByName | public static function removeRuleByName($name)
{
$auth = Yii::$app->authManager;
$rule = $auth->getRule($name);
return $auth->remove($rule);
} | php | public static function removeRuleByName($name)
{
$auth = Yii::$app->authManager;
$rule = $auth->getRule($name);
return $auth->remove($rule);
} | [
"public",
"static",
"function",
"removeRuleByName",
"(",
"$",
"name",
")",
"{",
"$",
"auth",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
";",
"$",
"rule",
"=",
"$",
"auth",
"->",
"getRule",
"(",
"$",
"name",
")",
";",
"return",
"$",
"auth",
... | Removes rule from RBAC system by name.
@param string $name
@return boolean whether the rule is successfully removed | [
"Removes",
"rule",
"from",
"RBAC",
"system",
"by",
"name",
"."
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/RbacHelper.php#L65-L70 |
3,732 | nirvana-msu/yii2-helpers | RbacHelper.php | RbacHelper.removePermissionByName | public static function removePermissionByName($name)
{
$auth = Yii::$app->authManager;
$permission = $auth->getPermission($name);
return $auth->remove($permission);
} | php | public static function removePermissionByName($name)
{
$auth = Yii::$app->authManager;
$permission = $auth->getPermission($name);
return $auth->remove($permission);
} | [
"public",
"static",
"function",
"removePermissionByName",
"(",
"$",
"name",
")",
"{",
"$",
"auth",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
";",
"$",
"permission",
"=",
"$",
"auth",
"->",
"getPermission",
"(",
"$",
"name",
")",
";",
"return",
... | Removes permission from RBAC system by name.
@param string $name
@return boolean whether the permission is successfully removed | [
"Removes",
"permission",
"from",
"RBAC",
"system",
"by",
"name",
"."
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/RbacHelper.php#L77-L82 |
3,733 | nirvana-msu/yii2-helpers | RbacHelper.php | RbacHelper.removeRoleByName | public static function removeRoleByName($name)
{
$auth = Yii::$app->authManager;
$role = $auth->getRole($name);
return $auth->remove($role);
} | php | public static function removeRoleByName($name)
{
$auth = Yii::$app->authManager;
$role = $auth->getRole($name);
return $auth->remove($role);
} | [
"public",
"static",
"function",
"removeRoleByName",
"(",
"$",
"name",
")",
"{",
"$",
"auth",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
";",
"$",
"role",
"=",
"$",
"auth",
"->",
"getRole",
"(",
"$",
"name",
")",
";",
"return",
"$",
"auth",
... | Removes role from RBAC system by name.
@param string $name
@return boolean whether the role is successfully removed | [
"Removes",
"role",
"from",
"RBAC",
"system",
"by",
"name",
"."
] | 1aeecfe8c47211440bab1aa30b65cc205f0ea9ba | https://github.com/nirvana-msu/yii2-helpers/blob/1aeecfe8c47211440bab1aa30b65cc205f0ea9ba/RbacHelper.php#L89-L94 |
3,734 | emaphp/eMapper | lib/eMapper/Reflection/EntityMapper.php | EntityMapper.buildListExpression | protected function buildListExpression(ClassProfile $entity, $index = null, $group = null) {
$expr = 'obj:' . $entity->getReflectionClass()->getName();
if (isset($group))
$expr .= '<' . $group . '>';
if (isset($index))
$expr .= '[' . $index . ']';
else
$expr .= '[]';
return $expr;
} | php | protected function buildListExpression(ClassProfile $entity, $index = null, $group = null) {
$expr = 'obj:' . $entity->getReflectionClass()->getName();
if (isset($group))
$expr .= '<' . $group . '>';
if (isset($index))
$expr .= '[' . $index . ']';
else
$expr .= '[]';
return $expr;
} | [
"protected",
"function",
"buildListExpression",
"(",
"ClassProfile",
"$",
"entity",
",",
"$",
"index",
"=",
"null",
",",
"$",
"group",
"=",
"null",
")",
"{",
"$",
"expr",
"=",
"'obj:'",
".",
"$",
"entity",
"->",
"getReflectionClass",
"(",
")",
"->",
"get... | Obtains a list mapping expression for the give profile
@param \eMapper\Reflection\ClassProfile $entity
@param string $index
@param string $group
@return string | [
"Obtains",
"a",
"list",
"mapping",
"expression",
"for",
"the",
"give",
"profile"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Reflection/EntityMapper.php#L25-L37 |
3,735 | neemzy/patchwork-core | src/Model/SlugModel.php | SlugModel.vulgarize | private function vulgarize($string)
{
return trim(
preg_replace(
'/(-+)/',
'-',
preg_replace(
'/([^a-z0-9-]*)/',
'',
preg_replace(
'/((\s|\.|\'|\/)+)/',
... | php | private function vulgarize($string)
{
return trim(
preg_replace(
'/(-+)/',
'-',
preg_replace(
'/([^a-z0-9-]*)/',
'',
preg_replace(
'/((\s|\.|\'|\/)+)/',
... | [
"private",
"function",
"vulgarize",
"(",
"$",
"string",
")",
"{",
"return",
"trim",
"(",
"preg_replace",
"(",
"'/(-+)/'",
",",
"'-'",
",",
"preg_replace",
"(",
"'/([^a-z0-9-]*)/'",
",",
"''",
",",
"preg_replace",
"(",
"'/((\\s|\\.|\\'|\\/)+)/'",
",",
"'-'",
",... | Makes a string URL-compatible
@param string $string String to transform
@return string | [
"Makes",
"a",
"string",
"URL",
"-",
"compatible"
] | 81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee | https://github.com/neemzy/patchwork-core/blob/81c31b5c0b3a82a04ed90eb17cefaf2faddee4ee/src/Model/SlugModel.php#L51-L87 |
3,736 | codebobbly/dvoconnector | Classes/Service/Url/RealUrlAssociation.php | RealUrlAssociation.isNameUnique | protected function isNameUnique($association)
{
$associations = $this->determineAssociationsByName($association->getName());
return $associations->getAssociations()->count() == 1;
} | php | protected function isNameUnique($association)
{
$associations = $this->determineAssociationsByName($association->getName());
return $associations->getAssociations()->count() == 1;
} | [
"protected",
"function",
"isNameUnique",
"(",
"$",
"association",
")",
"{",
"$",
"associations",
"=",
"$",
"this",
"->",
"determineAssociationsByName",
"(",
"$",
"association",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
"associations",
"->",
"getAssoc... | determine if the association is unique by the name
@param Association $association
@return bool
@throws \Exception | [
"determine",
"if",
"the",
"association",
"is",
"unique",
"by",
"the",
"name"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/Url/RealUrlAssociation.php#L42-L46 |
3,737 | codebobbly/dvoconnector | Classes/Service/Url/RealUrlAssociation.php | RealUrlAssociation.determineAssociationsByName | protected function determineAssociationsByName($name)
{
$associationsFilter = new AssociationsFilter();
$associationsFilter->setName($name);
$associations = $this->associationRepository->findAssociationsByRootAssociations($associationsFilter);
return $associations;
} | php | protected function determineAssociationsByName($name)
{
$associationsFilter = new AssociationsFilter();
$associationsFilter->setName($name);
$associations = $this->associationRepository->findAssociationsByRootAssociations($associationsFilter);
return $associations;
} | [
"protected",
"function",
"determineAssociationsByName",
"(",
"$",
"name",
")",
"{",
"$",
"associationsFilter",
"=",
"new",
"AssociationsFilter",
"(",
")",
";",
"$",
"associationsFilter",
"->",
"setName",
"(",
"$",
"name",
")",
";",
"$",
"associations",
"=",
"$... | determine offset for association
@param string $name
@return string | [
"determine",
"offset",
"for",
"association"
] | 9b63790d2fc9fd21bf415b4a5757678895b73bbc | https://github.com/codebobbly/dvoconnector/blob/9b63790d2fc9fd21bf415b4a5757678895b73bbc/Classes/Service/Url/RealUrlAssociation.php#L55-L63 |
3,738 | detailnet/dfw-filtering | src/Detail/Filtering/Zend/InputFilter/BaseFilter.php | BaseFilter.setData | public function setData($data)
{
// setData() expects array, but we can't prevent users from providing other types.
// So instead of an exception we just want this input filter to be invalid...
try {
parent::setData($data);
$this->invalidData = null;
$this... | php | public function setData($data)
{
// setData() expects array, but we can't prevent users from providing other types.
// So instead of an exception we just want this input filter to be invalid...
try {
parent::setData($data);
$this->invalidData = null;
$this... | [
"public",
"function",
"setData",
"(",
"$",
"data",
")",
"{",
"// setData() expects array, but we can't prevent users from providing other types.",
"// So instead of an exception we just want this input filter to be invalid...",
"try",
"{",
"parent",
"::",
"setData",
"(",
"$",
"data... | Set data to use when validating and filtering
@param array|Traversable $data
@return BaseFilter | [
"Set",
"data",
"to",
"use",
"when",
"validating",
"and",
"filtering"
] | cb5314a8c0153c922f52eb469826561a7b1ad5e0 | https://github.com/detailnet/dfw-filtering/blob/cb5314a8c0153c922f52eb469826561a7b1ad5e0/src/Detail/Filtering/Zend/InputFilter/BaseFilter.php#L125-L139 |
3,739 | detailnet/dfw-filtering | src/Detail/Filtering/Zend/InputFilter/BaseFilter.php | BaseFilter.isValid | public function isValid($context = null)
{
// When there's an invalid data type, it should immediately report as invalid.
if ($this->invalidDataTypeException !== null) {
return false;
}
// When there's no data and the filter itself is not required,
// it should i... | php | public function isValid($context = null)
{
// When there's an invalid data type, it should immediately report as invalid.
if ($this->invalidDataTypeException !== null) {
return false;
}
// When there's no data and the filter itself is not required,
// it should i... | [
"public",
"function",
"isValid",
"(",
"$",
"context",
"=",
"null",
")",
"{",
"// When there's an invalid data type, it should immediately report as invalid.",
"if",
"(",
"$",
"this",
"->",
"invalidDataTypeException",
"!==",
"null",
")",
"{",
"return",
"false",
";",
"}... | Is the data set valid?
@param mixed|null $context
@return boolean | [
"Is",
"the",
"data",
"set",
"valid?"
] | cb5314a8c0153c922f52eb469826561a7b1ad5e0 | https://github.com/detailnet/dfw-filtering/blob/cb5314a8c0153c922f52eb469826561a7b1ad5e0/src/Detail/Filtering/Zend/InputFilter/BaseFilter.php#L147-L166 |
3,740 | detailnet/dfw-filtering | src/Detail/Filtering/Zend/InputFilter/BaseFilter.php | BaseFilter.getMessages | public function getMessages()
{
if ($this->invalidDataTypeException !== null) {
return array(
'invalidType' => sprintf(
'Value must be an array or Traversable object; received %s',
is_object($this->invalidData) ? get_class($this->invalidDat... | php | public function getMessages()
{
if ($this->invalidDataTypeException !== null) {
return array(
'invalidType' => sprintf(
'Value must be an array or Traversable object; received %s',
is_object($this->invalidData) ? get_class($this->invalidDat... | [
"public",
"function",
"getMessages",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"invalidDataTypeException",
"!==",
"null",
")",
"{",
"return",
"array",
"(",
"'invalidType'",
"=>",
"sprintf",
"(",
"'Value must be an array or Traversable object; received %s'",
",",
... | Return a list of validation failure messages.
@return array | [
"Return",
"a",
"list",
"of",
"validation",
"failure",
"messages",
"."
] | cb5314a8c0153c922f52eb469826561a7b1ad5e0 | https://github.com/detailnet/dfw-filtering/blob/cb5314a8c0153c922f52eb469826561a7b1ad5e0/src/Detail/Filtering/Zend/InputFilter/BaseFilter.php#L173-L185 |
3,741 | detailnet/dfw-filtering | src/Detail/Filtering/Zend/InputFilter/BaseFilter.php | BaseFilter.getValues | public function getValues()
{
// When there's no data and the filter itself is not required,
// we don't return values
if (!$this->data && !$this->isRequired()) {
return null;
}
// Don't return any values when "inputsToFilter" is set to empty array
if (!$... | php | public function getValues()
{
// When there's no data and the filter itself is not required,
// we don't return values
if (!$this->data && !$this->isRequired()) {
return null;
}
// Don't return any values when "inputsToFilter" is set to empty array
if (!$... | [
"public",
"function",
"getValues",
"(",
")",
"{",
"// When there's no data and the filter itself is not required,",
"// we don't return values",
"if",
"(",
"!",
"$",
"this",
"->",
"data",
"&&",
"!",
"$",
"this",
"->",
"isRequired",
"(",
")",
")",
"{",
"return",
"n... | Return a list of filtered values.
@return array|null | [
"Return",
"a",
"list",
"of",
"filtered",
"values",
"."
] | cb5314a8c0153c922f52eb469826561a7b1ad5e0 | https://github.com/detailnet/dfw-filtering/blob/cb5314a8c0153c922f52eb469826561a7b1ad5e0/src/Detail/Filtering/Zend/InputFilter/BaseFilter.php#L192-L206 |
3,742 | detailnet/dfw-filtering | src/Detail/Filtering/Zend/InputFilter/BaseFilter.php | BaseFilter.needsFiltering | protected function needsFiltering(array $inputs = null)
{
$inputsToFilter = $inputs ?: $this->getInputsToFilter();
return !(is_array($inputsToFilter) && count($inputsToFilter) === 0);
} | php | protected function needsFiltering(array $inputs = null)
{
$inputsToFilter = $inputs ?: $this->getInputsToFilter();
return !(is_array($inputsToFilter) && count($inputsToFilter) === 0);
} | [
"protected",
"function",
"needsFiltering",
"(",
"array",
"$",
"inputs",
"=",
"null",
")",
"{",
"$",
"inputsToFilter",
"=",
"$",
"inputs",
"?",
":",
"$",
"this",
"->",
"getInputsToFilter",
"(",
")",
";",
"return",
"!",
"(",
"is_array",
"(",
"$",
"inputsTo... | Do we have to filter at all?
@param array $inputs
@return bool | [
"Do",
"we",
"have",
"to",
"filter",
"at",
"all?"
] | cb5314a8c0153c922f52eb469826561a7b1ad5e0 | https://github.com/detailnet/dfw-filtering/blob/cb5314a8c0153c922f52eb469826561a7b1ad5e0/src/Detail/Filtering/Zend/InputFilter/BaseFilter.php#L214-L219 |
3,743 | tekreme73/FrametekLight | src/Http/File.php | File.upload | public function upload($filename, $destination)
{
if (isset($this[$filename])) {
$file = $this[$filename];
if (is_uploaded_file($file[static::TMP_NAME])) {
try {
return move_uploaded_file($file[static::TMP_NAME], $destination);
} ca... | php | public function upload($filename, $destination)
{
if (isset($this[$filename])) {
$file = $this[$filename];
if (is_uploaded_file($file[static::TMP_NAME])) {
try {
return move_uploaded_file($file[static::TMP_NAME], $destination);
} ca... | [
"public",
"function",
"upload",
"(",
"$",
"filename",
",",
"$",
"destination",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"[",
"$",
"filename",
"]",
")",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"[",
"$",
"filename",
"]",
";",
"if",
"(",
"... | Upload a file to the destination on the server
@param array $filename
A $_FILE item name
@param string $destination
The destination file path
@return boolean true on success, exit() if not | [
"Upload",
"a",
"file",
"to",
"the",
"destination",
"on",
"the",
"server"
] | 7a40e8dd14490488d80741d6a6fe5d9c2bcc7bd5 | https://github.com/tekreme73/FrametekLight/blob/7a40e8dd14490488d80741d6a6fe5d9c2bcc7bd5/src/Http/File.php#L102-L116 |
3,744 | Fenzland/Htsl.php | libs/ReadingBuffer/Line.php | Line.pregGet | public function pregGet( string$pattern, /*int|string*/$match=0 ):string
{
preg_match($pattern,ltrim($this->content,"\t"),$matches);
return $matches[$match]??'';
} | php | public function pregGet( string$pattern, /*int|string*/$match=0 ):string
{
preg_match($pattern,ltrim($this->content,"\t"),$matches);
return $matches[$match]??'';
} | [
"public",
"function",
"pregGet",
"(",
"string",
"$",
"pattern",
",",
"/*int|string*/",
"$",
"match",
"=",
"0",
")",
":",
"string",
"{",
"preg_match",
"(",
"$",
"pattern",
",",
"ltrim",
"(",
"$",
"this",
"->",
"content",
",",
"\"\\t\"",
")",
",",
"$",
... | Matching a preg pattern and return the all or one of groups of matchment.
@access public
@param string $pattern
@param int | string $match Group index or name
@return string | [
"Matching",
"a",
"preg",
"pattern",
"and",
"return",
"the",
"all",
"or",
"one",
"of",
"groups",
"of",
"matchment",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/ReadingBuffer/Line.php#L128-L132 |
3,745 | Fenzland/Htsl.php | libs/ReadingBuffer/Line.php | Line.pregMap | public function pregMap( string$pattern, callable$callback ):array
{
preg_match_all($pattern,ltrim($this->content,"\t"),$matches);
return array_map($callback,...$matches);
} | php | public function pregMap( string$pattern, callable$callback ):array
{
preg_match_all($pattern,ltrim($this->content,"\t"),$matches);
return array_map($callback,...$matches);
} | [
"public",
"function",
"pregMap",
"(",
"string",
"$",
"pattern",
",",
"callable",
"$",
"callback",
")",
":",
"array",
"{",
"preg_match_all",
"(",
"$",
"pattern",
",",
"ltrim",
"(",
"$",
"this",
"->",
"content",
",",
"\"\\t\"",
")",
",",
"$",
"matches",
... | Multiple matching a preg pattern and map result with a callback.
@access public
@param string $pattern
@param callable $callback
@return array | [
"Multiple",
"matching",
"a",
"preg",
"pattern",
"and",
"map",
"result",
"with",
"a",
"callback",
"."
] | 28ecc4afd1a5bdb29dea3589c8132adba87f3947 | https://github.com/Fenzland/Htsl.php/blob/28ecc4afd1a5bdb29dea3589c8132adba87f3947/libs/ReadingBuffer/Line.php#L144-L148 |
3,746 | magdev/php-assimp | src/Command/Verbs/Container/ParameterContainer.php | ParameterContainer.set | public function set(array $parameters)
{
foreach ($parameters as $parameter => $value) {
$this->add($parameter, $value);
}
return $this;
} | php | public function set(array $parameters)
{
foreach ($parameters as $parameter => $value) {
$this->add($parameter, $value);
}
return $this;
} | [
"public",
"function",
"set",
"(",
"array",
"$",
"parameters",
")",
"{",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"parameter",
",",
"$",
"value",
")",
";",
"}",
"ret... | Set all parameters at once
@param array $parameters
@return \Assimp\Command\Verbs\Container\ParameterContainer | [
"Set",
"all",
"parameters",
"at",
"once"
] | 206e9c341f8be271a80fbeea7c32ec33b0f2fc90 | https://github.com/magdev/php-assimp/blob/206e9c341f8be271a80fbeea7c32ec33b0f2fc90/src/Command/Verbs/Container/ParameterContainer.php#L78-L84 |
3,747 | drupal-sauron/drupal-release-history | src/ReleaseHistoryClient.php | ReleaseHistoryClient.getReleases | public function getReleases($moduleName, $coreVersion)
{
$request = $this->httpClient->get(['{module_name}/{core_version}',
['module_name' => $moduleName, 'core_version' => $coreVersion]]);
if ($request->getStatusCode() != 200) {
throw new \Exception(sprintf('Status... | php | public function getReleases($moduleName, $coreVersion)
{
$request = $this->httpClient->get(['{module_name}/{core_version}',
['module_name' => $moduleName, 'core_version' => $coreVersion]]);
if ($request->getStatusCode() != 200) {
throw new \Exception(sprintf('Status... | [
"public",
"function",
"getReleases",
"(",
"$",
"moduleName",
",",
"$",
"coreVersion",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"httpClient",
"->",
"get",
"(",
"[",
"'{module_name}/{core_version}'",
",",
"[",
"'module_name'",
"=>",
"$",
"moduleName",
... | Fetch releases according to given module and core version
@param string $moduleName name of the module
@param string $coreVersion the core version all|8.x|7.x|6.x|5.x|4.x
@return array xml body response as a associative array | [
"Fetch",
"releases",
"according",
"to",
"given",
"module",
"and",
"core",
"version"
] | 7d5e53e60e72ebc6c505b1dda08e2fbc2360eabd | https://github.com/drupal-sauron/drupal-release-history/blob/7d5e53e60e72ebc6c505b1dda08e2fbc2360eabd/src/ReleaseHistoryClient.php#L43-L54 |
3,748 | las93/attila | Attila/Batch/Operation.php | Operation.createDb | public function createDb(array $aOptions = array())
{
/**
* option -a [indicated the sql json file]
*/
if (isset($aOptions['a'])) { $sSqlJsonFile = $aOptions['a']; }
else { $sSqlJsonFile = false; }
/**
* option -b [indicated the sql json]
*/
... | php | public function createDb(array $aOptions = array())
{
/**
* option -a [indicated the sql json file]
*/
if (isset($aOptions['a'])) { $sSqlJsonFile = $aOptions['a']; }
else { $sSqlJsonFile = false; }
/**
* option -b [indicated the sql json]
*/
... | [
"public",
"function",
"createDb",
"(",
"array",
"$",
"aOptions",
"=",
"array",
"(",
")",
")",
"{",
"/**\n * option -a [indicated the sql json file]\n */",
"if",
"(",
"isset",
"(",
"$",
"aOptions",
"[",
"'a'",
"]",
")",
")",
"{",
"$",
"sSqlJsonFil... | run the batch to create entity
@access public
@param array $aOptions options of script
@return void | [
"run",
"the",
"batch",
"to",
"create",
"entity"
] | ad73611956ee96a95170a6340f110a948cfe5965 | https://github.com/las93/attila/blob/ad73611956ee96a95170a6340f110a948cfe5965/Attila/Batch/Operation.php#L51-L107 |
3,749 | theluckyteam/php-jira | src/jira/Repository/IssueRepository.php | IssueRepository.one | public function one($query)
{
$authSession = $this->repositoryDispatcher->getCookieAuthSession();
$url = null;
$options = [
RequestOptions::HEADERS => [
'Cookie' => $authSession->getName() . '=' . $authSession->getValue(),
],
];
// Pr... | php | public function one($query)
{
$authSession = $this->repositoryDispatcher->getCookieAuthSession();
$url = null;
$options = [
RequestOptions::HEADERS => [
'Cookie' => $authSession->getName() . '=' . $authSession->getValue(),
],
];
// Pr... | [
"public",
"function",
"one",
"(",
"$",
"query",
")",
"{",
"$",
"authSession",
"=",
"$",
"this",
"->",
"repositoryDispatcher",
"->",
"getCookieAuthSession",
"(",
")",
";",
"$",
"url",
"=",
"null",
";",
"$",
"options",
"=",
"[",
"RequestOptions",
"::",
"HE... | Returns issue of Jira
@param mixed $query
@return array An array of issue
@throws \Exception
@see https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-issueIdOrKey-get | [
"Returns",
"issue",
"of",
"Jira"
] | 5a50ab4fc57dd77239f1b7e9c87738318c258c38 | https://github.com/theluckyteam/php-jira/blob/5a50ab4fc57dd77239f1b7e9c87738318c258c38/src/jira/Repository/IssueRepository.php#L54-L109 |
3,750 | theluckyteam/php-jira | src/jira/Repository/IssueRepository.php | IssueRepository.all | public function all($query)
{
$authSession = $this->repositoryDispatcher->getCookieAuthSession();
$response = $this->client->request('POST', $this->endpoint . '/rest/api/2/search', [
RequestOptions::HEADERS => [
'Cookie' => $authSession->getName() . '=' . $authSession->g... | php | public function all($query)
{
$authSession = $this->repositoryDispatcher->getCookieAuthSession();
$response = $this->client->request('POST', $this->endpoint . '/rest/api/2/search', [
RequestOptions::HEADERS => [
'Cookie' => $authSession->getName() . '=' . $authSession->g... | [
"public",
"function",
"all",
"(",
"$",
"query",
")",
"{",
"$",
"authSession",
"=",
"$",
"this",
"->",
"repositoryDispatcher",
"->",
"getCookieAuthSession",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"request",
"(",
"'POST'",
... | Returns issues of Jira
@param array $query
@return array An array of issues | [
"Returns",
"issues",
"of",
"Jira"
] | 5a50ab4fc57dd77239f1b7e9c87738318c258c38 | https://github.com/theluckyteam/php-jira/blob/5a50ab4fc57dd77239f1b7e9c87738318c258c38/src/jira/Repository/IssueRepository.php#L118-L143 |
3,751 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.setPropertyValue | public function setPropertyValue($property, $value = NULL, $objectId = NULL)
{
$property = strtolower($property);
//1. Check that the property exists in $dataModel;
if (!array_key_exists($property, $this->propertyModel))
return false; //@TODO Raise error? specified column not fo... | php | public function setPropertyValue($property, $value = NULL, $objectId = NULL)
{
$property = strtolower($property);
//1. Check that the property exists in $dataModel;
if (!array_key_exists($property, $this->propertyModel))
return false; //@TODO Raise error? specified column not fo... | [
"public",
"function",
"setPropertyValue",
"(",
"$",
"property",
",",
"$",
"value",
"=",
"NULL",
",",
"$",
"objectId",
"=",
"NULL",
")",
"{",
"$",
"property",
"=",
"strtolower",
"(",
"$",
"property",
")",
";",
"//1. Check that the property exists in $dataModel;",... | Sets the property Value before save
@param string $property Proprety ID or Property Name
@param type $value | [
"Sets",
"the",
"property",
"Value",
"before",
"save"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L83-L104 |
3,752 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getPropertyValue | public function getPropertyValue($propertyName, $objectId = null)
{
//You can return this protected properties as objects too.
if (in_array($propertyName, array("objectId", "objectType", "objectURI")) && isset($this->$propertyName)) {
return $this->$propertyName;
}
$pro... | php | public function getPropertyValue($propertyName, $objectId = null)
{
//You can return this protected properties as objects too.
if (in_array($propertyName, array("objectId", "objectType", "objectURI")) && isset($this->$propertyName)) {
return $this->$propertyName;
}
$pro... | [
"public",
"function",
"getPropertyValue",
"(",
"$",
"propertyName",
",",
"$",
"objectId",
"=",
"null",
")",
"{",
"//You can return this protected properties as objects too.",
"if",
"(",
"in_array",
"(",
"$",
"propertyName",
",",
"array",
"(",
"\"objectId\"",
",",
"\... | Returns an entity property value by propery name if exists
@todo Allow for default value setting;
@param string $propertyName
@param interger $objectIdId
@return mixed | [
"Returns",
"an",
"entity",
"property",
"value",
"by",
"propery",
"name",
"if",
"exists"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L217-L243 |
3,753 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectsByPropertyValueBetween | public function getObjectsByPropertyValueBetween($property, $valueA, $valueB, array $select, $objectType = NULL, $objectURI = NULL, $objectId = NULL)
{
if (empty($property) || empty($valueA) || empty($valueB) || empty($select))
return false; //We must have eactly one property value pair defined... | php | public function getObjectsByPropertyValueBetween($property, $valueA, $valueB, array $select, $objectType = NULL, $objectURI = NULL, $objectId = NULL)
{
if (empty($property) || empty($valueA) || empty($valueB) || empty($select))
return false; //We must have eactly one property value pair defined... | [
"public",
"function",
"getObjectsByPropertyValueBetween",
"(",
"$",
"property",
",",
"$",
"valueA",
",",
"$",
"valueB",
",",
"array",
"$",
"select",
",",
"$",
"objectType",
"=",
"NULL",
",",
"$",
"objectURI",
"=",
"NULL",
",",
"$",
"objectId",
"=",
"NULL",... | Return Object lists with matched properties between two values
@param type $property
@param type $valueA
@param type $valueB
@param type $select
@param type $objectType
@param type $objectURI
@param type $objectId | [
"Return",
"Object",
"lists",
"with",
"matched",
"properties",
"between",
"two",
"values"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L256-L271 |
3,754 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectsByPropertyValueMatch | public function getObjectsByPropertyValueMatch(array $properties, array $values, array $select = array(), $objectType = NULL, $objectURI = NULL, $objectId = NULL)
{
if (empty($properties) || empty($values))
return false; //We must have eactly one property value pair defined
$select = a... | php | public function getObjectsByPropertyValueMatch(array $properties, array $values, array $select = array(), $objectType = NULL, $objectURI = NULL, $objectId = NULL)
{
if (empty($properties) || empty($values))
return false; //We must have eactly one property value pair defined
$select = a... | [
"public",
"function",
"getObjectsByPropertyValueMatch",
"(",
"array",
"$",
"properties",
",",
"array",
"$",
"values",
",",
"array",
"$",
"select",
"=",
"array",
"(",
")",
",",
"$",
"objectType",
"=",
"NULL",
",",
"$",
"objectURI",
"=",
"NULL",
",",
"$",
... | Return Object lists with properties matching the given value
@param type $properties list of properties to match to values, must have exactly a value pair in the values array and must be included in the select array
@param type $values
@param type $select
@param type $objectType
@param type $objectURI
@param type $obj... | [
"Return",
"Object",
"lists",
"with",
"properties",
"matching",
"the",
"given",
"value"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L322-L346 |
3,755 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.setListOrderBy | final public function setListOrderBy($fields, $direction = "ASC")
{
$direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' ' . $direction : ' ASC';
$orderby = NULL;
//Clean up the order by field list
if (!empty($fields) && !is_array($fields)) {
... | php | final public function setListOrderBy($fields, $direction = "ASC")
{
$direction = (in_array(strtoupper(trim($direction)), array('ASC', 'DESC'), TRUE)) ? ' ' . $direction : ' ASC';
$orderby = NULL;
//Clean up the order by field list
if (!empty($fields) && !is_array($fields)) {
... | [
"final",
"public",
"function",
"setListOrderBy",
"(",
"$",
"fields",
",",
"$",
"direction",
"=",
"\"ASC\"",
")",
"{",
"$",
"direction",
"=",
"(",
"in_array",
"(",
"strtoupper",
"(",
"trim",
"(",
"$",
"direction",
")",
")",
",",
"array",
"(",
"'ASC'",
"... | Sets the list order direction
@param type $fields comma seperated list, or array
@param type $direction
@return \Platform\Entity | [
"Sets",
"the",
"list",
"order",
"direction"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L355-L384 |
3,756 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.setListLookUpConditions | final public function setListLookUpConditions($key, $value = NULL, $type = 'AND', $exact = FALSE, $escape = TRUE, $comparison = "LIKE")
{
if (empty($key)) {
return $this;
}
if (!is_array($key)) {
if (is_null($value)) { //some values could be '' so don't use empty her... | php | final public function setListLookUpConditions($key, $value = NULL, $type = 'AND', $exact = FALSE, $escape = TRUE, $comparison = "LIKE")
{
if (empty($key)) {
return $this;
}
if (!is_array($key)) {
if (is_null($value)) { //some values could be '' so don't use empty her... | [
"final",
"public",
"function",
"setListLookUpConditions",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"NULL",
",",
"$",
"type",
"=",
"'AND'",
",",
"$",
"exact",
"=",
"FALSE",
",",
"$",
"escape",
"=",
"TRUE",
",",
"$",
"comparison",
"=",
"\"LIKE\"",
")",
... | Sets lookup conditions for entity table search
@param type $key
@param type $value
@param type $type
@param type $exact
@param type $escape
@return \Platform\Entity | [
"Sets",
"lookup",
"conditions",
"for",
"entity",
"table",
"search"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L406-L455 |
3,757 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getListLookUpConditionsClause | public function getListLookUpConditionsClause()
{
$query = null;
if (is_array($this->listLookUpConditions) && !empty($this->listLookUpConditions)):
$query .= "\nHAVING\t";
$query .= implode("\t", $this->listLookUpConditions);
endif;
//Reset the listLookUp afte... | php | public function getListLookUpConditionsClause()
{
$query = null;
if (is_array($this->listLookUpConditions) && !empty($this->listLookUpConditions)):
$query .= "\nHAVING\t";
$query .= implode("\t", $this->listLookUpConditions);
endif;
//Reset the listLookUp afte... | [
"public",
"function",
"getListLookUpConditionsClause",
"(",
")",
"{",
"$",
"query",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"listLookUpConditions",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"listLookUpConditions",
")",
")",
... | Returns the list select clause additional conditions
@return string or null if no conditions | [
"Returns",
"the",
"list",
"select",
"clause",
"additional",
"conditions"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L462-L472 |
3,758 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectsList | final public function getObjectsList($objectType, $properties = array(), $objectURI = NULL, $objectId = NULL)
{
if (empty($properties)):
if (!empty($this->propertyModel))
$properties = array_keys($this->propertyModel);
endif;
$query = static::getObjectQuery($pro... | php | final public function getObjectsList($objectType, $properties = array(), $objectURI = NULL, $objectId = NULL)
{
if (empty($properties)):
if (!empty($this->propertyModel))
$properties = array_keys($this->propertyModel);
endif;
$query = static::getObjectQuery($pro... | [
"final",
"public",
"function",
"getObjectsList",
"(",
"$",
"objectType",
",",
"$",
"properties",
"=",
"array",
"(",
")",
",",
"$",
"objectURI",
"=",
"NULL",
",",
"$",
"objectId",
"=",
"NULL",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"properties",
")",
... | Returns objects lists table with attributes list and values
@param type $objectType
@param type $attributes
@return type $statement | [
"Returns",
"objects",
"lists",
"table",
"with",
"attributes",
"list",
"and",
"values"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L490-L514 |
3,759 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectsListCount | final public function getObjectsListCount($objectType, $properties = array(), $objectURI = NULL, $objectId = NULL)
{
if (empty($properties)):
if (!empty($this->propertyModel))
$properties = array_keys($this->propertyModel);
endif;
$query = $this->getObjectCountQue... | php | final public function getObjectsListCount($objectType, $properties = array(), $objectURI = NULL, $objectId = NULL)
{
if (empty($properties)):
if (!empty($this->propertyModel))
$properties = array_keys($this->propertyModel);
endif;
$query = $this->getObjectCountQue... | [
"final",
"public",
"function",
"getObjectsListCount",
"(",
"$",
"objectType",
",",
"$",
"properties",
"=",
"array",
"(",
")",
",",
"$",
"objectURI",
"=",
"NULL",
",",
"$",
"objectId",
"=",
"NULL",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"properties",
"... | Gets the object List Count
@param type $objectType
@param type $properties
@param type $objectURI
@param type $objectId
@return type | [
"Gets",
"the",
"object",
"List",
"Count"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L525-L543 |
3,760 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectQuery | final private static function getObjectQuery($properties, $vtable = '?property_values', $objectId = NULL, $objectType = NULL, $objectURI = NULL)
{
//Join Query
$query = "SELECT o.object_id, o.object_uri, o.object_type, o.object_created_on, o.object_updated_on, o.object_status";
if (!empty($... | php | final private static function getObjectQuery($properties, $vtable = '?property_values', $objectId = NULL, $objectType = NULL, $objectURI = NULL)
{
//Join Query
$query = "SELECT o.object_id, o.object_uri, o.object_type, o.object_created_on, o.object_updated_on, o.object_status";
if (!empty($... | [
"final",
"private",
"static",
"function",
"getObjectQuery",
"(",
"$",
"properties",
",",
"$",
"vtable",
"=",
"'?property_values'",
",",
"$",
"objectId",
"=",
"NULL",
",",
"$",
"objectType",
"=",
"NULL",
",",
"$",
"objectURI",
"=",
"NULL",
")",
"{",
"//Join... | Builds the original portion of the Object Query without conditions
@param type $properties
@param type $vtable
@param type $objectId
@param type $objectType
@param type $objectURI
@return string | [
"Builds",
"the",
"original",
"portion",
"of",
"the",
"Object",
"Query",
"without",
"conditions"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L664-L712 |
3,761 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.getObjectCountQuery | final private function getObjectCountQuery($properties, $vtable = '?property_values', $objectId = NULL, $objectType = NULL, $objectURI = NULL)
{
//Join Query
$query = "SELECT DISTINCT o.object_id as total_objects";
$hasProperties = FALSE;
if (!empty($properties)):
//Loop... | php | final private function getObjectCountQuery($properties, $vtable = '?property_values', $objectId = NULL, $objectType = NULL, $objectURI = NULL)
{
//Join Query
$query = "SELECT DISTINCT o.object_id as total_objects";
$hasProperties = FALSE;
if (!empty($properties)):
//Loop... | [
"final",
"private",
"function",
"getObjectCountQuery",
"(",
"$",
"properties",
",",
"$",
"vtable",
"=",
"'?property_values'",
",",
"$",
"objectId",
"=",
"NULL",
",",
"$",
"objectType",
"=",
"NULL",
",",
"$",
"objectURI",
"=",
"NULL",
")",
"{",
"//Join Query"... | Get the final count
@param type $properties
@param type $vtable
@param type $objectId
@param type $objectType
@param type $objectURI
@return type | [
"Get",
"the",
"final",
"count"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L724-L777 |
3,762 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.extendPropertyModel | final public function extendPropertyModel($dataModel = array(), $objectType = "object")
{
$this->propertyModel = array_merge($this->propertyModel, $dataModel);
$this->setObjectType($objectType);
return $this;
} | php | final public function extendPropertyModel($dataModel = array(), $objectType = "object")
{
$this->propertyModel = array_merge($this->propertyModel, $dataModel);
$this->setObjectType($objectType);
return $this;
} | [
"final",
"public",
"function",
"extendPropertyModel",
"(",
"$",
"dataModel",
"=",
"array",
"(",
")",
",",
"$",
"objectType",
"=",
"\"object\"",
")",
"{",
"$",
"this",
"->",
"propertyModel",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"propertyModel",
",",
... | Extends the parent data model
Allows the current object to use parent object properties
@param type $dataModel array(property_name=>array("label"=>"","datatype"=>"","charsize"=>"" , "default"=>"", "index"=>FALSE, "allowempty"=>FALSE)) | [
"Extends",
"the",
"parent",
"data",
"model",
"Allows",
"the",
"current",
"object",
"to",
"use",
"parent",
"object",
"properties"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L951-L958 |
3,763 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.definePropertyModel | final public function definePropertyModel($dataModel = array(), $objectType = "object")
{
$this->propertyModel = $dataModel;
$this->setObjectType($objectType);
return $this;
} | php | final public function definePropertyModel($dataModel = array(), $objectType = "object")
{
$this->propertyModel = $dataModel;
$this->setObjectType($objectType);
return $this;
} | [
"final",
"public",
"function",
"definePropertyModel",
"(",
"$",
"dataModel",
"=",
"array",
"(",
")",
",",
"$",
"objectType",
"=",
"\"object\"",
")",
"{",
"$",
"this",
"->",
"propertyModel",
"=",
"$",
"dataModel",
";",
"$",
"this",
"->",
"setObjectType",
"(... | Creates a completely new data model.
Any Properties not explicitly described for this object will be ignored
@param type $dataModel | [
"Creates",
"a",
"completely",
"new",
"data",
"model",
".",
"Any",
"Properties",
"not",
"explicitly",
"described",
"for",
"this",
"object",
"will",
"be",
"ignored"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L966-L973 |
3,764 | budkit/budkit-framework | src/Budkit/Datastore/Model/Entity.php | Entity.defineValueGroup | final public function defineValueGroup($valueGroup = NULL)
{
$this->valueGroup = !empty($valueGroup) ? trim($valueGroup) . "_" : NULL;
//you must have this proxy table created at setup
//also object type must be the same as valuegroup
if (!empty($valueGroup)) {
return $th... | php | final public function defineValueGroup($valueGroup = NULL)
{
$this->valueGroup = !empty($valueGroup) ? trim($valueGroup) . "_" : NULL;
//you must have this proxy table created at setup
//also object type must be the same as valuegroup
if (!empty($valueGroup)) {
return $th... | [
"final",
"public",
"function",
"defineValueGroup",
"(",
"$",
"valueGroup",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"valueGroup",
"=",
"!",
"empty",
"(",
"$",
"valueGroup",
")",
"?",
"trim",
"(",
"$",
"valueGroup",
")",
".",
"\"_\"",
":",
"NULL",
";",... | Defines a sub table for value data;
@param type $valueGroup | [
"Defines",
"a",
"sub",
"table",
"for",
"value",
"data",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Model/Entity.php#L980-L988 |
3,765 | restrose/water | src/Helper.php | Helper.IP2City | public function IP2City($ip)
{
$baidu_IP_url = 'http://api.map.baidu.com/location/ip?ak=bsa3LH1GT1jhOep5N7Uz950xtTQWvp9I&ip='.$ip.'&coor=bd09ll';
$client = new Client();
$json = $client->get($baidu_IP_url)->getBody();
return json_decode($json, true);
} | php | public function IP2City($ip)
{
$baidu_IP_url = 'http://api.map.baidu.com/location/ip?ak=bsa3LH1GT1jhOep5N7Uz950xtTQWvp9I&ip='.$ip.'&coor=bd09ll';
$client = new Client();
$json = $client->get($baidu_IP_url)->getBody();
return json_decode($json, true);
} | [
"public",
"function",
"IP2City",
"(",
"$",
"ip",
")",
"{",
"$",
"baidu_IP_url",
"=",
"'http://api.map.baidu.com/location/ip?ak=bsa3LH1GT1jhOep5N7Uz950xtTQWvp9I&ip='",
".",
"$",
"ip",
".",
"'&coor=bd09ll'",
";",
"$",
"client",
"=",
"new",
"Client",
"(",
")",
";",
"... | IP to City
@return array | [
"IP",
"to",
"City"
] | b1ca5e0b77ed73a98b532a5589d6c14012b2bef1 | https://github.com/restrose/water/blob/b1ca5e0b77ed73a98b532a5589d6c14012b2bef1/src/Helper.php#L23-L30 |
3,766 | restrose/water | src/Helper.php | Helper.oneToMany | public function oneToMany($id,$name,$img,$gender)
{
$ids = explode(',', $id);
$names = explode(',', $name);
$imgs = explode(',', $img);
$genders = explode(',', $gender);
for ($i=0; $i <count($names) ; $i++) {
$male = "";
if($genders[$i] == 1) $male =... | php | public function oneToMany($id,$name,$img,$gender)
{
$ids = explode(',', $id);
$names = explode(',', $name);
$imgs = explode(',', $img);
$genders = explode(',', $gender);
for ($i=0; $i <count($names) ; $i++) {
$male = "";
if($genders[$i] == 1) $male =... | [
"public",
"function",
"oneToMany",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"img",
",",
"$",
"gender",
")",
"{",
"$",
"ids",
"=",
"explode",
"(",
"','",
",",
"$",
"id",
")",
";",
"$",
"names",
"=",
"explode",
"(",
"','",
",",
"$",
"name",
... | 1 to many | [
"1",
"to",
"many"
] | b1ca5e0b77ed73a98b532a5589d6c14012b2bef1 | https://github.com/restrose/water/blob/b1ca5e0b77ed73a98b532a5589d6c14012b2bef1/src/Helper.php#L156-L168 |
3,767 | restrose/water | src/Helper.php | Helper.getConfigList | public function getConfigList($list) {
$records = Conf::where('config.list', $list)
->leftJoin('config as p', 'config.parent_id', '=', 'p.id')
->orderBy('config.parent_id')
->select('config.id', 'config.parent_id', 'config.text', 'p.text as... | php | public function getConfigList($list) {
$records = Conf::where('config.list', $list)
->leftJoin('config as p', 'config.parent_id', '=', 'p.id')
->orderBy('config.parent_id')
->select('config.id', 'config.parent_id', 'config.text', 'p.text as... | [
"public",
"function",
"getConfigList",
"(",
"$",
"list",
")",
"{",
"$",
"records",
"=",
"Conf",
"::",
"where",
"(",
"'config.list'",
",",
"$",
"list",
")",
"->",
"leftJoin",
"(",
"'config as p'",
",",
"'config.parent_id'",
",",
"'='",
",",
"'p.id'",
")",
... | get config items | [
"get",
"config",
"items"
] | b1ca5e0b77ed73a98b532a5589d6c14012b2bef1 | https://github.com/restrose/water/blob/b1ca5e0b77ed73a98b532a5589d6c14012b2bef1/src/Helper.php#L174-L197 |
3,768 | sebardo/ecommerce | EcommerceBundle/Entity/Repository/AddressRepository.php | AddressRepository.removeForBillingToAllAddresses | public function removeForBillingToAllAddresses($actorId)
{
$qb = $this->getQueryBuilder()
->update()
->set('a.forBilling', 0)
->where('a.actor = :actor')
->setParameter('actor', $actorId);
$qb->getQuery()->execute();
} | php | public function removeForBillingToAllAddresses($actorId)
{
$qb = $this->getQueryBuilder()
->update()
->set('a.forBilling', 0)
->where('a.actor = :actor')
->setParameter('actor', $actorId);
$qb->getQuery()->execute();
} | [
"public",
"function",
"removeForBillingToAllAddresses",
"(",
"$",
"actorId",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"update",
"(",
")",
"->",
"set",
"(",
"'a.forBilling'",
",",
"0",
")",
"->",
"where",
"(",
"'a.ac... | Remove the forBilling field to all addresses of the given actor
@param integer $actorId | [
"Remove",
"the",
"forBilling",
"field",
"to",
"all",
"addresses",
"of",
"the",
"given",
"actor"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/Repository/AddressRepository.php#L94-L103 |
3,769 | fintech-fab/bank-emulator-sdk | src/FintechFab/BankEmulatorSdk/Gateway.php | Gateway.complete | public function complete($params)
{
$requestParams = $this->initRequestParams('complete', $params);
$this->request('complete', $requestParams);
return empty($this->error);
} | php | public function complete($params)
{
$requestParams = $this->initRequestParams('complete', $params);
$this->request('complete', $requestParams);
return empty($this->error);
} | [
"public",
"function",
"complete",
"(",
"$",
"params",
")",
"{",
"$",
"requestParams",
"=",
"$",
"this",
"->",
"initRequestParams",
"(",
"'complete'",
",",
"$",
"params",
")",
";",
"$",
"this",
"->",
"request",
"(",
"'complete'",
",",
"$",
"requestParams",
... | Complete authorization payment
@param array $params
@return boolean | [
"Complete",
"authorization",
"payment"
] | 4649339531d653723efa34c6c6a046912fb12eae | https://github.com/fintech-fab/bank-emulator-sdk/blob/4649339531d653723efa34c6c6a046912fb12eae/src/FintechFab/BankEmulatorSdk/Gateway.php#L121-L127 |
3,770 | fintech-fab/bank-emulator-sdk | src/FintechFab/BankEmulatorSdk/Gateway.php | Gateway.refund | public function refund($params)
{
$requestParams = $this->initRequestParams('refund', $params);
$this->request('refund', $requestParams);
return empty($this->error);
} | php | public function refund($params)
{
$requestParams = $this->initRequestParams('refund', $params);
$this->request('refund', $requestParams);
return empty($this->error);
} | [
"public",
"function",
"refund",
"(",
"$",
"params",
")",
"{",
"$",
"requestParams",
"=",
"$",
"this",
"->",
"initRequestParams",
"(",
"'refund'",
",",
"$",
"params",
")",
";",
"$",
"this",
"->",
"request",
"(",
"'refund'",
",",
"$",
"requestParams",
")",... | Refund for complete or sale payments
@param array $params
@return boolean | [
"Refund",
"for",
"complete",
"or",
"sale",
"payments"
] | 4649339531d653723efa34c6c6a046912fb12eae | https://github.com/fintech-fab/bank-emulator-sdk/blob/4649339531d653723efa34c6c6a046912fb12eae/src/FintechFab/BankEmulatorSdk/Gateway.php#L136-L142 |
3,771 | fintech-fab/bank-emulator-sdk | src/FintechFab/BankEmulatorSdk/Gateway.php | Gateway.callback | public function callback(array $params = null)
{
$this->cleanup();
if(null === $params){
if(!empty($_POST)){
$params = $_POST;
}
}
if (
empty($params) ||
empty($params['term']) ||
empty($params['sign']) ||
empty($params['type'])
) {
throw new GatewayException('Input params is failu... | php | public function callback(array $params = null)
{
$this->cleanup();
if(null === $params){
if(!empty($_POST)){
$params = $_POST;
}
}
if (
empty($params) ||
empty($params['term']) ||
empty($params['sign']) ||
empty($params['type'])
) {
throw new GatewayException('Input params is failu... | [
"public",
"function",
"callback",
"(",
"array",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"cleanup",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"_POST",
")",
")",
"{",
"$"... | Parse callback request
@param array $params
@return stdClass
@throws GatewayException | [
"Parse",
"callback",
"request"
] | 4649339531d653723efa34c6c6a046912fb12eae | https://github.com/fintech-fab/bank-emulator-sdk/blob/4649339531d653723efa34c6c6a046912fb12eae/src/FintechFab/BankEmulatorSdk/Gateway.php#L169-L214 |
3,772 | fintech-fab/bank-emulator-sdk | src/FintechFab/BankEmulatorSdk/Gateway.php | Gateway.initRequestParams | private function initRequestParams($type, $params)
{
$list = self::$customParams;
if (!isset($list[$type])) {
throw new GatewayException('Undefined request type');
}
$list = $list[$type];
$requestParams = array();
foreach ($list as $key) {
if (!empty($params[$key])) {
$requestParams[$key] = tr... | php | private function initRequestParams($type, $params)
{
$list = self::$customParams;
if (!isset($list[$type])) {
throw new GatewayException('Undefined request type');
}
$list = $list[$type];
$requestParams = array();
foreach ($list as $key) {
if (!empty($params[$key])) {
$requestParams[$key] = tr... | [
"private",
"function",
"initRequestParams",
"(",
"$",
"type",
",",
"$",
"params",
")",
"{",
"$",
"list",
"=",
"self",
"::",
"$",
"customParams",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"list",
"[",
"$",
"type",
"]",
")",
")",
"{",
"throw",
"new",
... | Generate params for http query
@param string $type
@param array $params
@return array
@throws GatewayException | [
"Generate",
"params",
"for",
"http",
"query"
] | 4649339531d653723efa34c6c6a046912fb12eae | https://github.com/fintech-fab/bank-emulator-sdk/blob/4649339531d653723efa34c6c6a046912fb12eae/src/FintechFab/BankEmulatorSdk/Gateway.php#L411-L448 |
3,773 | fintech-fab/bank-emulator-sdk | src/FintechFab/BankEmulatorSdk/Gateway.php | Gateway.convert | private function convert($requestParams)
{
$convertedParams = array();
$convertList = self::$convertRequestParams;
if (isset($convertList['term'])) {
$convertList = array_flip($convertList);
}
foreach ($requestParams as $key => $value) {
if(isset($convertList[$key])){
$convertedParams[$convertLis... | php | private function convert($requestParams)
{
$convertedParams = array();
$convertList = self::$convertRequestParams;
if (isset($convertList['term'])) {
$convertList = array_flip($convertList);
}
foreach ($requestParams as $key => $value) {
if(isset($convertList[$key])){
$convertedParams[$convertLis... | [
"private",
"function",
"convert",
"(",
"$",
"requestParams",
")",
"{",
"$",
"convertedParams",
"=",
"array",
"(",
")",
";",
"$",
"convertList",
"=",
"self",
"::",
"$",
"convertRequestParams",
";",
"if",
"(",
"isset",
"(",
"$",
"convertList",
"[",
"'term'",... | Reverse gateway and human names
@param array $requestParams
@return array | [
"Reverse",
"gateway",
"and",
"human",
"names"
] | 4649339531d653723efa34c6c6a046912fb12eae | https://github.com/fintech-fab/bank-emulator-sdk/blob/4649339531d653723efa34c6c6a046912fb12eae/src/FintechFab/BankEmulatorSdk/Gateway.php#L457-L474 |
3,774 | xinc-develop/xinc-core | src/Exception/IOException.php | IOException.getErrorMessage | protected function getErrorMessage($nCode, $strMessage = null)
{
$strReturn = 'Failure: ';
if (null !== $this->strResourcePath) {
$strReturn = 'Path: "'.$this->strResourcePath.'" ';
}
$strReturn .= 'Name: "'.$this->strResourceName.'"';
$strReturn .= ' Code: ';
... | php | protected function getErrorMessage($nCode, $strMessage = null)
{
$strReturn = 'Failure: ';
if (null !== $this->strResourcePath) {
$strReturn = 'Path: "'.$this->strResourcePath.'" ';
}
$strReturn .= 'Name: "'.$this->strResourceName.'"';
$strReturn .= ' Code: ';
... | [
"protected",
"function",
"getErrorMessage",
"(",
"$",
"nCode",
",",
"$",
"strMessage",
"=",
"null",
")",
"{",
"$",
"strReturn",
"=",
"'Failure: '",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"strResourcePath",
")",
"{",
"$",
"strReturn",
"=",
"'Pa... | Builds and returns an error message for this exception.
@param int $nCode Code of failure from this consts
@param string $strMessage Exception message
@return string A message for this error | [
"Builds",
"and",
"returns",
"an",
"error",
"message",
"for",
"this",
"exception",
"."
] | 4bb69a6afe19e1186950a3122cbfe0989823e0d6 | https://github.com/xinc-develop/xinc-core/blob/4bb69a6afe19e1186950a3122cbfe0989823e0d6/src/Exception/IOException.php#L100-L130 |
3,775 | demisang/longlog-php-sdk | src/Client.php | Client.submit | public function submit(LongLog $longLog)
{
// Request example: POST http://api.longlog.ru/project/log
$curl = curl_init($this->getEndpointUrl() . '/project/log');
curl_setopt($curl, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
]);
curl_setopt($curl, CUR... | php | public function submit(LongLog $longLog)
{
// Request example: POST http://api.longlog.ru/project/log
$curl = curl_init($this->getEndpointUrl() . '/project/log');
curl_setopt($curl, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
]);
curl_setopt($curl, CUR... | [
"public",
"function",
"submit",
"(",
"LongLog",
"$",
"longLog",
")",
"{",
"// Request example: POST http://api.longlog.ru/project/log",
"$",
"curl",
"=",
"curl_init",
"(",
"$",
"this",
"->",
"getEndpointUrl",
"(",
")",
".",
"'/project/log'",
")",
";",
"curl_setopt",... | Send log to API
@param LongLog $longLog
@return bool TRUE if log successfully saved | [
"Send",
"log",
"to",
"API"
] | f6b2944acaf195954b52bf5b89b09c8096fd597f | https://github.com/demisang/longlog-php-sdk/blob/f6b2944acaf195954b52bf5b89b09c8096fd597f/src/Client.php#L55-L74 |
3,776 | demisang/longlog-php-sdk | src/Client.php | Client.setProjectToken | public function setProjectToken($token)
{
if (!$token) {
throw new InvalidArgumentException('Project token required');
} elseif (strlen($token) !== 32) {
throw new InvalidArgumentException('Project token must be 32 characters length');
}
$this->projectToken =... | php | public function setProjectToken($token)
{
if (!$token) {
throw new InvalidArgumentException('Project token required');
} elseif (strlen($token) !== 32) {
throw new InvalidArgumentException('Project token must be 32 characters length');
}
$this->projectToken =... | [
"public",
"function",
"setProjectToken",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"!",
"$",
"token",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Project token required'",
")",
";",
"}",
"elseif",
"(",
"strlen",
"(",
"$",
"token",
")",
"!=="... | Set project token
@param string $token
@return $this | [
"Set",
"project",
"token"
] | f6b2944acaf195954b52bf5b89b09c8096fd597f | https://github.com/demisang/longlog-php-sdk/blob/f6b2944acaf195954b52bf5b89b09c8096fd597f/src/Client.php#L134-L145 |
3,777 | jmpantoja/planb-utils | src/DS/Vector/Vector.php | Vector.typed | public static function typed(string $type, iterable $input = []): Vector
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | php | public static function typed(string $type, iterable $input = []): Vector
{
$resolver = Resolver::typed($type);
return new static($input, $resolver);
} | [
"public",
"static",
"function",
"typed",
"(",
"string",
"$",
"type",
",",
"iterable",
"$",
"input",
"=",
"[",
"]",
")",
":",
"Vector",
"{",
"$",
"resolver",
"=",
"Resolver",
"::",
"typed",
"(",
"$",
"type",
")",
";",
"return",
"new",
"static",
"(",
... | Vector named constructor.
@param string $type
@param mixed[] $input
@return \PlanB\DS\Vector\Vector | [
"Vector",
"named",
"constructor",
"."
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/DS/Vector/Vector.php#L50-L55 |
3,778 | mindforce/cakephp-editorial | src/View/Helper/EditorialHelper.php | EditorialHelper.loadConfig | public function loadConfig($file)
{
$options = [];
try {
$loader = new PhpConfig();
$options = $loader->read($file);
} catch (\Exception $e) {
Log::warning($e->getMessage());
}
$this->config('options', $options);
} | php | public function loadConfig($file)
{
$options = [];
try {
$loader = new PhpConfig();
$options = $loader->read($file);
} catch (\Exception $e) {
Log::warning($e->getMessage());
}
$this->config('options', $options);
} | [
"public",
"function",
"loadConfig",
"(",
"$",
"file",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"loader",
"=",
"new",
"PhpConfig",
"(",
")",
";",
"$",
"options",
"=",
"$",
"loader",
"->",
"read",
"(",
"$",
"file",
")",
";",
... | Load a config file containing editor options.
@param string $file The file to load
@return void | [
"Load",
"a",
"config",
"file",
"containing",
"editor",
"options",
"."
] | 5d05f752a353251180d0e21e736fa98d177b5c42 | https://github.com/mindforce/cakephp-editorial/blob/5d05f752a353251180d0e21e736fa98d177b5c42/src/View/Helper/EditorialHelper.php#L123-L133 |
3,779 | znframework/package-crontab | CrontabIntervalTrait.php | CrontabIntervalTrait._format | protected function _format($varname, $objectname, $data)
{
$format = $this->$varname;
$replaceData = str_ireplace(array_keys($format), array_values($format), $data);
$this->$objectname = $this->_slashes($replaceData);
} | php | protected function _format($varname, $objectname, $data)
{
$format = $this->$varname;
$replaceData = str_ireplace(array_keys($format), array_values($format), $data);
$this->$objectname = $this->_slashes($replaceData);
} | [
"protected",
"function",
"_format",
"(",
"$",
"varname",
",",
"$",
"objectname",
",",
"$",
"data",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"$",
"varname",
";",
"$",
"replaceData",
"=",
"str_ireplace",
"(",
"array_keys",
"(",
"$",
"format",
")"... | Protected Time Format | [
"Protected",
"Time",
"Format"
] | 7e75efdaa714728bfe8800a1d0fd962c42f46c25 | https://github.com/znframework/package-crontab/blob/7e75efdaa714728bfe8800a1d0fd962c42f46c25/CrontabIntervalTrait.php#L349-L355 |
3,780 | 99designs/ergo | classes/Ergo/ClassLoader.php | ClassLoader.classFile | protected function classFile($className)
{
$classFile = preg_replace('#[_\\\]#', '/', $className).'.php';
foreach ($this->_paths as $path)
{
$classPath = "$path/$classFile";
if (file_exists($classPath))
{
return $classPath;
}
}
} | php | protected function classFile($className)
{
$classFile = preg_replace('#[_\\\]#', '/', $className).'.php';
foreach ($this->_paths as $path)
{
$classPath = "$path/$classFile";
if (file_exists($classPath))
{
return $classPath;
}
}
} | [
"protected",
"function",
"classFile",
"(",
"$",
"className",
")",
"{",
"$",
"classFile",
"=",
"preg_replace",
"(",
"'#[_\\\\\\]#'",
",",
"'/'",
",",
"$",
"className",
")",
".",
"'.php'",
";",
"foreach",
"(",
"$",
"this",
"->",
"_paths",
"as",
"$",
"path"... | Returns the class file for a particular class name
@return string | [
"Returns",
"the",
"class",
"file",
"for",
"a",
"particular",
"class",
"name"
] | 8fbcfe683a14572cbf26ff59c3537c2261a7a4eb | https://github.com/99designs/ergo/blob/8fbcfe683a14572cbf26ff59c3537c2261a7a4eb/classes/Ergo/ClassLoader.php#L36-L48 |
3,781 | 99designs/ergo | classes/Ergo/ClassLoader.php | ClassLoader.loadClass | public function loadClass($className)
{
if (class_exists($className, false) || interface_exists($className, false))
{
return false;
}
if($classFile = $this->classFile($className))
{
require $classFile;
return true;
}
return false;
} | php | public function loadClass($className)
{
if (class_exists($className, false) || interface_exists($className, false))
{
return false;
}
if($classFile = $this->classFile($className))
{
require $classFile;
return true;
}
return false;
} | [
"public",
"function",
"loadClass",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"className",
",",
"false",
")",
"||",
"interface_exists",
"(",
"$",
"className",
",",
"false",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(... | SPL autoload function, loads a class file based on the class name.
@param string | [
"SPL",
"autoload",
"function",
"loads",
"a",
"class",
"file",
"based",
"on",
"the",
"class",
"name",
"."
] | 8fbcfe683a14572cbf26ff59c3537c2261a7a4eb | https://github.com/99designs/ergo/blob/8fbcfe683a14572cbf26ff59c3537c2261a7a4eb/classes/Ergo/ClassLoader.php#L55-L69 |
3,782 | 99designs/ergo | classes/Ergo/ClassLoader.php | ClassLoader.includePaths | public function includePaths($path)
{
$paths = is_array($path) ? $path : array($path);
$this->_paths = array_merge($paths,$this->_paths);
return $this;
} | php | public function includePaths($path)
{
$paths = is_array($path) ? $path : array($path);
$this->_paths = array_merge($paths,$this->_paths);
return $this;
} | [
"public",
"function",
"includePaths",
"(",
"$",
"path",
")",
"{",
"$",
"paths",
"=",
"is_array",
"(",
"$",
"path",
")",
"?",
"$",
"path",
":",
"array",
"(",
"$",
"path",
")",
";",
"$",
"this",
"->",
"_paths",
"=",
"array_merge",
"(",
"$",
"paths",
... | Prepends one or more items to the include path of the class loader and
the php include path.
@param mixed $items Path or paths as string or array | [
"Prepends",
"one",
"or",
"more",
"items",
"to",
"the",
"include",
"path",
"of",
"the",
"class",
"loader",
"and",
"the",
"php",
"include",
"path",
"."
] | 8fbcfe683a14572cbf26ff59c3537c2261a7a4eb | https://github.com/99designs/ergo/blob/8fbcfe683a14572cbf26ff59c3537c2261a7a4eb/classes/Ergo/ClassLoader.php#L76-L81 |
3,783 | 99designs/ergo | classes/Ergo/ClassLoader.php | ClassLoader.export | public function export()
{
$systemPaths = explode(PATH_SEPARATOR, get_include_path());
set_include_path(implode(PATH_SEPARATOR,
array_merge($systemPaths,$this->_paths)));
return $this;
} | php | public function export()
{
$systemPaths = explode(PATH_SEPARATOR, get_include_path());
set_include_path(implode(PATH_SEPARATOR,
array_merge($systemPaths,$this->_paths)));
return $this;
} | [
"public",
"function",
"export",
"(",
")",
"{",
"$",
"systemPaths",
"=",
"explode",
"(",
"PATH_SEPARATOR",
",",
"get_include_path",
"(",
")",
")",
";",
"set_include_path",
"(",
"implode",
"(",
"PATH_SEPARATOR",
",",
"array_merge",
"(",
"$",
"systemPaths",
",",
... | Exports the classloader path into the PHP system include path | [
"Exports",
"the",
"classloader",
"path",
"into",
"the",
"PHP",
"system",
"include",
"path"
] | 8fbcfe683a14572cbf26ff59c3537c2261a7a4eb | https://github.com/99designs/ergo/blob/8fbcfe683a14572cbf26ff59c3537c2261a7a4eb/classes/Ergo/ClassLoader.php#L86-L92 |
3,784 | phossa2/libs | src/Phossa2/Cache/CacheItem.php | CacheItem.getValue | protected function getValue()
{
// before get
if (!$this->trigger(CachePool::EVENT_GET_BEFORE)) {
$this->setHit(false);
return null;
}
// get string value from the pool
$this->strval = $this->pool->getDriver()->get($this->key);
// after get
... | php | protected function getValue()
{
// before get
if (!$this->trigger(CachePool::EVENT_GET_BEFORE)) {
$this->setHit(false);
return null;
}
// get string value from the pool
$this->strval = $this->pool->getDriver()->get($this->key);
// after get
... | [
"protected",
"function",
"getValue",
"(",
")",
"{",
"// before get",
"if",
"(",
"!",
"$",
"this",
"->",
"trigger",
"(",
"CachePool",
"::",
"EVENT_GET_BEFORE",
")",
")",
"{",
"$",
"this",
"->",
"setHit",
"(",
"false",
")",
";",
"return",
"null",
";",
"}... | Get value from the cache pool
@return mixed
@access protected | [
"Get",
"value",
"from",
"the",
"cache",
"pool"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Cache/CacheItem.php#L263-L281 |
3,785 | phossa2/libs | src/Phossa2/Cache/CacheItem.php | CacheItem.hasHit | protected function hasHit()/*# : bool */
{
if (!$this->trigger(CachePool::EVENT_HAS_BEFORE)) {
return $this->setHit(false);
}
$meta = $this->pool->getDriver()->has($this->key);
if (isset($meta['expire'])) {
$this->expire = $meta['expire'];
} else {
... | php | protected function hasHit()/*# : bool */
{
if (!$this->trigger(CachePool::EVENT_HAS_BEFORE)) {
return $this->setHit(false);
}
$meta = $this->pool->getDriver()->has($this->key);
if (isset($meta['expire'])) {
$this->expire = $meta['expire'];
} else {
... | [
"protected",
"function",
"hasHit",
"(",
")",
"/*# : bool */",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"trigger",
"(",
"CachePool",
"::",
"EVENT_HAS_BEFORE",
")",
")",
"{",
"return",
"$",
"this",
"->",
"setHit",
"(",
"false",
")",
";",
"}",
"$",
"meta",... | Get hit status from driver
@return bool
@access protected | [
"Get",
"hit",
"status",
"from",
"driver"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Cache/CacheItem.php#L304-L322 |
3,786 | phossa2/libs | src/Phossa2/Logger/Processor/InterpolateProcessor.php | InterpolateProcessor.getPlaceHolders | protected function getPlaceHolders(/*# string */ $message)/*# : array */
{
// not found
if (false === strpos($message, '{')) {
return [];
}
$matches = [];
$pattern = '~\{([^\}]+)\}~';
if (preg_match_all($pattern, $message, $matches)) {
return ... | php | protected function getPlaceHolders(/*# string */ $message)/*# : array */
{
// not found
if (false === strpos($message, '{')) {
return [];
}
$matches = [];
$pattern = '~\{([^\}]+)\}~';
if (preg_match_all($pattern, $message, $matches)) {
return ... | [
"protected",
"function",
"getPlaceHolders",
"(",
"/*# string */",
"$",
"message",
")",
"/*# : array */",
"{",
"// not found",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"message",
",",
"'{'",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"matches",... | Get placeholders in array
@param string $message
@return array
@access protected | [
"Get",
"placeholders",
"in",
"array"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Logger/Processor/InterpolateProcessor.php#L60-L73 |
3,787 | phossa2/libs | src/Phossa2/Logger/Processor/InterpolateProcessor.php | InterpolateProcessor.replaceWith | protected function replaceWith(
/*# string */ $name,
/*# string */ $placeholder,
array &$context
)/*# : string */ {
// exact match
if (isset($context[$name])) {
return $this->getString($context[$name]);
}
// something like user.name
$first... | php | protected function replaceWith(
/*# string */ $name,
/*# string */ $placeholder,
array &$context
)/*# : string */ {
// exact match
if (isset($context[$name])) {
return $this->getString($context[$name]);
}
// something like user.name
$first... | [
"protected",
"function",
"replaceWith",
"(",
"/*# string */",
"$",
"name",
",",
"/*# string */",
"$",
"placeholder",
",",
"array",
"&",
"$",
"context",
")",
"/*# : string */",
"{",
"// exact match",
"if",
"(",
"isset",
"(",
"$",
"context",
"[",
"$",
"name",
... | Replace with values from the context array
@param string $name
@param string $placeholder
@param array &$context
@return string
@access protected | [
"Replace",
"with",
"values",
"from",
"the",
"context",
"array"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Logger/Processor/InterpolateProcessor.php#L84-L102 |
3,788 | phossa2/libs | src/Phossa2/Logger/Processor/InterpolateProcessor.php | InterpolateProcessor.getObjectString | protected function getObjectString($object)/*# : string */
{
// exception found
if ($object instanceof \Exception) {
return 'EXCEPTION: ' . $object->getMessage();
// toString() found
} elseif (method_exists($object, '__toString')) {
return (string) $object;
... | php | protected function getObjectString($object)/*# : string */
{
// exception found
if ($object instanceof \Exception) {
return 'EXCEPTION: ' . $object->getMessage();
// toString() found
} elseif (method_exists($object, '__toString')) {
return (string) $object;
... | [
"protected",
"function",
"getObjectString",
"(",
"$",
"object",
")",
"/*# : string */",
"{",
"// exception found",
"if",
"(",
"$",
"object",
"instanceof",
"\\",
"Exception",
")",
"{",
"return",
"'EXCEPTION: '",
".",
"$",
"object",
"->",
"getMessage",
"(",
")",
... | Get string representation of an object
@param object $object
@return string
@access protected | [
"Get",
"string",
"representation",
"of",
"an",
"object"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Logger/Processor/InterpolateProcessor.php#L131-L145 |
3,789 | phossa2/libs | src/Phossa2/Logger/Processor/InterpolateProcessor.php | InterpolateProcessor.getSubPart | protected function getSubPart(
/*# string */ $name,
/*# string */ $placeholder,
$data
)/*# : string */ {
list(, $second) = explode('.', $name, 2);
$arr = (array) $data;
if (isset($arr[$second])) {
return $arr[$second];
}
return $placehold... | php | protected function getSubPart(
/*# string */ $name,
/*# string */ $placeholder,
$data
)/*# : string */ {
list(, $second) = explode('.', $name, 2);
$arr = (array) $data;
if (isset($arr[$second])) {
return $arr[$second];
}
return $placehold... | [
"protected",
"function",
"getSubPart",
"(",
"/*# string */",
"$",
"name",
",",
"/*# string */",
"$",
"placeholder",
",",
"$",
"data",
")",
"/*# : string */",
"{",
"list",
"(",
",",
"$",
"second",
")",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
",",
"2... | Get 'user.name' type of result, only support 2 level
@param string $name
@param string $placeholder used only if nothing matched
@param mixed $data
@return string
@access protected | [
"Get",
"user",
".",
"name",
"type",
"of",
"result",
"only",
"support",
"2",
"level"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Logger/Processor/InterpolateProcessor.php#L156-L169 |
3,790 | tonjoo/tiga-framework | src/Html/FormBuilder.php | FormBuilder.getValueAttribute | public function getValueAttribute($name, $value = null)
{
if (strpos($name, '[]') !== false) {
$name = str_replace('[]', '', $name);
}
if ($this->hasOldInput()) {
return $this->getOldInput($name);
}
if ($this->hasModelValue($name)) {
retu... | php | public function getValueAttribute($name, $value = null)
{
if (strpos($name, '[]') !== false) {
$name = str_replace('[]', '', $name);
}
if ($this->hasOldInput()) {
return $this->getOldInput($name);
}
if ($this->hasModelValue($name)) {
retu... | [
"public",
"function",
"getValueAttribute",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'[]'",
")",
"!==",
"false",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'[]'",
",",
"''",
",",
... | Get value from an attribute.
@param string $name
@param mixed $value
@return mixed | [
"Get",
"value",
"from",
"an",
"attribute",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Html/FormBuilder.php#L153-L168 |
3,791 | tonjoo/tiga-framework | src/Html/FormBuilder.php | FormBuilder.wpEditor | public function wpEditor($name, $value = null, $options = array())
{
ob_start();
$value = $this->getValueAttribute($name, $value);
$value = $this->html->decode($value);
wp_editor($value, $name, $options = array());
$wpEditor = ob_get_contents();
ob_end_clean();
... | php | public function wpEditor($name, $value = null, $options = array())
{
ob_start();
$value = $this->getValueAttribute($name, $value);
$value = $this->html->decode($value);
wp_editor($value, $name, $options = array());
$wpEditor = ob_get_contents();
ob_end_clean();
... | [
"public",
"function",
"wpEditor",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"getValueAttribute",
"(",
"$",
"name",
",",
... | Create a WordPress Editor.
@param string $name
@param string $value
@param array $options
@return string | [
"Create",
"a",
"WordPress",
"Editor",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Html/FormBuilder.php#L527-L542 |
3,792 | tonjoo/tiga-framework | src/Html/FormBuilder.php | FormBuilder.radio | public function radio($name, $value = null, $checked = null, $options = array())
{
if (is_null($value)) {
$value = $name;
}
return $this->checkable('radio', $name, $value, $checked, $options);
} | php | public function radio($name, $value = null, $checked = null, $options = array())
{
if (is_null($value)) {
$value = $name;
}
return $this->checkable('radio', $name, $value, $checked, $options);
} | [
"public",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"checked",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",... | Create a radio button input field.
@param string $name
@param mixed $value
@param bool $checked
@param array $options
@return string | [
"Create",
"a",
"radio",
"button",
"input",
"field",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Html/FormBuilder.php#L776-L783 |
3,793 | tonjoo/tiga-framework | src/Html/FormBuilder.php | FormBuilder.checkable | protected function checkable($type, $name, $value, $checked, $options)
{
$checked = $this->getCheckedState($type, $name, $value, $checked);
if ($checked) {
$options['checked'] = 'checked';
}
return $this->input($type, $name, $value, $options);
} | php | protected function checkable($type, $name, $value, $checked, $options)
{
$checked = $this->getCheckedState($type, $name, $value, $checked);
if ($checked) {
$options['checked'] = 'checked';
}
return $this->input($type, $name, $value, $options);
} | [
"protected",
"function",
"checkable",
"(",
"$",
"type",
",",
"$",
"name",
",",
"$",
"value",
",",
"$",
"checked",
",",
"$",
"options",
")",
"{",
"$",
"checked",
"=",
"$",
"this",
"->",
"getCheckedState",
"(",
"$",
"type",
",",
"$",
"name",
",",
"$"... | Create a checkable input field.
@param string $type
@param string $name
@param mixed $value
@param bool $checked
@param array $options
@return string | [
"Create",
"a",
"checkable",
"input",
"field",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Html/FormBuilder.php#L796-L805 |
3,794 | tonjoo/tiga-framework | src/Ajax.php | Ajax.hook | public function hook()
{
wp_enqueue_script('jquery');
add_action('wp_head', array($this, 'printToken'));
add_action('admin_head', array($this, 'printToken'));
add_action('wp_footer', array($this, 'printAjaxHeader'));
add_action('admin_footer', array($this, 'printAjaxHeader'... | php | public function hook()
{
wp_enqueue_script('jquery');
add_action('wp_head', array($this, 'printToken'));
add_action('admin_head', array($this, 'printToken'));
add_action('wp_footer', array($this, 'printAjaxHeader'));
add_action('admin_footer', array($this, 'printAjaxHeader'... | [
"public",
"function",
"hook",
"(",
")",
"{",
"wp_enqueue_script",
"(",
"'jquery'",
")",
";",
"add_action",
"(",
"'wp_head'",
",",
"array",
"(",
"$",
"this",
",",
"'printToken'",
")",
")",
";",
"add_action",
"(",
"'admin_head'",
",",
"array",
"(",
"$",
"t... | Hook required script to WordPress. | [
"Hook",
"required",
"script",
"to",
"WordPress",
"."
] | 3c2eebd3bc616106fa1bba3e43f1791aff75eec5 | https://github.com/tonjoo/tiga-framework/blob/3c2eebd3bc616106fa1bba3e43f1791aff75eec5/src/Ajax.php#L12-L21 |
3,795 | synapsestudios/synapse-base | src/Synapse/User/ResetPasswordController.php | ResetPasswordController.post | public function post(Request $request)
{
// Validate user
$email = Arr::get($this->getContentAsArray($request), 'email');
$user = $this->userService->findByEmail($email);
if (! $user) {
return $this->createNotFoundResponse();
}
// If a token exists that... | php | public function post(Request $request)
{
// Validate user
$email = Arr::get($this->getContentAsArray($request), 'email');
$user = $this->userService->findByEmail($email);
if (! $user) {
return $this->createNotFoundResponse();
}
// If a token exists that... | [
"public",
"function",
"post",
"(",
"Request",
"$",
"request",
")",
"{",
"// Validate user",
"$",
"email",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"getContentAsArray",
"(",
"$",
"request",
")",
",",
"'email'",
")",
";",
"$",
"user",
"=",
"$",
... | Send reset password email
@param Request $request
@return array | [
"Send",
"reset",
"password",
"email"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/User/ResetPasswordController.php#L54-L91 |
3,796 | synapsestudios/synapse-base | src/Synapse/User/ResetPasswordController.php | ResetPasswordController.put | public function put(Request $request)
{
$token = Arr::get($this->getContentAsArray($request), 'token');
// Ensure token is valid
$token = $this->userService->findTokenBy([
'token' => $token,
'token_type_id' => TokenEntity::TYPE_RESET_PASSWORD,
]);
... | php | public function put(Request $request)
{
$token = Arr::get($this->getContentAsArray($request), 'token');
// Ensure token is valid
$token = $this->userService->findTokenBy([
'token' => $token,
'token_type_id' => TokenEntity::TYPE_RESET_PASSWORD,
]);
... | [
"public",
"function",
"put",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"token",
"=",
"Arr",
"::",
"get",
"(",
"$",
"this",
"->",
"getContentAsArray",
"(",
"$",
"request",
")",
",",
"'token'",
")",
";",
"// Ensure token is valid",
"$",
"token",
"=",
... | Reset password using token and new password
@param Request $request
@return array | [
"Reset",
"password",
"using",
"token",
"and",
"new",
"password"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/User/ResetPasswordController.php#L99-L135 |
3,797 | gossi/trixionary | src/model/Base/Picture.php | Picture.initFeaturedSkills | public function initFeaturedSkills($overrideExisting = true)
{
if (null !== $this->collFeaturedSkills && !$overrideExisting) {
return;
}
$this->collFeaturedSkills = new ObjectCollection();
$this->collFeaturedSkills->setModel('\gossi\trixionary\model\Skill');
} | php | public function initFeaturedSkills($overrideExisting = true)
{
if (null !== $this->collFeaturedSkills && !$overrideExisting) {
return;
}
$this->collFeaturedSkills = new ObjectCollection();
$this->collFeaturedSkills->setModel('\gossi\trixionary\model\Skill');
} | [
"public",
"function",
"initFeaturedSkills",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collFeaturedSkills",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"collFe... | Initializes the collFeaturedSkills collection.
By default this just sets the collFeaturedSkills collection to an empty array (like clearcollFeaturedSkills());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to... | [
"Initializes",
"the",
"collFeaturedSkills",
"collection",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Picture.php#L1706-L1713 |
3,798 | gossi/trixionary | src/model/Base/Picture.php | Picture.getFeaturedSkillsJoinMultipleOf | public function getFeaturedSkillsJoinMultipleOf(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildSkillQuery::create(null, $criteria);
$query->joinWith('MultipleOf', $joinBehavior);
return $this->getFeaturedSkills($query, $con);... | php | public function getFeaturedSkillsJoinMultipleOf(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildSkillQuery::create(null, $criteria);
$query->joinWith('MultipleOf', $joinBehavior);
return $this->getFeaturedSkills($query, $con);... | [
"public",
"function",
"getFeaturedSkillsJoinMultipleOf",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"joinBehavior",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"$",
"query",
"=",
"ChildSkillQue... | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this Picture is new, it will return
an empty collection; or if this Picture has previously
been saved, it will retrieve related FeaturedSkills from storage.
This method is protected by default in order t... | [
"If",
"this",
"collection",
"has",
"already",
"been",
"initialized",
"with",
"an",
"identical",
"criteria",
"it",
"returns",
"the",
"collection",
".",
"Otherwise",
"if",
"this",
"Picture",
"is",
"new",
"it",
"will",
"return",
"an",
"empty",
"collection",
";",
... | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Picture.php#L1957-L1963 |
3,799 | n0m4dz/laracasa | Zend/Gdata/MediaMimeStream.php | Zend_Gdata_MediaMimeStream.wrapEntry | private function wrapEntry($entry, $fileMimeType)
{
$wrappedEntry = "--{$this->_boundaryString}\r\n";
$wrappedEntry .= "Content-Type: application/atom+xml\r\n\r\n";
$wrappedEntry .= $entry;
$wrappedEntry .= "\r\n--{$this->_boundaryString}\r\n";
$wrappedEntry .= "Content-Type:... | php | private function wrapEntry($entry, $fileMimeType)
{
$wrappedEntry = "--{$this->_boundaryString}\r\n";
$wrappedEntry .= "Content-Type: application/atom+xml\r\n\r\n";
$wrappedEntry .= $entry;
$wrappedEntry .= "\r\n--{$this->_boundaryString}\r\n";
$wrappedEntry .= "Content-Type:... | [
"private",
"function",
"wrapEntry",
"(",
"$",
"entry",
",",
"$",
"fileMimeType",
")",
"{",
"$",
"wrappedEntry",
"=",
"\"--{$this->_boundaryString}\\r\\n\"",
";",
"$",
"wrappedEntry",
".=",
"\"Content-Type: application/atom+xml\\r\\n\\r\\n\"",
";",
"$",
"wrappedEntry",
"... | Sandwiches the entry body into a MIME message
@return void | [
"Sandwiches",
"the",
"entry",
"body",
"into",
"a",
"MIME",
"message"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/MediaMimeStream.php#L118-L126 |
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.