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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,300 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._getObjects | protected function _getObjects(array $labels = array())
{
$objects = array();
foreach ($labels as $label)
{
$method = 'getActivity' . ucfirst($label);
if (method_exists($this, $method))
{
$object = $this->$method();
if ($... | php | protected function _getObjects(array $labels = array())
{
$objects = array();
foreach ($labels as $label)
{
$method = 'getActivity' . ucfirst($label);
if (method_exists($this, $method))
{
$object = $this->$method();
if ($... | [
"protected",
"function",
"_getObjects",
"(",
"array",
"$",
"labels",
"=",
"array",
"(",
")",
")",
"{",
"$",
"objects",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"labels",
"as",
"$",
"label",
")",
"{",
"$",
"method",
"=",
"'getActivity'",
".",... | Returns a list of activity objects provided their labels.
@param array $labels The object labels.
@return array An array containing ComActivitiesActivityObjectInterface objects. | [
"Returns",
"a",
"list",
"of",
"activity",
"objects",
"provided",
"their",
"labels",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L496-L515 |
34,301 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._getObject | protected function _getObject($config = array())
{
$config = new KObjectConfig($config);
$config->append(array(
'attributes' => array(),
'translate' => true
));
// Process all object sub-properties.
foreach ($config as $key => $value)
{
... | php | protected function _getObject($config = array())
{
$config = new KObjectConfig($config);
$config->append(array(
'attributes' => array(),
'translate' => true
));
// Process all object sub-properties.
foreach ($config as $key => $value)
{
... | [
"protected",
"function",
"_getObject",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"config",
"=",
"new",
"KObjectConfig",
"(",
"$",
"config",
")",
";",
"$",
"config",
"->",
"append",
"(",
"array",
"(",
"'attributes'",
"=>",
"array",
"(",... | Get an activity object
@param array $config An optional configuration array. The configuration array may contain activity object data as
defined by ComActivitiesActivityObjectInterface. Additionally the following parameters may
be passed in the configuration array:
<br><br>
- find (string): the label of an object to l... | [
"Get",
"an",
"activity",
"object"
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L537-L584 |
34,302 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._getConfig | protected function _getConfig($object)
{
$config = new KObjectConfig();
$method = '_' . strtolower($object) . 'Config';
// Call config setter if any.
if (method_exists($this, $method)) {
$this->$method($config);
}
return $config;
} | php | protected function _getConfig($object)
{
$config = new KObjectConfig();
$method = '_' . strtolower($object) . 'Config';
// Call config setter if any.
if (method_exists($this, $method)) {
$this->$method($config);
}
return $config;
} | [
"protected",
"function",
"_getConfig",
"(",
"$",
"object",
")",
"{",
"$",
"config",
"=",
"new",
"KObjectConfig",
"(",
")",
";",
"$",
"method",
"=",
"'_'",
".",
"strtolower",
"(",
"$",
"object",
")",
".",
"'Config'",
";",
"// Call config setter if any.",
"i... | Get an activity object config.
@param string $object The object name.
@return KObjectConfig | [
"Get",
"an",
"activity",
"object",
"config",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L592-L604 |
34,303 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._actorConfig | protected function _actorConfig(KObjectConfig $config)
{
$objectName = $this->getAuthor()->getName();
$translate = false;
if (!$this->created_by)
{
$objectName = 'Guest user';
$translate = true;
}
elseif (!$this->_findActivityActor())
... | php | protected function _actorConfig(KObjectConfig $config)
{
$objectName = $this->getAuthor()->getName();
$translate = false;
if (!$this->created_by)
{
$objectName = 'Guest user';
$translate = true;
}
elseif (!$this->_findActivityActor())
... | [
"protected",
"function",
"_actorConfig",
"(",
"KObjectConfig",
"$",
"config",
")",
"{",
"$",
"objectName",
"=",
"$",
"this",
"->",
"getAuthor",
"(",
")",
"->",
"getName",
"(",
")",
";",
"$",
"translate",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"this",
... | Set the actor config.
@param KObjectConfig $config The actor config.
@return KObjectConfig | [
"Set",
"the",
"actor",
"config",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L612-L636 |
34,304 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._objectConfig | protected function _objectConfig(KObjectConfig $config)
{
$config->append(array(
'id' => $this->row,
'objectName' => $this->title,
'type' => array('objectName' => $this->name, 'object' => true),
'url' => 'option=com_' . $this->package . '&... | php | protected function _objectConfig(KObjectConfig $config)
{
$config->append(array(
'id' => $this->row,
'objectName' => $this->title,
'type' => array('objectName' => $this->name, 'object' => true),
'url' => 'option=com_' . $this->package . '&... | [
"protected",
"function",
"_objectConfig",
"(",
"KObjectConfig",
"$",
"config",
")",
"{",
"$",
"config",
"->",
"append",
"(",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"row",
",",
"'objectName'",
"=>",
"$",
"this",
"->",
"title",
",",
"'type'",
"=>",... | Set the object config.
@param KObjectConfig $config The object config. | [
"Set",
"the",
"object",
"config",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L643-L654 |
34,305 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._findObject | protected function _findObject($label)
{
$result = false;
$signature = null;
$method = sprintf('_get%sSignature', ucfirst($label));
if (method_exists($this, $method)) {
$signature = $this->$method();
}
if (is_null($signature) || !isset(self::$_find_r... | php | protected function _findObject($label)
{
$result = false;
$signature = null;
$method = sprintf('_get%sSignature', ucfirst($label));
if (method_exists($this, $method)) {
$signature = $this->$method();
}
if (is_null($signature) || !isset(self::$_find_r... | [
"protected",
"function",
"_findObject",
"(",
"$",
"label",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"signature",
"=",
"null",
";",
"$",
"method",
"=",
"sprintf",
"(",
"'_get%sSignature'",
",",
"ucfirst",
"(",
"$",
"label",
")",
")",
";",
"if",
... | Find an activity object.
@param string $label The object label.
@return bool True if found, false otherwise. | [
"Find",
"an",
"activity",
"object",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L712-L738 |
34,306 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._findActivityObject | protected function _findActivityObject()
{
$db = $this->getTable()->getAdapter();
$table = $this->_object_table;
$column = $this->_object_column;
$query = $this->getObject('lib:database.query.select');
$query->columns('COUNT(*)')->table($table)->where($column . ' = :val... | php | protected function _findActivityObject()
{
$db = $this->getTable()->getAdapter();
$table = $this->_object_table;
$column = $this->_object_column;
$query = $this->getObject('lib:database.query.select');
$query->columns('COUNT(*)')->table($table)->where($column . ' = :val... | [
"protected",
"function",
"_findActivityObject",
"(",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getTable",
"(",
")",
"->",
"getAdapter",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"_object_table",
";",
"$",
"column",
"=",
"$",
"this",
"-... | Finds the activity object.
This method may be overridden for activities persisting objects on storage systems other than local database
tables.
@return boolean True if found, false otherwise. | [
"Finds",
"the",
"activity",
"object",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L748-L766 |
34,307 | joomlatools/joomlatools-framework-activities | model/entity/activity.php | ComActivitiesModelEntityActivity._findActivityActor | protected function _findActivityActor()
{
$user = $this->getObject('user.provider')->fetch($this->created_by);
return is_null($user) ? false : true;
} | php | protected function _findActivityActor()
{
$user = $this->getObject('user.provider')->fetch($this->created_by);
return is_null($user) ? false : true;
} | [
"protected",
"function",
"_findActivityActor",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getObject",
"(",
"'user.provider'",
")",
"->",
"fetch",
"(",
"$",
"this",
"->",
"created_by",
")",
";",
"return",
"is_null",
"(",
"$",
"user",
")",
"?",
... | Finds the activity actor.
@return boolean True if found, false otherwise. | [
"Finds",
"the",
"activity",
"actor",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/model/entity/activity.php#L773-L778 |
34,308 | aviat4ion/Query | src/QueryParser.php | QueryParser.parseJoin | public function parseJoin(string $sql): array
{
// Get sql clause components
preg_match_all('`'.$this->matchPatterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
preg_match_all('`'.$this->matchPatterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
preg_match_a... | php | public function parseJoin(string $sql): array
{
// Get sql clause components
preg_match_all('`'.$this->matchPatterns['function'].'`', $sql, $this->matches['functions'], PREG_SET_ORDER);
preg_match_all('`'.$this->matchPatterns['identifier'].'`', $sql, $this->matches['identifiers'], PREG_SET_ORDER);
preg_match_a... | [
"public",
"function",
"parseJoin",
"(",
"string",
"$",
"sql",
")",
":",
"array",
"{",
"// Get sql clause components",
"preg_match_all",
"(",
"'`'",
".",
"$",
"this",
"->",
"matchPatterns",
"[",
"'function'",
"]",
".",
"'`'",
",",
"$",
"sql",
",",
"$",
"thi... | Parser method for setting the parse string
@param string $sql
@return array | [
"Parser",
"method",
"for",
"setting",
"the",
"parse",
"string"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryParser.php#L70-L85 |
34,309 | aviat4ion/Query | src/QueryParser.php | QueryParser.compileJoin | public function compileJoin(string $condition): string
{
$parts = $this->parseJoin($condition);
$count = count($parts['identifiers']);
// Go through and quote the identifiers
for($i=0; $i <= $count; $i++)
{
if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]... | php | public function compileJoin(string $condition): string
{
$parts = $this->parseJoin($condition);
$count = count($parts['identifiers']);
// Go through and quote the identifiers
for($i=0; $i <= $count; $i++)
{
if (in_array($parts['combined'][$i], $parts['identifiers']) && ! is_numeric($parts['combined'][$i]... | [
"public",
"function",
"compileJoin",
"(",
"string",
"$",
"condition",
")",
":",
"string",
"{",
"$",
"parts",
"=",
"$",
"this",
"->",
"parseJoin",
"(",
"$",
"condition",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"parts",
"[",
"'identifiers'",
"]",... | Compiles a join condition after parsing
@param string $condition
@return string | [
"Compiles",
"a",
"join",
"condition",
"after",
"parsing"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryParser.php#L93-L108 |
34,310 | aviat4ion/Query | src/QueryParser.php | QueryParser.filterArray | protected function filterArray(array $array): array
{
$newArray = [];
foreach($array as $row)
{
$newArray[] = (is_array($row)) ? $row[0] : $row;
}
return $newArray;
} | php | protected function filterArray(array $array): array
{
$newArray = [];
foreach($array as $row)
{
$newArray[] = (is_array($row)) ? $row[0] : $row;
}
return $newArray;
} | [
"protected",
"function",
"filterArray",
"(",
"array",
"$",
"array",
")",
":",
"array",
"{",
"$",
"newArray",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"row",
")",
"{",
"$",
"newArray",
"[",
"]",
"=",
"(",
"is_array",
"(",
"$",
... | Returns a more useful match array
@param array $array
@return array | [
"Returns",
"a",
"more",
"useful",
"match",
"array"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryParser.php#L116-L126 |
34,311 | joomlatools/joomlatools-framework-activities | controller/behavior/purgeable.php | ComActivitiesControllerBehaviorPurgeable._actionPurge | protected function _actionPurge(KControllerContextInterface $context)
{
$model = $this->getModel();
$state = $model->getState();
$query = $this->getObject('lib:database.query.delete');
$query->table(array($model->getTable()->getName()));
if ($state->end_date && $state->end_... | php | protected function _actionPurge(KControllerContextInterface $context)
{
$model = $this->getModel();
$state = $model->getState();
$query = $this->getObject('lib:database.query.delete');
$query->table(array($model->getTable()->getName()));
if ($state->end_date && $state->end_... | [
"protected",
"function",
"_actionPurge",
"(",
"KControllerContextInterface",
"$",
"context",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"state",
"=",
"$",
"model",
"->",
"getState",
"(",
")",
";",
"$",
"query",
"=",
... | Purge action.
Deletes activities given a date range.
@param KControllerContextInterface $context A command context object.
@throws KControllerExceptionActionFailed If the activities cannot be purged.
@return KModelEntityInterface | [
"Purge",
"action",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/controller/behavior/purgeable.php#L29-L50 |
34,312 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.select | public function select(string $fields): QueryBuilderInterface
{
// Split fields by comma
$fieldsArray = explode(',', $fields);
$fieldsArray = array_map('mb_trim', $fieldsArray);
// Split on 'As'
foreach ($fieldsArray as $key => $field)
{
if (stripos($field, 'as') !== FALSE)
{
$fieldsArray[$key] ... | php | public function select(string $fields): QueryBuilderInterface
{
// Split fields by comma
$fieldsArray = explode(',', $fields);
$fieldsArray = array_map('mb_trim', $fieldsArray);
// Split on 'As'
foreach ($fieldsArray as $key => $field)
{
if (stripos($field, 'as') !== FALSE)
{
$fieldsArray[$key] ... | [
"public",
"function",
"select",
"(",
"string",
"$",
"fields",
")",
":",
"QueryBuilderInterface",
"{",
"// Split fields by comma",
"$",
"fieldsArray",
"=",
"explode",
"(",
"','",
",",
"$",
"fields",
")",
";",
"$",
"fieldsArray",
"=",
"array_map",
"(",
"'mb_trim... | Specifies rows to select in a query
@param string $fields
@return QueryBuilderInterface | [
"Specifies",
"rows",
"to",
"select",
"in",
"a",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L121-L154 |
34,313 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.selectMax | public function selectMax(string $field, $as=FALSE): QueryBuilderInterface
{
// Create the select string
$this->state->appendSelectString(' MAX'.$this->_select($field, $as));
return $this;
} | php | public function selectMax(string $field, $as=FALSE): QueryBuilderInterface
{
// Create the select string
$this->state->appendSelectString(' MAX'.$this->_select($field, $as));
return $this;
} | [
"public",
"function",
"selectMax",
"(",
"string",
"$",
"field",
",",
"$",
"as",
"=",
"FALSE",
")",
":",
"QueryBuilderInterface",
"{",
"// Create the select string",
"$",
"this",
"->",
"state",
"->",
"appendSelectString",
"(",
"' MAX'",
".",
"$",
"this",
"->",
... | Selects the maximum value of a field from a query
@param string $field
@param string|bool $as
@return QueryBuilderInterface | [
"Selects",
"the",
"maximum",
"value",
"of",
"a",
"field",
"from",
"a",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L163-L168 |
34,314 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.from | public function from(string $tblname): QueryBuilderInterface
{
// Split identifiers on spaces
$identArray = explode(' ', \mb_trim($tblname));
$identArray = array_map('\\mb_trim', $identArray);
// Quote the identifiers
$identArray[0] = $this->driver->quoteTable($identArray[0]);
$identArray = $this->driver-... | php | public function from(string $tblname): QueryBuilderInterface
{
// Split identifiers on spaces
$identArray = explode(' ', \mb_trim($tblname));
$identArray = array_map('\\mb_trim', $identArray);
// Quote the identifiers
$identArray[0] = $this->driver->quoteTable($identArray[0]);
$identArray = $this->driver-... | [
"public",
"function",
"from",
"(",
"string",
"$",
"tblname",
")",
":",
"QueryBuilderInterface",
"{",
"// Split identifiers on spaces",
"$",
"identArray",
"=",
"explode",
"(",
"' '",
",",
"\\",
"mb_trim",
"(",
"$",
"tblname",
")",
")",
";",
"$",
"identArray",
... | Specify the database table to select from
@param string $tblname
@return QueryBuilderInterface | [
"Specify",
"the",
"database",
"table",
"to",
"select",
"from"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L241-L255 |
34,315 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.like | public function like(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos);
} | php | public function like(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos);
} | [
"public",
"function",
"like",
"(",
"string",
"$",
"field",
",",
"$",
"val",
",",
"string",
"$",
"pos",
"=",
"'both'",
")",
":",
"QueryBuilderInterface",
"{",
"return",
"$",
"this",
"->",
"_like",
"(",
"$",
"field",
",",
"$",
"val",
",",
"$",
"pos",
... | Creates a Like clause in the sql statement
@param string $field
@param mixed $val
@param string $pos
@return QueryBuilderInterface | [
"Creates",
"a",
"Like",
"clause",
"in",
"the",
"sql",
"statement"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L269-L272 |
34,316 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.orLike | public function orLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'LIKE', 'OR');
} | php | public function orLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'LIKE', 'OR');
} | [
"public",
"function",
"orLike",
"(",
"string",
"$",
"field",
",",
"$",
"val",
",",
"string",
"$",
"pos",
"=",
"'both'",
")",
":",
"QueryBuilderInterface",
"{",
"return",
"$",
"this",
"->",
"_like",
"(",
"$",
"field",
",",
"$",
"val",
",",
"$",
"pos",... | Generates an OR Like clause
@param string $field
@param mixed $val
@param string $pos
@return QueryBuilderInterface | [
"Generates",
"an",
"OR",
"Like",
"clause"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L282-L285 |
34,317 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.notLike | public function notLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'NOT LIKE');
} | php | public function notLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'NOT LIKE');
} | [
"public",
"function",
"notLike",
"(",
"string",
"$",
"field",
",",
"$",
"val",
",",
"string",
"$",
"pos",
"=",
"'both'",
")",
":",
"QueryBuilderInterface",
"{",
"return",
"$",
"this",
"->",
"_like",
"(",
"$",
"field",
",",
"$",
"val",
",",
"$",
"pos"... | Generates a NOT LIKE clause
@param string $field
@param mixed $val
@param string $pos
@return QueryBuilderInterface | [
"Generates",
"a",
"NOT",
"LIKE",
"clause"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L295-L298 |
34,318 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.orNotLike | public function orNotLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
} | php | public function orNotLike(string $field, $val, string $pos='both'): QueryBuilderInterface
{
return $this->_like($field, $val, $pos, 'NOT LIKE', 'OR');
} | [
"public",
"function",
"orNotLike",
"(",
"string",
"$",
"field",
",",
"$",
"val",
",",
"string",
"$",
"pos",
"=",
"'both'",
")",
":",
"QueryBuilderInterface",
"{",
"return",
"$",
"this",
"->",
"_like",
"(",
"$",
"field",
",",
"$",
"val",
",",
"$",
"po... | Generates a OR NOT LIKE clause
@param string $field
@param mixed $val
@param string $pos
@return QueryBuilderInterface | [
"Generates",
"a",
"OR",
"NOT",
"LIKE",
"clause"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L308-L311 |
34,319 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.join | public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
{
// Prefix and quote table name
$table = explode(' ', mb_trim($table));
$table[0] = $this->driver->quoteTable($table[0]);
$table = $this->driver->quoteIdent($table);
$table = implode(' ', $table);
// Parse out ... | php | public function join(string $table, string $condition, string $type=''): QueryBuilderInterface
{
// Prefix and quote table name
$table = explode(' ', mb_trim($table));
$table[0] = $this->driver->quoteTable($table[0]);
$table = $this->driver->quoteIdent($table);
$table = implode(' ', $table);
// Parse out ... | [
"public",
"function",
"join",
"(",
"string",
"$",
"table",
",",
"string",
"$",
"condition",
",",
"string",
"$",
"type",
"=",
"''",
")",
":",
"QueryBuilderInterface",
"{",
"// Prefix and quote table name",
"$",
"table",
"=",
"explode",
"(",
"' '",
",",
"mb_tr... | Creates a join phrase in a compiled query
@param string $table
@param string $condition
@param string $type
@return QueryBuilderInterface | [
"Creates",
"a",
"join",
"phrase",
"in",
"a",
"compiled",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L471-L486 |
34,320 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.limit | public function limit(int $limit, $offset=FALSE): QueryBuilderInterface
{
$this->state->setLimit($limit);
$this->state->setOffset($offset);
return $this;
} | php | public function limit(int $limit, $offset=FALSE): QueryBuilderInterface
{
$this->state->setLimit($limit);
$this->state->setOffset($offset);
return $this;
} | [
"public",
"function",
"limit",
"(",
"int",
"$",
"limit",
",",
"$",
"offset",
"=",
"FALSE",
")",
":",
"QueryBuilderInterface",
"{",
"$",
"this",
"->",
"state",
"->",
"setLimit",
"(",
"$",
"limit",
")",
";",
"$",
"this",
"->",
"state",
"->",
"setOffset",... | Set a limit on the current sql statement
@param int $limit
@param int|bool $offset
@return QueryBuilderInterface | [
"Set",
"a",
"limit",
"on",
"the",
"current",
"sql",
"statement"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L559-L565 |
34,321 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.groupStart | public function groupStart(): QueryBuilderInterface
{
$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' ';
$this->state->appendMap($conj, '(', 'group_start');
return $this;
} | php | public function groupStart(): QueryBuilderInterface
{
$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' ';
$this->state->appendMap($conj, '(', 'group_start');
return $this;
} | [
"public",
"function",
"groupStart",
"(",
")",
":",
"QueryBuilderInterface",
"{",
"$",
"conj",
"=",
"empty",
"(",
"$",
"this",
"->",
"state",
"->",
"getQueryMap",
"(",
")",
")",
"?",
"' WHERE '",
":",
"' '",
";",
"$",
"this",
"->",
"state",
"->",
"appen... | Adds a paren to the current query for query grouping
@return QueryBuilderInterface | [
"Adds",
"a",
"paren",
"to",
"the",
"current",
"query",
"for",
"query",
"grouping"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L576-L583 |
34,322 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.notGroupStart | public function notGroupStart(): QueryBuilderInterface
{
$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';
$this->state->appendMap($conj, ' NOT (', 'group_start');
return $this;
} | php | public function notGroupStart(): QueryBuilderInterface
{
$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';
$this->state->appendMap($conj, ' NOT (', 'group_start');
return $this;
} | [
"public",
"function",
"notGroupStart",
"(",
")",
":",
"QueryBuilderInterface",
"{",
"$",
"conj",
"=",
"empty",
"(",
"$",
"this",
"->",
"state",
"->",
"getQueryMap",
"(",
")",
")",
"?",
"' WHERE '",
":",
"' AND '",
";",
"$",
"this",
"->",
"state",
"->",
... | Adds a paren to the current query for query grouping,
prefixed with 'NOT'
@return QueryBuilderInterface | [
"Adds",
"a",
"paren",
"to",
"the",
"current",
"query",
"for",
"query",
"grouping",
"prefixed",
"with",
"NOT"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L591-L598 |
34,323 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.countAll | public function countAll(string $table): int
{
$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
$res = $this->driver->query($sql);
return (int) count($res->fetchAll());
} | php | public function countAll(string $table): int
{
$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
$res = $this->driver->query($sql);
return (int) count($res->fetchAll());
} | [
"public",
"function",
"countAll",
"(",
"string",
"$",
"table",
")",
":",
"int",
"{",
"$",
"sql",
"=",
"'SELECT * FROM '",
".",
"$",
"this",
"->",
"driver",
"->",
"quoteTable",
"(",
"$",
"table",
")",
";",
"$",
"res",
"=",
"$",
"this",
"->",
"driver",... | Retrieve the number of rows in the selected table
@param string $table
@return int | [
"Retrieve",
"the",
"number",
"of",
"rows",
"in",
"the",
"selected",
"table"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L692-L697 |
34,324 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.insert | public function insert(string $table, $data=[]): ?PDOStatement
{
if ( ! empty($data))
{
$this->set($data);
}
return $this->_run('insert', $table);
} | php | public function insert(string $table, $data=[]): ?PDOStatement
{
if ( ! empty($data))
{
$this->set($data);
}
return $this->_run('insert', $table);
} | [
"public",
"function",
"insert",
"(",
"string",
"$",
"table",
",",
"$",
"data",
"=",
"[",
"]",
")",
":",
"?",
"PDOStatement",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"data",
")",
";",
... | Creates an insert clause, and executes it
@param string $table
@param mixed $data
@return PDOStatement | [
"Creates",
"an",
"insert",
"clause",
"and",
"executes",
"it"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L728-L736 |
34,325 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.insertBatch | public function insertBatch(string $table, $data=[]): ?PDOStatement
{
// Get the generated values and sql string
[$sql, $data] = $this->driver->insertBatch($table, $data);
return $sql !== NULL
? $this->_run('', $table, $sql, $data)
: NULL;
} | php | public function insertBatch(string $table, $data=[]): ?PDOStatement
{
// Get the generated values and sql string
[$sql, $data] = $this->driver->insertBatch($table, $data);
return $sql !== NULL
? $this->_run('', $table, $sql, $data)
: NULL;
} | [
"public",
"function",
"insertBatch",
"(",
"string",
"$",
"table",
",",
"$",
"data",
"=",
"[",
"]",
")",
":",
"?",
"PDOStatement",
"{",
"// Get the generated values and sql string",
"[",
"$",
"sql",
",",
"$",
"data",
"]",
"=",
"$",
"this",
"->",
"driver",
... | Creates and executes a batch insertion query
@param string $table
@param array $data
@return PDOStatement | [
"Creates",
"and",
"executes",
"a",
"batch",
"insertion",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L745-L753 |
34,326 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.updateBatch | public function updateBatch(string $table, $data, $where): ?PDOStatement
{
// Get the generated values and sql string
list($sql, $data) = $this->driver->updateBatch($table, $data, $where);
return $sql !== NULL
? $this->_run('', $table, $sql, $data)
: NULL;
} | php | public function updateBatch(string $table, $data, $where): ?PDOStatement
{
// Get the generated values and sql string
list($sql, $data) = $this->driver->updateBatch($table, $data, $where);
return $sql !== NULL
? $this->_run('', $table, $sql, $data)
: NULL;
} | [
"public",
"function",
"updateBatch",
"(",
"string",
"$",
"table",
",",
"$",
"data",
",",
"$",
"where",
")",
":",
"?",
"PDOStatement",
"{",
"// Get the generated values and sql string",
"list",
"(",
"$",
"sql",
",",
"$",
"data",
")",
"=",
"$",
"this",
"->",... | Creates a batch update, and executes it.
Returns the number of affected rows
@param string $table
@param array|object $data
@param string $where
@return PDOStatement|null | [
"Creates",
"a",
"batch",
"update",
"and",
"executes",
"it",
".",
"Returns",
"the",
"number",
"of",
"affected",
"rows"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L781-L789 |
34,327 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.delete | public function delete(string $table, $where=''): ?PDOStatement
{
// Set the where clause
if ( ! empty($where))
{
$this->where($where);
}
return $this->_run('delete', $table);
} | php | public function delete(string $table, $where=''): ?PDOStatement
{
// Set the where clause
if ( ! empty($where))
{
$this->where($where);
}
return $this->_run('delete', $table);
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"table",
",",
"$",
"where",
"=",
"''",
")",
":",
"?",
"PDOStatement",
"{",
"// Set the where clause",
"if",
"(",
"!",
"empty",
"(",
"$",
"where",
")",
")",
"{",
"$",
"this",
"->",
"where",
"(",
"$",... | Deletes data from a table
@param string $table
@param mixed $where
@return PDOStatement | [
"Deletes",
"data",
"from",
"a",
"table"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L815-L824 |
34,328 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.getCompiledSelect | public function getCompiledSelect(string $table='', bool $reset=TRUE): string
{
// Set the table
if ( ! empty($table))
{
$this->from($table);
}
return $this->_getCompile('select', $table, $reset);
} | php | public function getCompiledSelect(string $table='', bool $reset=TRUE): string
{
// Set the table
if ( ! empty($table))
{
$this->from($table);
}
return $this->_getCompile('select', $table, $reset);
} | [
"public",
"function",
"getCompiledSelect",
"(",
"string",
"$",
"table",
"=",
"''",
",",
"bool",
"$",
"reset",
"=",
"TRUE",
")",
":",
"string",
"{",
"// Set the table",
"if",
"(",
"!",
"empty",
"(",
"$",
"table",
")",
")",
"{",
"$",
"this",
"->",
"fro... | Returns the generated 'select' sql query
@param string $table
@param bool $reset
@return string | [
"Returns",
"the",
"generated",
"select",
"sql",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L837-L846 |
34,329 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.getCompiledInsert | public function getCompiledInsert(string $table, bool $reset=TRUE): string
{
return $this->_getCompile('insert', $table, $reset);
} | php | public function getCompiledInsert(string $table, bool $reset=TRUE): string
{
return $this->_getCompile('insert', $table, $reset);
} | [
"public",
"function",
"getCompiledInsert",
"(",
"string",
"$",
"table",
",",
"bool",
"$",
"reset",
"=",
"TRUE",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"_getCompile",
"(",
"'insert'",
",",
"$",
"table",
",",
"$",
"reset",
")",
";",
"}"
] | Returns the generated 'insert' sql query
@param string $table
@param bool $reset
@return string | [
"Returns",
"the",
"generated",
"insert",
"sql",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L855-L858 |
34,330 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.getCompiledUpdate | public function getCompiledUpdate(string $table='', bool $reset=TRUE): string
{
return $this->_getCompile('update', $table, $reset);
} | php | public function getCompiledUpdate(string $table='', bool $reset=TRUE): string
{
return $this->_getCompile('update', $table, $reset);
} | [
"public",
"function",
"getCompiledUpdate",
"(",
"string",
"$",
"table",
"=",
"''",
",",
"bool",
"$",
"reset",
"=",
"TRUE",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"_getCompile",
"(",
"'update'",
",",
"$",
"table",
",",
"$",
"reset",
")",
... | Returns the generated 'update' sql query
@param string $table
@param bool $reset
@return string | [
"Returns",
"the",
"generated",
"update",
"sql",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L867-L870 |
34,331 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder.getCompiledDelete | public function getCompiledDelete(string $table='', bool $reset=TRUE): string
{
return $this->_getCompile('delete', $table, $reset);
} | php | public function getCompiledDelete(string $table='', bool $reset=TRUE): string
{
return $this->_getCompile('delete', $table, $reset);
} | [
"public",
"function",
"getCompiledDelete",
"(",
"string",
"$",
"table",
"=",
"''",
",",
"bool",
"$",
"reset",
"=",
"TRUE",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"_getCompile",
"(",
"'delete'",
",",
"$",
"table",
",",
"$",
"reset",
")",
... | Returns the generated 'delete' sql query
@param string $table
@param bool $reset
@return string | [
"Returns",
"the",
"generated",
"delete",
"sql",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L879-L882 |
34,332 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._select | protected function _select(string $field, $as = FALSE): string
{
// Escape the identifiers
$field = $this->driver->quoteIdent($field);
if ( ! \is_string($as))
{
return $field;
}
$as = $this->driver->quoteIdent($as);
return "({$field}) AS {$as} ";
} | php | protected function _select(string $field, $as = FALSE): string
{
// Escape the identifiers
$field = $this->driver->quoteIdent($field);
if ( ! \is_string($as))
{
return $field;
}
$as = $this->driver->quoteIdent($as);
return "({$field}) AS {$as} ";
} | [
"protected",
"function",
"_select",
"(",
"string",
"$",
"field",
",",
"$",
"as",
"=",
"FALSE",
")",
":",
"string",
"{",
"// Escape the identifiers",
"$",
"field",
"=",
"$",
"this",
"->",
"driver",
"->",
"quoteIdent",
"(",
"$",
"field",
")",
";",
"if",
... | Method to simplify select_ methods
@param string $field
@param string|bool $as
@return string | [
"Method",
"to",
"simplify",
"select_",
"methods"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L906-L918 |
34,333 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._getCompile | protected function _getCompile(string $type, string $table, bool $reset): string
{
$sql = $this->_compile($type, $table);
// Reset the query builder for the next query
if ($reset)
{
$this->resetQuery();
}
return $sql;
} | php | protected function _getCompile(string $type, string $table, bool $reset): string
{
$sql = $this->_compile($type, $table);
// Reset the query builder for the next query
if ($reset)
{
$this->resetQuery();
}
return $sql;
} | [
"protected",
"function",
"_getCompile",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"table",
",",
"bool",
"$",
"reset",
")",
":",
"string",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"_compile",
"(",
"$",
"type",
",",
"$",
"table",
")",
";",
"// ... | Helper function for returning sql strings
@param string $type
@param string $table
@param bool $reset
@return string | [
"Helper",
"function",
"for",
"returning",
"sql",
"strings"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L928-L939 |
34,334 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._like | protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): self
{
$field = $this->driver->quoteIdent($field);
// Add the like string into the order map
$like = $field. " {$like} ?";
if ($pos === 'before')
{
$val = "%{$val}";
}
elseif ($pos === 'after')
{
... | php | protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): self
{
$field = $this->driver->quoteIdent($field);
// Add the like string into the order map
$like = $field. " {$like} ?";
if ($pos === 'before')
{
$val = "%{$val}";
}
elseif ($pos === 'after')
{
... | [
"protected",
"function",
"_like",
"(",
"string",
"$",
"field",
",",
"$",
"val",
",",
"string",
"$",
"pos",
",",
"string",
"$",
"like",
"=",
"'LIKE'",
",",
"string",
"$",
"conj",
"=",
"'AND'",
")",
":",
"self",
"{",
"$",
"field",
"=",
"$",
"this",
... | Simplify 'like' methods
@param string $field
@param mixed $val
@param string $pos
@param string $like
@param string $conj
@return self | [
"Simplify",
"like",
"methods"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L951-L978 |
34,335 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._having | protected function _having($key, $values=[], string $conj='AND'): self
{
$where = $this->_where($key, $values);
// Create key/value placeholders
foreach($where as $f => $val)
{
// Split each key by spaces, in case there
// is an operator such as >, <, !=, etc.
$fArray = explode(' ', trim($f));
$i... | php | protected function _having($key, $values=[], string $conj='AND'): self
{
$where = $this->_where($key, $values);
// Create key/value placeholders
foreach($where as $f => $val)
{
// Split each key by spaces, in case there
// is an operator such as >, <, !=, etc.
$fArray = explode(' ', trim($f));
$i... | [
"protected",
"function",
"_having",
"(",
"$",
"key",
",",
"$",
"values",
"=",
"[",
"]",
",",
"string",
"$",
"conj",
"=",
"'AND'",
")",
":",
"self",
"{",
"$",
"where",
"=",
"$",
"this",
"->",
"_where",
"(",
"$",
"key",
",",
"$",
"values",
")",
"... | Simplify building having clauses
@param mixed $key
@param mixed $values
@param string $conj
@return self | [
"Simplify",
"building",
"having",
"clauses"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L988-L1014 |
34,336 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._whereString | protected function _whereString($key, $values=[], string $defaultConj='AND'): self
{
// Create key/value placeholders
foreach($this->_where($key, $values) as $f => $val)
{
$queryMap = $this->state->getQueryMap();
// Split each key by spaces, in case there
// is an operator such as >, <, !=, etc.
$fA... | php | protected function _whereString($key, $values=[], string $defaultConj='AND'): self
{
// Create key/value placeholders
foreach($this->_where($key, $values) as $f => $val)
{
$queryMap = $this->state->getQueryMap();
// Split each key by spaces, in case there
// is an operator such as >, <, !=, etc.
$fA... | [
"protected",
"function",
"_whereString",
"(",
"$",
"key",
",",
"$",
"values",
"=",
"[",
"]",
",",
"string",
"$",
"defaultConj",
"=",
"'AND'",
")",
":",
"self",
"{",
"// Create key/value placeholders",
"foreach",
"(",
"$",
"this",
"->",
"_where",
"(",
"$",
... | Simplify generating where string
@param mixed $key
@param mixed $values
@param string $defaultConj
@return self | [
"Simplify",
"generating",
"where",
"string"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1054-L1090 |
34,337 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._whereIn | protected function _whereIn($key, $val=[], string $in='IN', string $conj='AND'): self
{
$key = $this->driver->quoteIdent($key);
$params = array_fill(0, count($val), '?');
$this->state->appendWhereValues($val);
$conjunction = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
$str = $key . " {$in... | php | protected function _whereIn($key, $val=[], string $in='IN', string $conj='AND'): self
{
$key = $this->driver->quoteIdent($key);
$params = array_fill(0, count($val), '?');
$this->state->appendWhereValues($val);
$conjunction = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
$str = $key . " {$in... | [
"protected",
"function",
"_whereIn",
"(",
"$",
"key",
",",
"$",
"val",
"=",
"[",
"]",
",",
"string",
"$",
"in",
"=",
"'IN'",
",",
"string",
"$",
"conj",
"=",
"'AND'",
")",
":",
"self",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"driver",
"->",
"q... | Simplify where_in methods
@param mixed $key
@param mixed $val
@param string $in - The (not) in fragment
@param string $conj - The where in conjunction
@return self | [
"Simplify",
"where_in",
"methods"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1101-L1113 |
34,338 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._run | protected function _run(string $type, string $table, string $sql=NULL, array $vals=NULL, bool $reset=TRUE): PDOStatement
{
if ($sql === NULL)
{
$sql = $this->_compile($type, $table);
}
if ($vals === NULL)
{
$vals = array_merge($this->state->getValues(), $this->state->getWhereValues());
}
$startTi... | php | protected function _run(string $type, string $table, string $sql=NULL, array $vals=NULL, bool $reset=TRUE): PDOStatement
{
if ($sql === NULL)
{
$sql = $this->_compile($type, $table);
}
if ($vals === NULL)
{
$vals = array_merge($this->state->getValues(), $this->state->getWhereValues());
}
$startTi... | [
"protected",
"function",
"_run",
"(",
"string",
"$",
"type",
",",
"string",
"$",
"table",
",",
"string",
"$",
"sql",
"=",
"NULL",
",",
"array",
"$",
"vals",
"=",
"NULL",
",",
"bool",
"$",
"reset",
"=",
"TRUE",
")",
":",
"PDOStatement",
"{",
"if",
"... | Executes the compiled query
@param string $type
@param string $table
@param string $sql
@param array|null $vals
@param boolean $reset
@return PDOStatement | [
"Executes",
"the",
"compiled",
"query"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1125-L1156 |
34,339 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._appendQuery | protected function _appendQuery(array $vals = NULL, string $sql, int $totalTime)
{
$evals = \is_array($vals) ? $vals : [];
$esql = str_replace('?', "%s", $sql);
// Quote string values
foreach($evals as &$v)
{
$v = ( ! is_numeric($v))
? htmlentities($this->driver->quote($v), ENT_NOQUOTES, 'utf-8')
... | php | protected function _appendQuery(array $vals = NULL, string $sql, int $totalTime)
{
$evals = \is_array($vals) ? $vals : [];
$esql = str_replace('?', "%s", $sql);
// Quote string values
foreach($evals as &$v)
{
$v = ( ! is_numeric($v))
? htmlentities($this->driver->quote($v), ENT_NOQUOTES, 'utf-8')
... | [
"protected",
"function",
"_appendQuery",
"(",
"array",
"$",
"vals",
"=",
"NULL",
",",
"string",
"$",
"sql",
",",
"int",
"$",
"totalTime",
")",
"{",
"$",
"evals",
"=",
"\\",
"is_array",
"(",
"$",
"vals",
")",
"?",
"$",
"vals",
":",
"[",
"]",
";",
... | Convert the prepared statement into readable sql
@param array $vals
@param string $sql
@param int $totalTime
@return void | [
"Convert",
"the",
"prepared",
"statement",
"into",
"readable",
"sql"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1166-L1193 |
34,340 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._compileType | protected function _compileType(string $type='', string $table=''): string
{
$setArrayKeys = $this->state->getSetArrayKeys();
switch($type)
{
case 'insert':
$paramCount = count($setArrayKeys);
$params = array_fill(0, $paramCount, '?');
$sql = "INSERT INTO {$table} ("
. implode(',', $setArrayK... | php | protected function _compileType(string $type='', string $table=''): string
{
$setArrayKeys = $this->state->getSetArrayKeys();
switch($type)
{
case 'insert':
$paramCount = count($setArrayKeys);
$params = array_fill(0, $paramCount, '?');
$sql = "INSERT INTO {$table} ("
. implode(',', $setArrayK... | [
"protected",
"function",
"_compileType",
"(",
"string",
"$",
"type",
"=",
"''",
",",
"string",
"$",
"table",
"=",
"''",
")",
":",
"string",
"{",
"$",
"setArrayKeys",
"=",
"$",
"this",
"->",
"state",
"->",
"getSetArrayKeys",
"(",
")",
";",
"switch",
"("... | Sub-method for generating sql strings
@param string $type
@param string $table
@return string | [
"Sub",
"-",
"method",
"for",
"generating",
"sql",
"strings"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1202-L1246 |
34,341 | aviat4ion/Query | src/QueryBuilder.php | QueryBuilder._compile | protected function _compile(string $type='', string $table=''): string
{
// Get the base clause for the query
$sql = $this->_compileType($type, $this->driver->quoteTable($table));
$clauses = [
'queryMap',
'groupString',
'orderString',
'havingMap',
];
// Set each type of subclause
foreach($cla... | php | protected function _compile(string $type='', string $table=''): string
{
// Get the base clause for the query
$sql = $this->_compileType($type, $this->driver->quoteTable($table));
$clauses = [
'queryMap',
'groupString',
'orderString',
'havingMap',
];
// Set each type of subclause
foreach($cla... | [
"protected",
"function",
"_compile",
"(",
"string",
"$",
"type",
"=",
"''",
",",
"string",
"$",
"table",
"=",
"''",
")",
":",
"string",
"{",
"// Get the base clause for the query",
"$",
"sql",
"=",
"$",
"this",
"->",
"_compileType",
"(",
"$",
"type",
",",
... | String together the sql statements for sending to the db
@param string $type
@param string $table
@return string | [
"String",
"together",
"the",
"sql",
"statements",
"for",
"sending",
"to",
"the",
"db"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/QueryBuilder.php#L1255-L1300 |
34,342 | joomlatools/joomlatools-framework-activities | template/helper/activity.php | ComActivitiesTemplateHelperActivity._renderObject | protected function _renderObject(ComActivitiesActivityObjectInterface $object, KObjectConfig $config)
{
$config->append(array('html' => true, 'escaped_urls' => true, 'fqr' => false, 'links' => true));
if ($output = $object->getDisplayName())
{
if ($config->html)
{
... | php | protected function _renderObject(ComActivitiesActivityObjectInterface $object, KObjectConfig $config)
{
$config->append(array('html' => true, 'escaped_urls' => true, 'fqr' => false, 'links' => true));
if ($output = $object->getDisplayName())
{
if ($config->html)
{
... | [
"protected",
"function",
"_renderObject",
"(",
"ComActivitiesActivityObjectInterface",
"$",
"object",
",",
"KObjectConfig",
"$",
"config",
")",
"{",
"$",
"config",
"->",
"append",
"(",
"array",
"(",
"'html'",
"=>",
"true",
",",
"'escaped_urls'",
"=>",
"true",
",... | Renders an activity object.
@param ComActivitiesActivityObjectInterface $object The activity object.
@param KObjectConfig $config The configuration object.
@return string The rendered object. | [
"Renders",
"an",
"activity",
"object",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/template/helper/activity.php#L94-L121 |
34,343 | joomlatools/joomlatools-framework-activities | activity/logger/logger.php | ComActivitiesActivityLogger.log | public function log($action, KModelEntityInterface $object, KObjectIdentifierInterface $subject)
{
$controller = $this->getObject($this->_controller);
if($controller instanceof KControllerModellable)
{
foreach($object as $entity)
{
// Only log if the ... | php | public function log($action, KModelEntityInterface $object, KObjectIdentifierInterface $subject)
{
$controller = $this->getObject($this->_controller);
if($controller instanceof KControllerModellable)
{
foreach($object as $entity)
{
// Only log if the ... | [
"public",
"function",
"log",
"(",
"$",
"action",
",",
"KModelEntityInterface",
"$",
"object",
",",
"KObjectIdentifierInterface",
"$",
"subject",
")",
"{",
"$",
"controller",
"=",
"$",
"this",
"->",
"getObject",
"(",
"$",
"this",
"->",
"_controller",
")",
";"... | Log an activity.
@param string $action The action to log.
@param KModelEntityInterface $object The activity object on which the action is performed.
@param KObjectIdentifierInterface $subject The activity subject who is performing the action. | [
"Log",
"an",
"activity",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/activity/logger/logger.php#L79-L111 |
34,344 | joomlatools/joomlatools-framework-activities | activity/logger/logger.php | ComActivitiesActivityLogger.getActivityObject | public function getActivityObject(KCommandInterface $command)
{
$parts = explode('.', $command->getName());
// Properly fetch data for the event.
if ($parts[0] == 'before') {
$object = $command->getSubject()->getModel()->fetch();
} else {
$object = $command->... | php | public function getActivityObject(KCommandInterface $command)
{
$parts = explode('.', $command->getName());
// Properly fetch data for the event.
if ($parts[0] == 'before') {
$object = $command->getSubject()->getModel()->fetch();
} else {
$object = $command->... | [
"public",
"function",
"getActivityObject",
"(",
"KCommandInterface",
"$",
"command",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"command",
"->",
"getName",
"(",
")",
")",
";",
"// Properly fetch data for the event.",
"if",
"(",
"$",
"parts",... | Get the activity object.
The activity object is the entity on which the action is executed.
@param KCommandInterface $command The command.
@return KModelEntityInterface The activity object. | [
"Get",
"the",
"activity",
"object",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/activity/logger/logger.php#L145-L157 |
34,345 | joomlatools/joomlatools-framework-activities | activity/logger/logger.php | ComActivitiesActivityLogger.getActivityStatus | public function getActivityStatus(KModelEntityInterface $object, $action = null)
{
$status = $object->getStatus();
// Commands may change the original status of an action.
if ($action == 'after.add' && $status == KModelEntityInterface::STATUS_UPDATED) {
$status = KModelEntityInt... | php | public function getActivityStatus(KModelEntityInterface $object, $action = null)
{
$status = $object->getStatus();
// Commands may change the original status of an action.
if ($action == 'after.add' && $status == KModelEntityInterface::STATUS_UPDATED) {
$status = KModelEntityInt... | [
"public",
"function",
"getActivityStatus",
"(",
"KModelEntityInterface",
"$",
"object",
",",
"$",
"action",
"=",
"null",
")",
"{",
"$",
"status",
"=",
"$",
"object",
"->",
"getStatus",
"(",
")",
";",
"// Commands may change the original status of an action.",
"if",
... | Get the activity status.
The activity status is the current status of the activity object.
@param KModelEntityInterface $object The activity object.
@param string $action The action being executed.
@return string The activity status. | [
"Get",
"the",
"activity",
"status",
"."
] | 701abf6186729f62643bc834055cdebc08c25c21 | https://github.com/joomlatools/joomlatools-framework-activities/blob/701abf6186729f62643bc834055cdebc08c25c21/activity/logger/logger.php#L168-L183 |
34,346 | aviat4ion/Query | src/ConnectionManager.php | ConnectionManager.getInstance | public static function getInstance(): ConnectionManager
{
if (self::$instance === NULL)
{
self::$instance = new self();
}
return self::$instance;
} | php | public static function getInstance(): ConnectionManager
{
if (self::$instance === NULL)
{
self::$instance = new self();
}
return self::$instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
")",
":",
"ConnectionManager",
"{",
"if",
"(",
"self",
"::",
"$",
"instance",
"===",
"NULL",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self",
"(",
")",
";",
"}",
"return",
"self",
"::",
... | Return a connection manager instance
@staticvar null $instance
@return ConnectionManager | [
"Return",
"a",
"connection",
"manager",
"instance"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/ConnectionManager.php#L85-L93 |
34,347 | aviat4ion/Query | src/ConnectionManager.php | ConnectionManager.getConnection | public function getConnection($name = ''): QueryBuilderInterface
{
// If the parameter is a string, use it as an array index
if (is_scalar($name) && isset($this->connections[$name]))
{
return $this->connections[$name];
}
else if (empty($name) && ! empty($this->connections)) // Otherwise, return the last o... | php | public function getConnection($name = ''): QueryBuilderInterface
{
// If the parameter is a string, use it as an array index
if (is_scalar($name) && isset($this->connections[$name]))
{
return $this->connections[$name];
}
else if (empty($name) && ! empty($this->connections)) // Otherwise, return the last o... | [
"public",
"function",
"getConnection",
"(",
"$",
"name",
"=",
"''",
")",
":",
"QueryBuilderInterface",
"{",
"// If the parameter is a string, use it as an array index",
"if",
"(",
"is_scalar",
"(",
"$",
"name",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"connecti... | Returns the connection specified by the name given
@param string|array|object $name
@return QueryBuilderInterface
@throws InvalidArgumentException | [
"Returns",
"the",
"connection",
"specified",
"by",
"the",
"name",
"given"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/ConnectionManager.php#L102-L116 |
34,348 | aviat4ion/Query | src/ConnectionManager.php | ConnectionManager.connect | public function connect(\stdClass $params): QueryBuilderInterface
{
list($dsn, $dbtype, $params, $options) = $this->parseParams($params);
$dbtype = ucfirst($dbtype);
$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";
// Create the database connection
$db = ! empty($params->user)
? new $driver($dsn, $para... | php | public function connect(\stdClass $params): QueryBuilderInterface
{
list($dsn, $dbtype, $params, $options) = $this->parseParams($params);
$dbtype = ucfirst($dbtype);
$driver = "\\Query\\Drivers\\{$dbtype}\\Driver";
// Create the database connection
$db = ! empty($params->user)
? new $driver($dsn, $para... | [
"public",
"function",
"connect",
"(",
"\\",
"stdClass",
"$",
"params",
")",
":",
"QueryBuilderInterface",
"{",
"list",
"(",
"$",
"dsn",
",",
"$",
"dbtype",
",",
"$",
"params",
",",
"$",
"options",
")",
"=",
"$",
"this",
"->",
"parseParams",
"(",
"$",
... | Parse the passed parameters and return a connection
@param \stdClass $params
@return QueryBuilderInterface | [
"Parse",
"the",
"passed",
"parameters",
"and",
"return",
"a",
"connection"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/ConnectionManager.php#L124-L157 |
34,349 | aviat4ion/Query | src/ConnectionManager.php | ConnectionManager.parseParams | public function parseParams(\stdClass $params): array
{
$params->type = strtolower($params->type);
$dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
$dbtype = ucfirst($dbtype);
// Make sure the class exists
if ( ! class_exists("\\Query\\Drivers\\{$dbtype}\\Driver"))
{
throw new BadD... | php | public function parseParams(\stdClass $params): array
{
$params->type = strtolower($params->type);
$dbtype = ($params->type !== 'postgresql') ? $params->type : 'pgsql';
$dbtype = ucfirst($dbtype);
// Make sure the class exists
if ( ! class_exists("\\Query\\Drivers\\{$dbtype}\\Driver"))
{
throw new BadD... | [
"public",
"function",
"parseParams",
"(",
"\\",
"stdClass",
"$",
"params",
")",
":",
"array",
"{",
"$",
"params",
"->",
"type",
"=",
"strtolower",
"(",
"$",
"params",
"->",
"type",
")",
";",
"$",
"dbtype",
"=",
"(",
"$",
"params",
"->",
"type",
"!=="... | Parses params into a dsn and option array
@param \stdClass $params
@return array
@throws BadDBDriverException | [
"Parses",
"params",
"into",
"a",
"dsn",
"and",
"option",
"array"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/ConnectionManager.php#L166-L198 |
34,350 | aviat4ion/Query | src/ConnectionManager.php | ConnectionManager.createDsn | private function createDsn(string $dbtype, \stdClass $params): string
{
$pairs = [];
if ( ! empty($params->database))
{
$pairs[] = implode('=', ['dbname', $params->database]);
}
$skip = [
'name' => 'name',
'pass' => 'pass',
'user' => 'user',
'type' => 'type',
'prefix' => 'prefix',
'opt... | php | private function createDsn(string $dbtype, \stdClass $params): string
{
$pairs = [];
if ( ! empty($params->database))
{
$pairs[] = implode('=', ['dbname', $params->database]);
}
$skip = [
'name' => 'name',
'pass' => 'pass',
'user' => 'user',
'type' => 'type',
'prefix' => 'prefix',
'opt... | [
"private",
"function",
"createDsn",
"(",
"string",
"$",
"dbtype",
",",
"\\",
"stdClass",
"$",
"params",
")",
":",
"string",
"{",
"$",
"pairs",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
"->",
"database",
")",
")",
"{",
"$",
... | Create the dsn from the db type and params
@codeCoverageIgnore
@param string $dbtype
@param \stdClass $params
@return string | [
"Create",
"the",
"dsn",
"from",
"the",
"db",
"type",
"and",
"params"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/ConnectionManager.php#L208-L237 |
34,351 | aviat4ion/Query | src/State.php | State.appendMap | public function appendMap(string $conjunction = '', string $string = '', string $type = ''): self
{
$this->queryMap[] = [
'type' => $type,
'conjunction' => $conjunction,
'string' => $string
];
return $this;
} | php | public function appendMap(string $conjunction = '', string $string = '', string $type = ''): self
{
$this->queryMap[] = [
'type' => $type,
'conjunction' => $conjunction,
'string' => $string
];
return $this;
} | [
"public",
"function",
"appendMap",
"(",
"string",
"$",
"conjunction",
"=",
"''",
",",
"string",
"$",
"string",
"=",
"''",
",",
"string",
"$",
"type",
"=",
"''",
")",
":",
"self",
"{",
"$",
"this",
"->",
"queryMap",
"[",
"]",
"=",
"[",
"'type'",
"=>... | Add an additional set of mapping pairs to a internal map
@param string $conjunction
@param string $string
@param string $type
@return State | [
"Add",
"an",
"additional",
"set",
"of",
"mapping",
"pairs",
"to",
"a",
"internal",
"map"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/State.php#L400-L408 |
34,352 | netgen-layouts/content-browser-ezplatform | lib/Backend/EzPublishBackend.php | EzPublishBackend.buildItem | private function buildItem(SearchHit $searchHit): Item
{
/** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
$location = $searchHit->valueObject;
/** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
$content = $this->repository->sudo(
... | php | private function buildItem(SearchHit $searchHit): Item
{
/** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
$location = $searchHit->valueObject;
/** @var \eZ\Publish\API\Repository\Values\Content\Content $content */
$content = $this->repository->sudo(
... | [
"private",
"function",
"buildItem",
"(",
"SearchHit",
"$",
"searchHit",
")",
":",
"Item",
"{",
"/** @var \\eZ\\Publish\\API\\Repository\\Values\\Content\\Location $location */",
"$",
"location",
"=",
"$",
"searchHit",
"->",
"valueObject",
";",
"/** @var \\eZ\\Publish\\API\\Re... | Builds the item from provided search hit. | [
"Builds",
"the",
"item",
"from",
"provided",
"search",
"hit",
"."
] | 1f189f154933b92757d8072aea1ba95ac07c1167 | https://github.com/netgen-layouts/content-browser-ezplatform/blob/1f189f154933b92757d8072aea1ba95ac07c1167/lib/Backend/EzPublishBackend.php#L318-L340 |
34,353 | netgen-layouts/content-browser-ezplatform | lib/Backend/EzPublishBackend.php | EzPublishBackend.buildItems | private function buildItems(SearchResult $searchResult): array
{
return array_map(
function (SearchHit $searchHit): Item {
return $this->buildItem($searchHit);
},
$searchResult->searchHits
);
} | php | private function buildItems(SearchResult $searchResult): array
{
return array_map(
function (SearchHit $searchHit): Item {
return $this->buildItem($searchHit);
},
$searchResult->searchHits
);
} | [
"private",
"function",
"buildItems",
"(",
"SearchResult",
"$",
"searchResult",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"SearchHit",
"$",
"searchHit",
")",
":",
"Item",
"{",
"return",
"$",
"this",
"->",
"buildItem",
"(",
"$",
"s... | Builds the items from search result and its hits.
@return \Netgen\ContentBrowser\Ez\Item\EzPublish\Item[] | [
"Builds",
"the",
"items",
"from",
"search",
"result",
"and",
"its",
"hits",
"."
] | 1f189f154933b92757d8072aea1ba95ac07c1167 | https://github.com/netgen-layouts/content-browser-ezplatform/blob/1f189f154933b92757d8072aea1ba95ac07c1167/lib/Backend/EzPublishBackend.php#L347-L355 |
34,354 | netgen-layouts/content-browser-ezplatform | lib/Backend/EzPublishBackend.php | EzPublishBackend.getContentTypeIds | private function getContentTypeIds(array $contentTypeIdentifiers): array
{
$idList = [];
foreach ($contentTypeIdentifiers as $identifier) {
try {
$contentType = $this->contentTypeHandler->loadByIdentifier($identifier);
$idList[] = $contentType->id;
... | php | private function getContentTypeIds(array $contentTypeIdentifiers): array
{
$idList = [];
foreach ($contentTypeIdentifiers as $identifier) {
try {
$contentType = $this->contentTypeHandler->loadByIdentifier($identifier);
$idList[] = $contentType->id;
... | [
"private",
"function",
"getContentTypeIds",
"(",
"array",
"$",
"contentTypeIdentifiers",
")",
":",
"array",
"{",
"$",
"idList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"contentTypeIdentifiers",
"as",
"$",
"identifier",
")",
"{",
"try",
"{",
"$",
"contentTyp... | Returns content type IDs for all existing content types.
@return int[] | [
"Returns",
"content",
"type",
"IDs",
"for",
"all",
"existing",
"content",
"types",
"."
] | 1f189f154933b92757d8072aea1ba95ac07c1167 | https://github.com/netgen-layouts/content-browser-ezplatform/blob/1f189f154933b92757d8072aea1ba95ac07c1167/lib/Backend/EzPublishBackend.php#L362-L376 |
34,355 | netgen-layouts/content-browser-ezplatform | lib/Backend/EzPublishBackend.php | EzPublishBackend.isSelectable | private function isSelectable(Content $content): bool
{
if (!$this->config->hasParameter('allowed_content_types')) {
return true;
}
if ($this->allowedContentTypeIds === null) {
$this->allowedContentTypeIds = [];
$allowedContentTypes = $this->config->getP... | php | private function isSelectable(Content $content): bool
{
if (!$this->config->hasParameter('allowed_content_types')) {
return true;
}
if ($this->allowedContentTypeIds === null) {
$this->allowedContentTypeIds = [];
$allowedContentTypes = $this->config->getP... | [
"private",
"function",
"isSelectable",
"(",
"Content",
"$",
"content",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"config",
"->",
"hasParameter",
"(",
"'allowed_content_types'",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
... | Returns if the provided content is selectable. | [
"Returns",
"if",
"the",
"provided",
"content",
"is",
"selectable",
"."
] | 1f189f154933b92757d8072aea1ba95ac07c1167 | https://github.com/netgen-layouts/content-browser-ezplatform/blob/1f189f154933b92757d8072aea1ba95ac07c1167/lib/Backend/EzPublishBackend.php#L381-L402 |
34,356 | aviat4ion/Query | src/Drivers/AbstractUtil.php | AbstractUtil.createTable | public function createTable($name, $fields, array $constraints=[], $ifNotExists=TRUE)
{
$existsStr = $ifNotExists ? ' IF NOT EXISTS ' : ' ';
// Reorganize into an array indexed with column information
// Eg $columnArray[$colname] = array(
// 'type' => ...,
// 'constraint' => ...,
// 'index' => ...,
... | php | public function createTable($name, $fields, array $constraints=[], $ifNotExists=TRUE)
{
$existsStr = $ifNotExists ? ' IF NOT EXISTS ' : ' ';
// Reorganize into an array indexed with column information
// Eg $columnArray[$colname] = array(
// 'type' => ...,
// 'constraint' => ...,
// 'index' => ...,
... | [
"public",
"function",
"createTable",
"(",
"$",
"name",
",",
"$",
"fields",
",",
"array",
"$",
"constraints",
"=",
"[",
"]",
",",
"$",
"ifNotExists",
"=",
"TRUE",
")",
"{",
"$",
"existsStr",
"=",
"$",
"ifNotExists",
"?",
"' IF NOT EXISTS '",
":",
"' '",
... | Convenience public function to generate sql for creating a db table
@param string $name
@param array $fields
@param array $constraints
@param bool $ifNotExists
@return string | [
"Convenience",
"public",
"function",
"to",
"generate",
"sql",
"for",
"creating",
"a",
"db",
"table"
] | 172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650 | https://github.com/aviat4ion/Query/blob/172eb3f6ebdfb7295b42e32cc74bf37c3ebd7650/src/Drivers/AbstractUtil.php#L60-L92 |
34,357 | usemarkup/addressing | Renderer/SerializableAddressAdapter.php | SerializableAddressAdapter.getStreetAddressLine | public function getStreetAddressLine($lineNumber)
{
$lines = $this->getStreetAddressLines();
if (!isset($lines[$lineNumber-1])) {
return null;
}
return $lines[$lineNumber-1];
} | php | public function getStreetAddressLine($lineNumber)
{
$lines = $this->getStreetAddressLines();
if (!isset($lines[$lineNumber-1])) {
return null;
}
return $lines[$lineNumber-1];
} | [
"public",
"function",
"getStreetAddressLine",
"(",
"$",
"lineNumber",
")",
"{",
"$",
"lines",
"=",
"$",
"this",
"->",
"getStreetAddressLines",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"lines",
"[",
"$",
"lineNumber",
"-",
"1",
"]",
")",
")",
... | Gets the numbered address line, counting from one. If there is no address line for provided number, return null.
@param int $lineNumber
@return string|null | [
"Gets",
"the",
"numbered",
"address",
"line",
"counting",
"from",
"one",
".",
"If",
"there",
"is",
"no",
"address",
"line",
"for",
"provided",
"number",
"return",
"null",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Renderer/SerializableAddressAdapter.php#L59-L67 |
34,358 | usemarkup/addressing | Iso/Iso3166Converter.php | Iso3166Converter.convertAlpha2ToAlpha3 | public function convertAlpha2ToAlpha3($alpha2)
{
if (!isset(self::$codes[$alpha2])) {
return null;
}
return self::$codes[$alpha2];
} | php | public function convertAlpha2ToAlpha3($alpha2)
{
if (!isset(self::$codes[$alpha2])) {
return null;
}
return self::$codes[$alpha2];
} | [
"public",
"function",
"convertAlpha2ToAlpha3",
"(",
"$",
"alpha2",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"codes",
"[",
"$",
"alpha2",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"self",
"::",
"$",
"codes",
"[",
"$... | Gets the ISO3166 alpha-3 code that corresponds to the provided alpha-2 code.
@param string $alpha2
@return string|null | [
"Gets",
"the",
"ISO3166",
"alpha",
"-",
"3",
"code",
"that",
"corresponds",
"to",
"the",
"provided",
"alpha",
"-",
"2",
"code",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Iso/Iso3166Converter.php#L268-L275 |
34,359 | usemarkup/addressing | Iso/Iso3166Converter.php | Iso3166Converter.convertAlpha3ToAlpha2 | public function convertAlpha3ToAlpha2($alpha3)
{
$alpha2 = array_search($alpha3, self::$codes);
if (false === $alpha2) {
return null;
}
return (string) $alpha2;
} | php | public function convertAlpha3ToAlpha2($alpha3)
{
$alpha2 = array_search($alpha3, self::$codes);
if (false === $alpha2) {
return null;
}
return (string) $alpha2;
} | [
"public",
"function",
"convertAlpha3ToAlpha2",
"(",
"$",
"alpha3",
")",
"{",
"$",
"alpha2",
"=",
"array_search",
"(",
"$",
"alpha3",
",",
"self",
"::",
"$",
"codes",
")",
";",
"if",
"(",
"false",
"===",
"$",
"alpha2",
")",
"{",
"return",
"null",
";",
... | Gets the ISO3166 alpha-2 code that corresponds to the provided alpha-3 code.
@param string $alpha3
@return string|null | [
"Gets",
"the",
"ISO3166",
"alpha",
"-",
"2",
"code",
"that",
"corresponds",
"to",
"the",
"provided",
"alpha",
"-",
"3",
"code",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Iso/Iso3166Converter.php#L283-L291 |
34,360 | usemarkup/addressing | Canonicalizer/PostalCodeCanonicalizer.php | PostalCodeCanonicalizer.canonicalizeForCountry | public function canonicalizeForCountry($postalCode, $country)
{
switch ($country) {
case 'GB':
case 'IM':
case 'JE':
case 'GG':
case 'GI':
$ukCanonicalizer = new UnitedKingdomPostcodeCanonicalizer();
return $ukCanon... | php | public function canonicalizeForCountry($postalCode, $country)
{
switch ($country) {
case 'GB':
case 'IM':
case 'JE':
case 'GG':
case 'GI':
$ukCanonicalizer = new UnitedKingdomPostcodeCanonicalizer();
return $ukCanon... | [
"public",
"function",
"canonicalizeForCountry",
"(",
"$",
"postalCode",
",",
"$",
"country",
")",
"{",
"switch",
"(",
"$",
"country",
")",
"{",
"case",
"'GB'",
":",
"case",
"'IM'",
":",
"case",
"'JE'",
":",
"case",
"'GG'",
":",
"case",
"'GI'",
":",
"$"... | Canonicalizes a provided postal code for a given country if it is possible to do so, otherwise returns the postal code unmodified.
@param string $postalCode A postal code string.
@param string $country The ISO3166 alpha-2 representation of a country.
@return string | [
"Canonicalizes",
"a",
"provided",
"postal",
"code",
"for",
"a",
"given",
"country",
"if",
"it",
"is",
"possible",
"to",
"do",
"so",
"otherwise",
"returns",
"the",
"postal",
"code",
"unmodified",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Canonicalizer/PostalCodeCanonicalizer.php#L18-L66 |
34,361 | usemarkup/addressing | Canonicalizer/CanonicalizeAddressDecorator.php | CanonicalizeAddressDecorator.getPostalCode | public function getPostalCode()
{
$canonicalizer = new PostalCodeCanonicalizer();
return $canonicalizer->canonicalizeForCountry($this->address->getPostalCode(), $this->address->getCountry());
} | php | public function getPostalCode()
{
$canonicalizer = new PostalCodeCanonicalizer();
return $canonicalizer->canonicalizeForCountry($this->address->getPostalCode(), $this->address->getCountry());
} | [
"public",
"function",
"getPostalCode",
"(",
")",
"{",
"$",
"canonicalizer",
"=",
"new",
"PostalCodeCanonicalizer",
"(",
")",
";",
"return",
"$",
"canonicalizer",
"->",
"canonicalizeForCountry",
"(",
"$",
"this",
"->",
"address",
"->",
"getPostalCode",
"(",
")",
... | Gets the postal code for this address.
If no postal code is indicated as part of the address information, returns an empty string.
@return string | [
"Gets",
"the",
"postal",
"code",
"for",
"this",
"address",
".",
"If",
"no",
"postal",
"code",
"is",
"indicated",
"as",
"part",
"of",
"the",
"address",
"information",
"returns",
"an",
"empty",
"string",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Canonicalizer/CanonicalizeAddressDecorator.php#L93-L98 |
34,362 | usemarkup/addressing | Provider/CountryNameProvider.php | CountryNameProvider.loadCountriesForLocale | private function loadCountriesForLocale($locale)
{
//load from Symfony Intl component
$regionBundle = Intl::getRegionBundle();
$this->displayCountries[$locale] = $regionBundle->getCountryNames($locale);
} | php | private function loadCountriesForLocale($locale)
{
//load from Symfony Intl component
$regionBundle = Intl::getRegionBundle();
$this->displayCountries[$locale] = $regionBundle->getCountryNames($locale);
} | [
"private",
"function",
"loadCountriesForLocale",
"(",
"$",
"locale",
")",
"{",
"//load from Symfony Intl component",
"$",
"regionBundle",
"=",
"Intl",
"::",
"getRegionBundle",
"(",
")",
";",
"$",
"this",
"->",
"displayCountries",
"[",
"$",
"locale",
"]",
"=",
"$... | Loads countries in.
@param string $locale | [
"Loads",
"countries",
"in",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Provider/CountryNameProvider.php#L77-L82 |
34,363 | usemarkup/addressing | Provider/IntlAddressHandlebarsTemplateProvider.php | IntlAddressHandlebarsTemplateProvider.getTemplateForCountry | public function getTemplateForCountry($country, $format, array $options = [])
{
return new HandlebarsTemplate($this->getRenderFunction(strtolower($country), $format));
} | php | public function getTemplateForCountry($country, $format, array $options = [])
{
return new HandlebarsTemplate($this->getRenderFunction(strtolower($country), $format));
} | [
"public",
"function",
"getTemplateForCountry",
"(",
"$",
"country",
",",
"$",
"format",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"new",
"HandlebarsTemplate",
"(",
"$",
"this",
"->",
"getRenderFunction",
"(",
"strtolower",
"(",
"$",
... | Gets a template that pertains to the provided country.
@param string $country The ISO3166 alpha-2 value for a country (case-insensitive).
@param string $format The address format being used.
@param array $options
@return TemplateInterface | [
"Gets",
"a",
"template",
"that",
"pertains",
"to",
"the",
"provided",
"country",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Provider/IntlAddressHandlebarsTemplateProvider.php#L53-L56 |
34,364 | usemarkup/addressing | Geography.php | Geography.checkInEu | public function checkInEu($addressOrCountry)
{
$country = (is_object($addressOrCountry) && method_exists($addressOrCountry, 'getCountry')) ? $addressOrCountry->getCountry() : $addressOrCountry;
if (!is_string($country)) {
return false;
}
return in_array($country, self::$... | php | public function checkInEu($addressOrCountry)
{
$country = (is_object($addressOrCountry) && method_exists($addressOrCountry, 'getCountry')) ? $addressOrCountry->getCountry() : $addressOrCountry;
if (!is_string($country)) {
return false;
}
return in_array($country, self::$... | [
"public",
"function",
"checkInEu",
"(",
"$",
"addressOrCountry",
")",
"{",
"$",
"country",
"=",
"(",
"is_object",
"(",
"$",
"addressOrCountry",
")",
"&&",
"method_exists",
"(",
"$",
"addressOrCountry",
",",
"'getCountry'",
")",
")",
"?",
"$",
"addressOrCountry... | Gets whether the country or address are in the EU.
@param mixed $addressOrCountry
@return bool | [
"Gets",
"whether",
"the",
"country",
"or",
"address",
"are",
"in",
"the",
"EU",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Geography.php#L104-L112 |
34,365 | usemarkup/addressing | Geography.php | Geography.getUsStateAbbreviationForName | public function getUsStateAbbreviationForName($name)
{
if (!in_array($name, self::$usStates)) {
return null;
}
return (string) array_search($name, self::$usStates);
} | php | public function getUsStateAbbreviationForName($name)
{
if (!in_array($name, self::$usStates)) {
return null;
}
return (string) array_search($name, self::$usStates);
} | [
"public",
"function",
"getUsStateAbbreviationForName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"usStates",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"string",
")",
"array_search",
... | Gets the abbreviation for the provided state name, if this can be found - otherwise returns null.
@param string $name
@return string|null | [
"Gets",
"the",
"abbreviation",
"for",
"the",
"provided",
"state",
"name",
"if",
"this",
"can",
"be",
"found",
"-",
"otherwise",
"returns",
"null",
"."
] | facd8fe58ba187b92e06490d8a6416999fb8f711 | https://github.com/usemarkup/addressing/blob/facd8fe58ba187b92e06490d8a6416999fb8f711/Geography.php#L120-L127 |
34,366 | epfremmer/swagger-php | src/Parser/SwaggerParser.php | SwaggerParser.getVersion | public function getVersion()
{
if (!array_key_exists(self::VERSION_KEY, $this->data)) {
$this->data[self::VERSION_KEY] = self::MINIMUM_VERSION;
}
if (!version_compare($this->data[self::VERSION_KEY], SwaggerParser::MINIMUM_VERSION, '>=')) {
throw new InvalidVersionExc... | php | public function getVersion()
{
if (!array_key_exists(self::VERSION_KEY, $this->data)) {
$this->data[self::VERSION_KEY] = self::MINIMUM_VERSION;
}
if (!version_compare($this->data[self::VERSION_KEY], SwaggerParser::MINIMUM_VERSION, '>=')) {
throw new InvalidVersionExc... | [
"public",
"function",
"getVersion",
"(",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"self",
"::",
"VERSION_KEY",
",",
"$",
"this",
"->",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"self",
"::",
"VERSION_KEY",
"]",
"=",
"self",
"::... | Return swagger version
@return string | [
"Return",
"swagger",
"version"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Parser/SwaggerParser.php#L35-L46 |
34,367 | epfremmer/swagger-php | src/Parser/FileParser.php | FileParser.parse | protected function parse($file)
{
$data = json_decode(file_get_contents($file), true) ?: Yaml::parse(file_get_contents($file));
return $data;
} | php | protected function parse($file)
{
$data = json_decode(file_get_contents($file), true) ?: Yaml::parse(file_get_contents($file));
return $data;
} | [
"protected",
"function",
"parse",
"(",
"$",
"file",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
",",
"true",
")",
"?",
":",
"Yaml",
"::",
"parse",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
")",
"... | Parse the swagger file
@param string $file - fully qualified file path
@return array | [
"Parse",
"the",
"swagger",
"file"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Parser/FileParser.php#L34-L39 |
34,368 | epfremmer/swagger-php | src/Annotations/Discriminator.php | Discriminator.getClass | public function getClass(array $data)
{
if (!array_key_exists($this->field, $data)) {
return $this->map[$this->getDefault()];
}
$type = $data[$this->field];
// fallback to default if type not found in map
if (!isset($this->map[$type])) {
$type = $thi... | php | public function getClass(array $data)
{
if (!array_key_exists($this->field, $data)) {
return $this->map[$this->getDefault()];
}
$type = $data[$this->field];
// fallback to default if type not found in map
if (!isset($this->map[$type])) {
$type = $thi... | [
"public",
"function",
"getClass",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"this",
"->",
"field",
",",
"$",
"data",
")",
")",
"{",
"return",
"$",
"this",
"->",
"map",
"[",
"$",
"this",
"->",
"getDefault",
"... | Return the correct mapped class
@param array $data
@return mixed | [
"Return",
"the",
"correct",
"mapped",
"class"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Annotations/Discriminator.php#L58-L72 |
34,369 | epfremmer/swagger-php | src/Factory/SwaggerFactory.php | SwaggerFactory.serialize | public function serialize(Swagger $swagger)
{
$context = new SerializationContext();
$context->setVersion(
$swagger->getVersion()
);
return $this->serializer->serialize($swagger, 'json', $context);
} | php | public function serialize(Swagger $swagger)
{
$context = new SerializationContext();
$context->setVersion(
$swagger->getVersion()
);
return $this->serializer->serialize($swagger, 'json', $context);
} | [
"public",
"function",
"serialize",
"(",
"Swagger",
"$",
"swagger",
")",
"{",
"$",
"context",
"=",
"new",
"SerializationContext",
"(",
")",
";",
"$",
"context",
"->",
"setVersion",
"(",
"$",
"swagger",
"->",
"getVersion",
"(",
")",
")",
";",
"return",
"$"... | Return serialized Swagger document
@param Swagger $swagger
@return string | [
"Return",
"serialized",
"Swagger",
"document"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Factory/SwaggerFactory.php#L89-L98 |
34,370 | epfremmer/swagger-php | src/Factory/SwaggerFactory.php | SwaggerFactory.buildFromParser | private function buildFromParser(SwaggerParser $parser)
{
$context = new DeserializationContext();
$context->setVersion(
$parser->getVersion()
);
return $this->serializer->deserialize($parser, Swagger::class, 'json', $context);
} | php | private function buildFromParser(SwaggerParser $parser)
{
$context = new DeserializationContext();
$context->setVersion(
$parser->getVersion()
);
return $this->serializer->deserialize($parser, Swagger::class, 'json', $context);
} | [
"private",
"function",
"buildFromParser",
"(",
"SwaggerParser",
"$",
"parser",
")",
"{",
"$",
"context",
"=",
"new",
"DeserializationContext",
"(",
")",
";",
"$",
"context",
"->",
"setVersion",
"(",
"$",
"parser",
"->",
"getVersion",
"(",
")",
")",
";",
"r... | Return de-serialized Swagger result
@param SwaggerParser $parser
@return Swagger
@throws \LogicException | [
"Return",
"de",
"-",
"serialized",
"Swagger",
"result"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Factory/SwaggerFactory.php#L107-L116 |
34,371 | epfremmer/swagger-php | src/Listener/SerializationSubscriber.php | SerializationSubscriber.onPreDeserialize | public function onPreDeserialize(PreDeserializeEvent $event)
{
$class = $event->getType()['name'];
if (!class_exists($class)) {
return; // skip custom JMS types
}
$data = $event->getData();
$object = new \ReflectionClass($class);
$discriminator = $thi... | php | public function onPreDeserialize(PreDeserializeEvent $event)
{
$class = $event->getType()['name'];
if (!class_exists($class)) {
return; // skip custom JMS types
}
$data = $event->getData();
$object = new \ReflectionClass($class);
$discriminator = $thi... | [
"public",
"function",
"onPreDeserialize",
"(",
"PreDeserializeEvent",
"$",
"event",
")",
"{",
"$",
"class",
"=",
"$",
"event",
"->",
"getType",
"(",
")",
"[",
"'name'",
"]",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"return... | Checks for the existence of a discriminator annotation and sets the
corresponding mapped deserialization class
@param PreDeserializeEvent $event | [
"Checks",
"for",
"the",
"existence",
"of",
"a",
"discriminator",
"annotation",
"and",
"sets",
"the",
"corresponding",
"mapped",
"deserialization",
"class"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Listener/SerializationSubscriber.php#L89-L105 |
34,372 | epfremmer/swagger-php | src/Listener/SerializationSubscriber.php | SerializationSubscriber.onParameterPreDeserialize | public function onParameterPreDeserialize(PreDeserializeEvent $event)
{
$data = $event->getData();
if (array_key_exists('$ref', $data)) {
$event->setType(RefParameter::class);
return;
}
$data['class'] = $data['in'];
if (array_key_exists('type', $dat... | php | public function onParameterPreDeserialize(PreDeserializeEvent $event)
{
$data = $event->getData();
if (array_key_exists('$ref', $data)) {
$event->setType(RefParameter::class);
return;
}
$data['class'] = $data['in'];
if (array_key_exists('type', $dat... | [
"public",
"function",
"onParameterPreDeserialize",
"(",
"PreDeserializeEvent",
"$",
"event",
")",
"{",
"$",
"data",
"=",
"$",
"event",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'$ref'",
",",
"$",
"data",
")",
")",
"{",
"$",
"ev... | Set custom composite discriminator key based on multiple parameter fields
before deserialization to ensure proper discrimination mapping
@param PreDeserializeEvent $event | [
"Set",
"custom",
"composite",
"discriminator",
"key",
"based",
"on",
"multiple",
"parameter",
"fields",
"before",
"deserialization",
"to",
"ensure",
"proper",
"discrimination",
"mapping"
] | 9915e610f8da8b1d50895941498a5c2904e96aa3 | https://github.com/epfremmer/swagger-php/blob/9915e610f8da8b1d50895941498a5c2904e96aa3/src/Listener/SerializationSubscriber.php#L135-L151 |
34,373 | KnpLabs/mailjet-api-php | src/Mailjet/Api/Client.php | Client.post | public function post($apiQuery, $options = array())
{
if (!RequestApi::isPost($apiQuery)) {
throw new \InvalidArgumentException('Unsupported API query for POST method: ' . $apiQuery);
}
$request = $this->getApi()->post($apiQuery, null, $options);
$this->prepareRequest($... | php | public function post($apiQuery, $options = array())
{
if (!RequestApi::isPost($apiQuery)) {
throw new \InvalidArgumentException('Unsupported API query for POST method: ' . $apiQuery);
}
$request = $this->getApi()->post($apiQuery, null, $options);
$this->prepareRequest($... | [
"public",
"function",
"post",
"(",
"$",
"apiQuery",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"RequestApi",
"::",
"isPost",
"(",
"$",
"apiQuery",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Unsup... | Method for issuing low level API POST requests
@see Client::get() | [
"Method",
"for",
"issuing",
"low",
"level",
"API",
"POST",
"requests"
] | 042968e4c516845248323c8db367cdb033329ae4 | https://github.com/KnpLabs/mailjet-api-php/blob/042968e4c516845248323c8db367cdb033329ae4/src/Mailjet/Api/Client.php#L64-L77 |
34,374 | M6Web/ElasticsearchBundle | src/M6Web/Bundle/ElasticsearchBundle/Elasticsearch/ConnectionPool/StaticAliveNoPingConnectionPool.php | StaticAliveNoPingConnectionPool.readyToRevive | protected function readyToRevive(Connection $connection)
{
$timeout = min(
$this->pingTimeout * pow(2, $connection->getPingFailures()),
$this->maxPingTimeout
);
if ($connection->getLastPing() + $timeout < time()) {
return true;
} else {
... | php | protected function readyToRevive(Connection $connection)
{
$timeout = min(
$this->pingTimeout * pow(2, $connection->getPingFailures()),
$this->maxPingTimeout
);
if ($connection->getLastPing() + $timeout < time()) {
return true;
} else {
... | [
"protected",
"function",
"readyToRevive",
"(",
"Connection",
"$",
"connection",
")",
"{",
"$",
"timeout",
"=",
"min",
"(",
"$",
"this",
"->",
"pingTimeout",
"*",
"pow",
"(",
"2",
",",
"$",
"connection",
"->",
"getPingFailures",
"(",
")",
")",
",",
"$",
... | > Same as parent private method.
@param Connection $connection
@return bool | [
">",
"Same",
"as",
"parent",
"private",
"method",
"."
] | 0f9bcba0bea85a359aa43bebbb777a5badf08b16 | https://github.com/M6Web/ElasticsearchBundle/blob/0f9bcba0bea85a359aa43bebbb777a5badf08b16/src/M6Web/Bundle/ElasticsearchBundle/Elasticsearch/ConnectionPool/StaticAliveNoPingConnectionPool.php#L90-L102 |
34,375 | M6Web/ElasticsearchBundle | src/M6Web/Bundle/ElasticsearchBundle/Handler/EventHandler.php | EventHandler.extractTookFromResponse | protected function extractTookFromResponse(array $response)
{
if (is_null($response['body'])) {
return null;
}
$content = stream_get_contents($response['body']);
rewind($response['body']);
if (preg_match('/\"took\":(\d+)/', $content, $matches)) {
retu... | php | protected function extractTookFromResponse(array $response)
{
if (is_null($response['body'])) {
return null;
}
$content = stream_get_contents($response['body']);
rewind($response['body']);
if (preg_match('/\"took\":(\d+)/', $content, $matches)) {
retu... | [
"protected",
"function",
"extractTookFromResponse",
"(",
"array",
"$",
"response",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"response",
"[",
"'body'",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"content",
"=",
"stream_get_contents",
"(",
"$",
... | Extract took from response
@param array $response
@return int|null | [
"Extract",
"took",
"from",
"response"
] | 0f9bcba0bea85a359aa43bebbb777a5badf08b16 | https://github.com/M6Web/ElasticsearchBundle/blob/0f9bcba0bea85a359aa43bebbb777a5badf08b16/src/M6Web/Bundle/ElasticsearchBundle/Handler/EventHandler.php#L90-L103 |
34,376 | M6Web/ElasticsearchBundle | src/M6Web/Bundle/ElasticsearchBundle/DependencyInjection/M6WebElasticsearchExtension.php | M6WebElasticsearchExtension.createElasticsearchClient | protected function createElasticsearchClient(ContainerBuilder $container, $name, $config)
{
$definitionId = 'm6web_elasticsearch.client.'.$name;
$handlerId = $this->createHandler($container, $config, $definitionId);
$clientConfig = [
'hosts' => $config['hosts'],
'... | php | protected function createElasticsearchClient(ContainerBuilder $container, $name, $config)
{
$definitionId = 'm6web_elasticsearch.client.'.$name;
$handlerId = $this->createHandler($container, $config, $definitionId);
$clientConfig = [
'hosts' => $config['hosts'],
'... | [
"protected",
"function",
"createElasticsearchClient",
"(",
"ContainerBuilder",
"$",
"container",
",",
"$",
"name",
",",
"$",
"config",
")",
"{",
"$",
"definitionId",
"=",
"'m6web_elasticsearch.client.'",
".",
"$",
"name",
";",
"$",
"handlerId",
"=",
"$",
"this",... | Add a new Elasticsearch client definition in the container
@param ContainerBuilder $container
@param string $name
@param array $config | [
"Add",
"a",
"new",
"Elasticsearch",
"client",
"definition",
"in",
"the",
"container"
] | 0f9bcba0bea85a359aa43bebbb777a5badf08b16 | https://github.com/M6Web/ElasticsearchBundle/blob/0f9bcba0bea85a359aa43bebbb777a5badf08b16/src/M6Web/Bundle/ElasticsearchBundle/DependencyInjection/M6WebElasticsearchExtension.php#L59-L99 |
34,377 | M6Web/ElasticsearchBundle | src/M6Web/Bundle/ElasticsearchBundle/DependencyInjection/M6WebElasticsearchExtension.php | M6WebElasticsearchExtension.createHandler | protected function createHandler(ContainerBuilder $container, array $config, $definitionId)
{
// cURL handler
$singleHandler = (new Definition('GuzzleHttp\Ring\Client\CurlHandler'))
->setPublic(false);
$this->setFactoryToDefinition('Elasticsearch\ClientBuilder', 'defaultHandle... | php | protected function createHandler(ContainerBuilder $container, array $config, $definitionId)
{
// cURL handler
$singleHandler = (new Definition('GuzzleHttp\Ring\Client\CurlHandler'))
->setPublic(false);
$this->setFactoryToDefinition('Elasticsearch\ClientBuilder', 'defaultHandle... | [
"protected",
"function",
"createHandler",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"config",
",",
"$",
"definitionId",
")",
"{",
"// cURL handler",
"$",
"singleHandler",
"=",
"(",
"new",
"Definition",
"(",
"'GuzzleHttp\\Ring\\Client\\CurlHandler'"... | Create request handler
@param ContainerBuilder $container
@param array $config
@param string $definitionId
@return string | [
"Create",
"request",
"handler"
] | 0f9bcba0bea85a359aa43bebbb777a5badf08b16 | https://github.com/M6Web/ElasticsearchBundle/blob/0f9bcba0bea85a359aa43bebbb777a5badf08b16/src/M6Web/Bundle/ElasticsearchBundle/DependencyInjection/M6WebElasticsearchExtension.php#L110-L141 |
34,378 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Type/Collection.php | Collection.add | public function add($type)
{
if (!is_string($type)) {
throw new \InvalidArgumentException(
'A type should be represented by a string, received: '
.var_export($type, true)
);
}
// separate the type by the OR operator
$type_parts... | php | public function add($type)
{
if (!is_string($type)) {
throw new \InvalidArgumentException(
'A type should be represented by a string, received: '
.var_export($type, true)
);
}
// separate the type by the OR operator
$type_parts... | [
"public",
"function",
"add",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'A type should be represented by a string, received: '",
".",
"var_export",
"(",
"$",
... | Adds a new type to the collection and expands it if it contains a
relative namespace.
If a class in the type contains a relative namespace than this collection
will try to expand that into a FQCN.
@param string $type A 'Type' as defined in the phpDocumentor
documentation.
@throws \InvalidArgumentException if a non-s... | [
"Adds",
"a",
"new",
"type",
"to",
"the",
"collection",
"and",
"expands",
"it",
"if",
"it",
"contains",
"a",
"relative",
"namespace",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Type/Collection.php#L99-L116 |
34,379 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Serializer.php | Serializer.setLineLength | public function setLineLength($lineLength)
{
$this->lineLength = null === $lineLength ? null : (int)$lineLength;
return $this;
} | php | public function setLineLength($lineLength)
{
$this->lineLength = null === $lineLength ? null : (int)$lineLength;
return $this;
} | [
"public",
"function",
"setLineLength",
"(",
"$",
"lineLength",
")",
"{",
"$",
"this",
"->",
"lineLength",
"=",
"null",
"===",
"$",
"lineLength",
"?",
"null",
":",
"(",
"int",
")",
"$",
"lineLength",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the line length.
Sets the length of each line in the serialization. Content will be
wrapped within this limit.
@param int|null $lineLength The length of each line. NULL to disable line
wrapping altogether.
@return $this This serializer object. | [
"Sets",
"the",
"line",
"length",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Serializer.php#L144-L148 |
34,380 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Context.php | Context.setNamespaceAliases | public function setNamespaceAliases(array $namespace_aliases)
{
$this->namespace_aliases = array();
foreach ($namespace_aliases as $alias => $fqnn) {
$this->setNamespaceAlias($alias, $fqnn);
}
return $this;
} | php | public function setNamespaceAliases(array $namespace_aliases)
{
$this->namespace_aliases = array();
foreach ($namespace_aliases as $alias => $fqnn) {
$this->setNamespaceAlias($alias, $fqnn);
}
return $this;
} | [
"public",
"function",
"setNamespaceAliases",
"(",
"array",
"$",
"namespace_aliases",
")",
"{",
"$",
"this",
"->",
"namespace_aliases",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"namespace_aliases",
"as",
"$",
"alias",
"=>",
"$",
"fqnn",
")",
"{",
"... | Sets the namespace aliases, replacing all previous ones.
@param array $namespace_aliases List of namespace aliases => Fully
Qualified Namespace.
@return $this | [
"Sets",
"the",
"namespace",
"aliases",
"replacing",
"all",
"previous",
"ones",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Context.php#L112-L119 |
34,381 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Context.php | Context.setNamespaceAlias | public function setNamespaceAlias($alias, $fqnn)
{
$this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\');
return $this;
} | php | public function setNamespaceAlias($alias, $fqnn)
{
$this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\');
return $this;
} | [
"public",
"function",
"setNamespaceAlias",
"(",
"$",
"alias",
",",
"$",
"fqnn",
")",
"{",
"$",
"this",
"->",
"namespace_aliases",
"[",
"$",
"alias",
"]",
"=",
"'\\\\'",
".",
"trim",
"(",
"(",
"string",
")",
"$",
"fqnn",
",",
"'\\\\'",
")",
";",
"retu... | Adds a namespace alias to the context.
@param string $alias The alias name (the part after "as", or the last
part of the Fully Qualified Namespace Name) to add.
@param string $fqnn The Fully Qualified Namespace Name for this alias.
Any form of leading/trailing slashes are accepted, but what will be
stored is a name, ... | [
"Adds",
"a",
"namespace",
"alias",
"to",
"the",
"context",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Context.php#L132-L136 |
34,382 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock.php | DocBlock.getText | public function getText()
{
$short = $this->getShortDescription();
$long = $this->getLongDescription()->getContents();
if ($long) {
return "{$short}\n\n{$long}";
} else {
return $short;
}
} | php | public function getText()
{
$short = $this->getShortDescription();
$long = $this->getLongDescription()->getContents();
if ($long) {
return "{$short}\n\n{$long}";
} else {
return $short;
}
} | [
"public",
"function",
"getText",
"(",
")",
"{",
"$",
"short",
"=",
"$",
"this",
"->",
"getShortDescription",
"(",
")",
";",
"$",
"long",
"=",
"$",
"this",
"->",
"getLongDescription",
"(",
")",
"->",
"getContents",
"(",
")",
";",
"if",
"(",
"$",
"long... | Gets the text portion of the doc block.
Gets the text portion (short and long description combined) of the doc
block.
@return string The text portion of the doc block. | [
"Gets",
"the",
"text",
"portion",
"of",
"the",
"doc",
"block",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock.php#L256-L266 |
34,383 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock.php | DocBlock.setText | public function setText($comment)
{
list(,$short, $long) = $this->splitDocBlock($comment);
$this->short_description = $short;
$this->long_description = new DocBlock\Description($long, $this);
return $this;
} | php | public function setText($comment)
{
list(,$short, $long) = $this->splitDocBlock($comment);
$this->short_description = $short;
$this->long_description = new DocBlock\Description($long, $this);
return $this;
} | [
"public",
"function",
"setText",
"(",
"$",
"comment",
")",
"{",
"list",
"(",
",",
"$",
"short",
",",
"$",
"long",
")",
"=",
"$",
"this",
"->",
"splitDocBlock",
"(",
"$",
"comment",
")",
";",
"$",
"this",
"->",
"short_description",
"=",
"$",
"short",
... | Set the text portion of the doc block.
Sets the text portion (short and long description combined) of the doc
block.
@param string $docblock The new text portion of the doc block.
@return $this This doc block. | [
"Set",
"the",
"text",
"portion",
"of",
"the",
"doc",
"block",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock.php#L278-L284 |
34,384 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock.php | DocBlock.appendTag | public function appendTag(Tag $tag)
{
if (null === $tag->getDocBlock()) {
$tag->setDocBlock($this);
}
if ($tag->getDocBlock() === $this) {
$this->tags[] = $tag;
} else {
throw new \LogicException(
'This tag belongs to a different D... | php | public function appendTag(Tag $tag)
{
if (null === $tag->getDocBlock()) {
$tag->setDocBlock($this);
}
if ($tag->getDocBlock() === $this) {
$this->tags[] = $tag;
} else {
throw new \LogicException(
'This tag belongs to a different D... | [
"public",
"function",
"appendTag",
"(",
"Tag",
"$",
"tag",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"tag",
"->",
"getDocBlock",
"(",
")",
")",
"{",
"$",
"tag",
"->",
"setDocBlock",
"(",
"$",
"this",
")",
";",
"}",
"if",
"(",
"$",
"tag",
"->",
"... | Appends a tag at the end of the list of tags.
@param Tag $tag The tag to add.
@return Tag The newly added tag.
@throws \LogicException When the tag belongs to a different DocBlock. | [
"Appends",
"a",
"tag",
"at",
"the",
"end",
"of",
"the",
"list",
"of",
"tags",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock.php#L425-L440 |
34,385 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Description.php | Description.setContent | public function setContent($content)
{
$this->contents = trim($content);
$this->parsedContents = null;
return $this;
} | php | public function setContent($content)
{
$this->contents = trim($content);
$this->parsedContents = null;
return $this;
} | [
"public",
"function",
"setContent",
"(",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"contents",
"=",
"trim",
"(",
"$",
"content",
")",
";",
"$",
"this",
"->",
"parsedContents",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the text of this description.
@param string $content The new text of this description.
@return $this | [
"Sets",
"the",
"text",
"of",
"this",
"description",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Description.php#L63-L69 |
34,386 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Description.php | Description.getFormattedContents | public function getFormattedContents()
{
$result = $this->contents;
// if the long description contains a plain HTML <code> element, surround
// it with a pre element. Please note that we explicitly used str_replace
// and not preg_replace to gain performance
if (strpos($res... | php | public function getFormattedContents()
{
$result = $this->contents;
// if the long description contains a plain HTML <code> element, surround
// it with a pre element. Please note that we explicitly used str_replace
// and not preg_replace to gain performance
if (strpos($res... | [
"public",
"function",
"getFormattedContents",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"contents",
";",
"// if the long description contains a plain HTML <code> element, surround",
"// it with a pre element. Please note that we explicitly used str_replace",
"// and not p... | Return a formatted variant of the Long Description using MarkDown.
@todo this should become a more intelligent piece of code where the
configuration contains a setting what format long descriptions are.
@codeCoverageIgnore Will be removed soon, in favor of adapters at
PhpDocumentor itself that will process text in va... | [
"Return",
"a",
"formatted",
"variant",
"of",
"the",
"Long",
"Description",
"using",
"MarkDown",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Description.php#L149-L173 |
34,387 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.createInstance | final public static function createInstance(
$tag_line,
DocBlock $docblock = null,
Location $location = null
) {
if (!preg_match(
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
$tag_line,
$matches
)) {
throw new \Inva... | php | final public static function createInstance(
$tag_line,
DocBlock $docblock = null,
Location $location = null
) {
if (!preg_match(
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
$tag_line,
$matches
)) {
throw new \Inva... | [
"final",
"public",
"static",
"function",
"createInstance",
"(",
"$",
"tag_line",
",",
"DocBlock",
"$",
"docblock",
"=",
"null",
",",
"Location",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^@('",
".",
"self",
"::",
"REGE... | Factory method responsible for instantiating the correct sub type.
@param string $tag_line The text for this tag, including description.
@param DocBlock $docblock The DocBlock which this tag belongs to.
@param Location $location Location of the tag.
@throws \InvalidArgumentException if an invalid tag line was prese... | [
"Factory",
"method",
"responsible",
"for",
"instantiating",
"the",
"correct",
"sub",
"type",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L112-L147 |
34,388 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.registerTagHandler | final public static function registerTagHandler($tag, $handler)
{
$tag = trim((string)$tag);
if (null === $handler) {
unset(self::$tagHandlerMappings[$tag]);
return true;
}
if ('' !== $tag
&& class_exists($handler, true)
&& is_subclas... | php | final public static function registerTagHandler($tag, $handler)
{
$tag = trim((string)$tag);
if (null === $handler) {
unset(self::$tagHandlerMappings[$tag]);
return true;
}
if ('' !== $tag
&& class_exists($handler, true)
&& is_subclas... | [
"final",
"public",
"static",
"function",
"registerTagHandler",
"(",
"$",
"tag",
",",
"$",
"handler",
")",
"{",
"$",
"tag",
"=",
"trim",
"(",
"(",
"string",
")",
"$",
"tag",
")",
";",
"if",
"(",
"null",
"===",
"$",
"handler",
")",
"{",
"unset",
"(",... | Registers a handler for tags.
Registers a handler for tags. The class specified is autoloaded if it's
not available. It must inherit from this class.
@param string $tag Name of tag to regiser a handler for. When
registering a namespaced tag, the full name, along with a prefixing
slash MUST be provided.
@para... | [
"Registers",
"a",
"handler",
"for",
"tags",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L163-L182 |
34,389 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.setName | public function setName($name)
{
if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
throw new \InvalidArgumentException(
'Invalid tag name supplied: ' . $name
);
}
$this->tag = $name;
return $this;
} | php | public function setName($name)
{
if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
throw new \InvalidArgumentException(
'Invalid tag name supplied: ' . $name
);
}
$this->tag = $name;
return $this;
} | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^'",
".",
"self",
"::",
"REGEX_TAGNAME",
".",
"'$/u'",
",",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Invalid ta... | Sets the name of this tag.
@param string $name The new name of this tag.
@return $this
@throws \InvalidArgumentException When an invalid tag name is provided. | [
"Sets",
"the",
"name",
"of",
"this",
"tag",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L223-L234 |
34,390 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.getContent | public function getContent()
{
if (null === $this->content) {
$this->content = $this->description;
}
return $this->content;
} | php | public function getContent()
{
if (null === $this->content) {
$this->content = $this->description;
}
return $this->content;
} | [
"public",
"function",
"getContent",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"content",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"$",
"this",
"->",
"description",
";",
"}",
"return",
"$",
"this",
"->",
"content",
";",
"}"
] | Gets the content of this tag.
@return string | [
"Gets",
"the",
"content",
"of",
"this",
"tag",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L241-L248 |
34,391 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.setDescription | public function setDescription($description)
{
$this->content = null;
$this->parsedDescription = null;
$this->description = trim($description);
return $this;
} | php | public function setDescription($description)
{
$this->content = null;
$this->parsedDescription = null;
$this->description = trim($description);
return $this;
} | [
"public",
"function",
"setDescription",
"(",
"$",
"description",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"null",
";",
"$",
"this",
"->",
"parsedDescription",
"=",
"null",
";",
"$",
"this",
"->",
"description",
"=",
"trim",
"(",
"$",
"description",
"... | Sets the description component of this tag.
@param string $description The new description component of this tag.
@return $this | [
"Sets",
"the",
"description",
"component",
"of",
"this",
"tag",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L282-L289 |
34,392 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag.php | Tag.getParsedDescription | public function getParsedDescription()
{
if (null === $this->parsedDescription) {
$description = new Description($this->description, $this->docblock);
$this->parsedDescription = $description->getParsedContents();
}
return $this->parsedDescription;
} | php | public function getParsedDescription()
{
if (null === $this->parsedDescription) {
$description = new Description($this->description, $this->docblock);
$this->parsedDescription = $description->getParsedContents();
}
return $this->parsedDescription;
} | [
"public",
"function",
"getParsedDescription",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"parsedDescription",
")",
"{",
"$",
"description",
"=",
"new",
"Description",
"(",
"$",
"this",
"->",
"description",
",",
"$",
"this",
"->",
"docblock... | Gets the parsed text of this description.
@return array An array of strings and tag objects, in the order they
occur within the description. | [
"Gets",
"the",
"parsed",
"text",
"of",
"this",
"description",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag.php#L297-L304 |
34,393 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/ReturnTag.php | ReturnTag.getTypesCollection | protected function getTypesCollection()
{
if (null === $this->types) {
$this->types = new Collection(
array($this->type),
$this->docblock ? $this->docblock->getContext() : null
);
}
return $this->types;
} | php | protected function getTypesCollection()
{
if (null === $this->types) {
$this->types = new Collection(
array($this->type),
$this->docblock ? $this->docblock->getContext() : null
);
}
return $this->types;
} | [
"protected",
"function",
"getTypesCollection",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"types",
")",
"{",
"$",
"this",
"->",
"types",
"=",
"new",
"Collection",
"(",
"array",
"(",
"$",
"this",
"->",
"type",
")",
",",
"$",
"this",
... | Returns the type collection.
@return void | [
"Returns",
"the",
"type",
"collection",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/ReturnTag.php#L89-L98 |
34,394 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/AuthorTag.php | AuthorTag.setAuthorName | public function setAuthorName($authorName)
{
$this->content = null;
$this->authorName
= preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName)
? $authorName : '';
return $this;
} | php | public function setAuthorName($authorName)
{
$this->content = null;
$this->authorName
= preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName)
? $authorName : '';
return $this;
} | [
"public",
"function",
"setAuthorName",
"(",
"$",
"authorName",
")",
"{",
"$",
"this",
"->",
"content",
"=",
"null",
";",
"$",
"this",
"->",
"authorName",
"=",
"preg_match",
"(",
"'/^'",
".",
"self",
"::",
"REGEX_AUTHOR_NAME",
".",
"'$/u'",
",",
"$",
"aut... | Sets the author's name.
@param string $authorName The new author name.
An invalid value will set an empty string.
@return $this | [
"Sets",
"the",
"author",
"s",
"name",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/AuthorTag.php#L94-L102 |
34,395 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/AuthorTag.php | AuthorTag.setAuthorEmail | public function setAuthorEmail($authorEmail)
{
$this->authorEmail
= preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail)
? $authorEmail : '';
$this->content = null;
return $this;
} | php | public function setAuthorEmail($authorEmail)
{
$this->authorEmail
= preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail)
? $authorEmail : '';
$this->content = null;
return $this;
} | [
"public",
"function",
"setAuthorEmail",
"(",
"$",
"authorEmail",
")",
"{",
"$",
"this",
"->",
"authorEmail",
"=",
"preg_match",
"(",
"'/^'",
".",
"self",
"::",
"REGEX_AUTHOR_EMAIL",
".",
"'$/u'",
",",
"$",
"authorEmail",
")",
"?",
"$",
"authorEmail",
":",
... | Sets the author's email.
@param string $authorEmail The new author email.
An invalid value will set an empty string.
@return $this | [
"Sets",
"the",
"author",
"s",
"email",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/AuthorTag.php#L122-L130 |
34,396 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/VersionTag.php | VersionTag.setVersion | public function setVersion($version)
{
$this->version
= preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
? $version
: '';
$this->content = null;
return $this;
} | php | public function setVersion($version)
{
$this->version
= preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
? $version
: '';
$this->content = null;
return $this;
} | [
"public",
"function",
"setVersion",
"(",
"$",
"version",
")",
"{",
"$",
"this",
"->",
"version",
"=",
"preg_match",
"(",
"'/^'",
".",
"self",
"::",
"REGEX_VECTOR",
".",
"'$/ux'",
",",
"$",
"version",
")",
"?",
"$",
"version",
":",
"''",
";",
"$",
"th... | Sets the version section of the tag.
@param string $version The new version section of the tag.
An invalid value will set an empty string.
@return $this | [
"Sets",
"the",
"version",
"section",
"of",
"the",
"tag",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/VersionTag.php#L98-L107 |
34,397 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/MethodTag.php | MethodTag.getArguments | public function getArguments()
{
if (empty($this->arguments)) {
return array();
}
$arguments = explode(',', $this->arguments);
foreach ($arguments as $key => $value) {
$arguments[$key] = explode(' ', trim($value));
}
return $arguments;
} | php | public function getArguments()
{
if (empty($this->arguments)) {
return array();
}
$arguments = explode(',', $this->arguments);
foreach ($arguments as $key => $value) {
$arguments[$key] = explode(' ', trim($value));
}
return $arguments;
} | [
"public",
"function",
"getArguments",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"arguments",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"arguments",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"arguments",
"... | Returns an array containing each argument as array of type and name.
Please note that the argument sub-array may only contain 1 element if no
type was specified.
@return string[] | [
"Returns",
"an",
"array",
"containing",
"each",
"argument",
"as",
"array",
"of",
"type",
"and",
"name",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/MethodTag.php#L170-L182 |
34,398 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/ExampleTag.php | ExampleTag.setFilePath | public function setFilePath($filePath)
{
$this->isURI = false;
$this->filePath = trim($filePath);
$this->content = null;
return $this;
} | php | public function setFilePath($filePath)
{
$this->isURI = false;
$this->filePath = trim($filePath);
$this->content = null;
return $this;
} | [
"public",
"function",
"setFilePath",
"(",
"$",
"filePath",
")",
"{",
"$",
"this",
"->",
"isURI",
"=",
"false",
";",
"$",
"this",
"->",
"filePath",
"=",
"trim",
"(",
"$",
"filePath",
")",
";",
"$",
"this",
"->",
"content",
"=",
"null",
";",
"return",
... | Sets the file path.
@param string $filePath The new file path to use for the example.
@return $this | [
"Sets",
"the",
"file",
"path",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/ExampleTag.php#L121-L128 |
34,399 | mpociot/reflection-docblock | src/Mpociot/Reflection/DocBlock/Tag/ExampleTag.php | ExampleTag.setFileURI | public function setFileURI($uri)
{
$this->isURI = true;
if (false === strpos($uri, ':')) {
//Relative URL
$this->filePath = rawurldecode(
str_replace(array('/', '\\'), '%2F', $uri)
);
} else {
//Absolute URL or URI.
... | php | public function setFileURI($uri)
{
$this->isURI = true;
if (false === strpos($uri, ':')) {
//Relative URL
$this->filePath = rawurldecode(
str_replace(array('/', '\\'), '%2F', $uri)
);
} else {
//Absolute URL or URI.
... | [
"public",
"function",
"setFileURI",
"(",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"isURI",
"=",
"true",
";",
"if",
"(",
"false",
"===",
"strpos",
"(",
"$",
"uri",
",",
"':'",
")",
")",
"{",
"//Relative URL",
"$",
"this",
"->",
"filePath",
"=",
"raw... | Sets the file path as an URI.
This function is equivalent to {@link setFilePath()}, except that it
convers an URI to a file path before that.
There is no getFileURI(), as {@link getFilePath()} is compatible.
@param type $uri The new file URI to use as an example. | [
"Sets",
"the",
"file",
"path",
"as",
"an",
"URI",
"."
] | c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587 | https://github.com/mpociot/reflection-docblock/blob/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587/src/Mpociot/Reflection/DocBlock/Tag/ExampleTag.php#L140-L155 |
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.