repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
danielgp/common-lib | source/CommonCode.php | CommonCode.sendBackgroundEncodedFormElementsByPost | protected function sendBackgroundEncodedFormElementsByPost($urlToSendTo, $params = [])
{
$postingUrl = filter_var($urlToSendTo, FILTER_VALIDATE_URL);
if ($postingUrl === false) {
throw new \Exception('Invalid URL in ' . __FUNCTION__);
}
if ($params !== []) {
$... | php | protected function sendBackgroundEncodedFormElementsByPost($urlToSendTo, $params = [])
{
$postingUrl = filter_var($urlToSendTo, FILTER_VALIDATE_URL);
if ($postingUrl === false) {
throw new \Exception('Invalid URL in ' . __FUNCTION__);
}
if ($params !== []) {
$... | [
"protected",
"function",
"sendBackgroundEncodedFormElementsByPost",
"(",
"$",
"urlToSendTo",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"postingUrl",
"=",
"filter_var",
"(",
"$",
"urlToSendTo",
",",
"FILTER_VALIDATE_URL",
")",
";",
"if",
"(",
"$",
"post... | Send an array of parameters like a form through a POST action
@param string $urlToSendTo
@param array $params
@throws \Exception | [
"Send",
"an",
"array",
"of",
"parameters",
"like",
"a",
"form",
"through",
"a",
"POST",
"action"
] | train | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L204-L216 |
danielgp/common-lib | source/CommonCode.php | CommonCode.setJsonToArray | public function setJsonToArray($inputJson)
{
if (!$this->isJsonByDanielGP($inputJson)) {
return ['error' => $this->lclMsgCmn('i18n_Error_GivenInputIsNotJson')];
}
$sReturn = (json_decode($inputJson, true));
$jsonError = $this->setJsonErrorInPlainEnglish();
if ($... | php | public function setJsonToArray($inputJson)
{
if (!$this->isJsonByDanielGP($inputJson)) {
return ['error' => $this->lclMsgCmn('i18n_Error_GivenInputIsNotJson')];
}
$sReturn = (json_decode($inputJson, true));
$jsonError = $this->setJsonErrorInPlainEnglish();
if ($... | [
"public",
"function",
"setJsonToArray",
"(",
"$",
"inputJson",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isJsonByDanielGP",
"(",
"$",
"inputJson",
")",
")",
"{",
"return",
"[",
"'error'",
"=>",
"$",
"this",
"->",
"lclMsgCmn",
"(",
"'i18n_Error_GivenInp... | Converts a JSON string into an Array
@param string $inputJson
@return array | [
"Converts",
"a",
"JSON",
"string",
"into",
"an",
"Array"
] | train | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonCode.php#L254-L265 |
Finesse/QueryScribe | src/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileUpdate | public function compileUpdate(Query $query): StatementInterface
{
if ($query->tableAlias !== null) {
throw new InvalidQueryException('Table alias is not allowed in update query');
}
return parent::compileUpdate($query);
} | php | public function compileUpdate(Query $query): StatementInterface
{
if ($query->tableAlias !== null) {
throw new InvalidQueryException('Table alias is not allowed in update query');
}
return parent::compileUpdate($query);
} | [
"public",
"function",
"compileUpdate",
"(",
"Query",
"$",
"query",
")",
":",
"StatementInterface",
"{",
"if",
"(",
"$",
"query",
"->",
"tableAlias",
"!==",
"null",
")",
"{",
"throw",
"new",
"InvalidQueryException",
"(",
"'Table alias is not allowed in update query'"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/SQLiteGrammar.php#L20-L27 |
Finesse/QueryScribe | src/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileDelete | public function compileDelete(Query $query): StatementInterface
{
if ($query->tableAlias !== null) {
throw new InvalidQueryException('Table alias is not allowed in delete query');
}
return parent::compileDelete($query);
} | php | public function compileDelete(Query $query): StatementInterface
{
if ($query->tableAlias !== null) {
throw new InvalidQueryException('Table alias is not allowed in delete query');
}
return parent::compileDelete($query);
} | [
"public",
"function",
"compileDelete",
"(",
"Query",
"$",
"query",
")",
":",
"StatementInterface",
"{",
"if",
"(",
"$",
"query",
"->",
"tableAlias",
"!==",
"null",
")",
"{",
"throw",
"new",
"InvalidQueryException",
"(",
"'Table alias is not allowed in delete query'"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/SQLiteGrammar.php#L32-L39 |
Finesse/QueryScribe | src/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileEmptyInCriterion | protected function compileEmptyInCriterion(InCriterion $criterion, array &$bindings): string
{
return sprintf(
'%s %sIN ()',
$this->compileIdentifier($criterion->column, $bindings),
$criterion->not ? 'NOT ' : ''
);
} | php | protected function compileEmptyInCriterion(InCriterion $criterion, array &$bindings): string
{
return sprintf(
'%s %sIN ()',
$this->compileIdentifier($criterion->column, $bindings),
$criterion->not ? 'NOT ' : ''
);
} | [
"protected",
"function",
"compileEmptyInCriterion",
"(",
"InCriterion",
"$",
"criterion",
",",
"array",
"&",
"$",
"bindings",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'%s %sIN ()'",
",",
"$",
"this",
"->",
"compileIdentifier",
"(",
"$",
"criterion",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/SQLiteGrammar.php#L44-L51 |
Finesse/QueryScribe | src/Grammars/SQLiteGrammar.php | SQLiteGrammar.compileInsertFromValues | protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array
{
$statements = [];
foreach ($values as $row) {
foreach (parent::compileInsertFromValues($table, $tableAlias, [$row]) as $statement) {
$statements[] = $statement;
... | php | protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array
{
$statements = [];
foreach ($values as $row) {
foreach (parent::compileInsertFromValues($table, $tableAlias, [$row]) as $statement) {
$statements[] = $statement;
... | [
"protected",
"function",
"compileInsertFromValues",
"(",
"$",
"table",
",",
"string",
"$",
"tableAlias",
"=",
"null",
",",
"array",
"$",
"values",
")",
":",
"array",
"{",
"$",
"statements",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Finesse/QueryScribe/blob/4edba721e37693780d142229b3ecb0cd4004c7a5/src/Grammars/SQLiteGrammar.php#L56-L67 |
Dhii/factory-base | src/SubjectConfigAwareTrait.php | SubjectConfigAwareTrait._setSubjectConfig | protected function _setSubjectConfig($subjectConfig)
{
if ($subjectConfig === null || $subjectConfig = $this->_normalizeContainer($subjectConfig)) {
$this->subjectConfig = $subjectConfig;
}
} | php | protected function _setSubjectConfig($subjectConfig)
{
if ($subjectConfig === null || $subjectConfig = $this->_normalizeContainer($subjectConfig)) {
$this->subjectConfig = $subjectConfig;
}
} | [
"protected",
"function",
"_setSubjectConfig",
"(",
"$",
"subjectConfig",
")",
"{",
"if",
"(",
"$",
"subjectConfig",
"===",
"null",
"||",
"$",
"subjectConfig",
"=",
"$",
"this",
"->",
"_normalizeContainer",
"(",
"$",
"subjectConfig",
")",
")",
"{",
"$",
"this... | Sets the subject factory configuration for this instance.
@since [*next-version*]
@param array|ArrayAccess|ContainerInterface|stdClass|null $subjectConfig The subject factory config, if any.
@throws InvalidArgumentException If the argument is not a valid container. | [
"Sets",
"the",
"subject",
"factory",
"configuration",
"for",
"this",
"instance",
"."
] | train | https://github.com/Dhii/factory-base/blob/eb6694178068ec58e0f2de9243f0eb98844511de/src/SubjectConfigAwareTrait.php#L47-L52 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.setExpressionVisitor | public function setExpressionVisitor(\Aztech\Skwal\Visitor\Printer\Expression $visitor)
{
$this->expressionVisitor = $visitor;
} | php | public function setExpressionVisitor(\Aztech\Skwal\Visitor\Printer\Expression $visitor)
{
$this->expressionVisitor = $visitor;
} | [
"public",
"function",
"setExpressionVisitor",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Expression",
"$",
"visitor",
")",
"{",
"$",
"this",
"->",
"expressionVisitor",
"=",
"$",
"visitor",
";",
"}"
] | Sets the visitor instance for used to output expressions.
@param \Aztech\Skwal\Visitor\Printer\Expression $visitor
@codeCoverageIgnore Cannot be tested as there are no getters | [
"Sets",
"the",
"visitor",
"instance",
"for",
"used",
"to",
"output",
"expressions",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L57-L60 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.setTableReferenceVisitor | public function setTableReferenceVisitor(\Aztech\Skwal\Visitor\Printer\TableReference $visitor)
{
$this->tableReferenceVisitor = $visitor;
} | php | public function setTableReferenceVisitor(\Aztech\Skwal\Visitor\Printer\TableReference $visitor)
{
$this->tableReferenceVisitor = $visitor;
} | [
"public",
"function",
"setTableReferenceVisitor",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"TableReference",
"$",
"visitor",
")",
"{",
"$",
"this",
"->",
"tableReferenceVisitor",
"=",
"$",
"visitor",
";",
"}"
] | Sets the visitor instance for used to output correlated references.
@param \Aztech\Skwal\Visitor\Printer\TableReference $visitor
@codeCoverageIgnore Cannot be tested as there are no getters | [
"Sets",
"the",
"visitor",
"instance",
"for",
"used",
"to",
"output",
"correlated",
"references",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L68-L71 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.setPredicateVisitor | public function setPredicateVisitor(\Aztech\Skwal\Visitor\Printer\Predicate $visitor)
{
$this->predicateVisitor = $visitor;
} | php | public function setPredicateVisitor(\Aztech\Skwal\Visitor\Printer\Predicate $visitor)
{
$this->predicateVisitor = $visitor;
} | [
"public",
"function",
"setPredicateVisitor",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Predicate",
"$",
"visitor",
")",
"{",
"$",
"this",
"->",
"predicateVisitor",
"=",
"$",
"visitor",
";",
"}"
] | Sets the visitor instance for used to output predicates.
@param \Aztech\Skwal\Visitor\Printer\Predicate $visitor
@codeCoverageIgnore | [
"Sets",
"the",
"visitor",
"instance",
"for",
"used",
"to",
"output",
"predicates",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L79-L82 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.printQuery | public function printQuery(\Aztech\Skwal\Query $query)
{
$this->visit($query);
return $this->queryStack->pop();
} | php | public function printQuery(\Aztech\Skwal\Query $query)
{
$this->visit($query);
return $this->queryStack->pop();
} | [
"public",
"function",
"printQuery",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"visit",
"(",
"$",
"query",
")",
";",
"return",
"$",
"this",
"->",
"queryStack",
"->",
"pop",
"(",
")",
";",
"}"
] | Generates the SQL command for a given query.
@param \Aztech\Skwal\Query $query
@return mixed | [
"Generates",
"the",
"SQL",
"command",
"for",
"a",
"given",
"query",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L130-L135 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.visitSelect | public function visitSelect(\Aztech\Skwal\Query\Select $query)
{
$assembler = new \Aztech\Skwal\Visitor\Printer\Assembler\Select();
$this->appendSelectList($assembler, $query);
$this->appendFromClause($assembler, $query);
$this->appendWhereClauseIfNecessary($assembler, $quer... | php | public function visitSelect(\Aztech\Skwal\Query\Select $query)
{
$assembler = new \Aztech\Skwal\Visitor\Printer\Assembler\Select();
$this->appendSelectList($assembler, $query);
$this->appendFromClause($assembler, $query);
$this->appendWhereClauseIfNecessary($assembler, $quer... | [
"public",
"function",
"visitSelect",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
")",
"{",
"$",
"assembler",
"=",
"new",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Selec... | (non-PHPdoc)
@see \Aztech\Skwal\Visitor\Query::visitSelect() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L152-L163 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.appendSelectList | private function appendSelectList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(true);
$selectList = array();
foreach ($query->getColumns() as $column) {
$selectList[] = $this-... | php | private function appendSelectList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(true);
$selectList = array();
foreach ($query->getColumns() as $column) {
$selectList[] = $this-... | [
"private",
"function",
"appendSelectList",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Select",
"$",
"assembler",
",",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
")",
"{",... | Adds the select list elements of a query to a query assembler.
@param \Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler
@param \Aztech\Skwal\Query\Select $query | [
"Adds",
"the",
"select",
"list",
"elements",
"of",
"a",
"query",
"to",
"a",
"query",
"assembler",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L171-L182 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.appendFromClause | private function appendFromClause(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$fromStatement = $this->tableReferenceVisitor->printTableStatement($query->getTable());
$assembler->setFromClause($fromStatement);
} | php | private function appendFromClause(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$fromStatement = $this->tableReferenceVisitor->printTableStatement($query->getTable());
$assembler->setFromClause($fromStatement);
} | [
"private",
"function",
"appendFromClause",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Select",
"$",
"assembler",
",",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
")",
"{",... | Adds the from clause of a query to a query assembler.
@param \Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler
@param \Aztech\Skwal\Query\Select $query | [
"Adds",
"the",
"from",
"clause",
"of",
"a",
"query",
"to",
"a",
"query",
"assembler",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L190-L194 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.appendWhereClauseIfNecessary | private function appendWhereClauseIfNecessary(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
if ($query->getCondition() != null) {
$whereClause = $this->predicateVisitor->printPredicateStatement($query->getCondition());
$assembler->setW... | php | private function appendWhereClauseIfNecessary(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
if ($query->getCondition() != null) {
$whereClause = $this->predicateVisitor->printPredicateStatement($query->getCondition());
$assembler->setW... | [
"private",
"function",
"appendWhereClauseIfNecessary",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Select",
"$",
"assembler",
",",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
... | Adds the where clause of a query to a query assembler if the given query has a selection condition.
@param \Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler
@param \Aztech\Skwal\Query\Select $query | [
"Adds",
"the",
"where",
"clause",
"of",
"a",
"query",
"to",
"a",
"query",
"assembler",
"if",
"the",
"given",
"query",
"has",
"a",
"selection",
"condition",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L202-L208 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.appendGroupByList | private function appendGroupByList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(false);
$groupByList = array();
foreach ($query->getGroupingColumns() as $groupingColumn) {
$gr... | php | private function appendGroupByList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(false);
$groupByList = array();
foreach ($query->getGroupingColumns() as $groupingColumn) {
$gr... | [
"private",
"function",
"appendGroupByList",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Select",
"$",
"assembler",
",",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
")",
"{"... | Adds the group by list from a query to a query assembler.
@param \Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler
@param \Aztech\Skwal\Query\Select $query | [
"Adds",
"the",
"group",
"by",
"list",
"from",
"a",
"query",
"to",
"a",
"query",
"assembler",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L216-L227 |
aztech-labs/skwal | src/Visitor/Printer/Query.php | Query.appendOrderByList | private function appendOrderByList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(false);
$orderByList = array();
foreach ($query->getSortingColumns() as $sortingColumn) {
$dire... | php | private function appendOrderByList(\Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler,\Aztech\Skwal\Query\Select $query)
{
$this->expressionVisitor->useAliases(false);
$orderByList = array();
foreach ($query->getSortingColumns() as $sortingColumn) {
$dire... | [
"private",
"function",
"appendOrderByList",
"(",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Visitor",
"\\",
"Printer",
"\\",
"Assembler",
"\\",
"Select",
"$",
"assembler",
",",
"\\",
"Aztech",
"\\",
"Skwal",
"\\",
"Query",
"\\",
"Select",
"$",
"query",
")",
"{"... | Adds the sort expressions from a query to a query assembler.
@param \Aztech\Skwal\Visitor\Printer\Assembler\Select $assembler
@param \Aztech\Skwal\Query\Select $query | [
"Adds",
"the",
"sort",
"expressions",
"from",
"a",
"query",
"to",
"a",
"query",
"assembler",
"."
] | train | https://github.com/aztech-labs/skwal/blob/cf637c5ddb69f6579ba28a61af9c39639081dc16/src/Visitor/Printer/Query.php#L235-L247 |
erenmustafaozdal/laravel-modules-base | src/Middlewares/RelatedModel.php | RelatedModel.handle | public function handle($request, Closure $next, $model, $relation)
{
$model = 'App\\' . $model;
$params = array_values( $request->route()->parameters() );
// eğer ikinci yoksa dön
if ( ! isset($params[1])) {
return $next($request);
}
$model = is_numeric($... | php | public function handle($request, Closure $next, $model, $relation)
{
$model = 'App\\' . $model;
$params = array_values( $request->route()->parameters() );
// eğer ikinci yoksa dön
if ( ! isset($params[1])) {
return $next($request);
}
$model = is_numeric($... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
",",
"$",
"model",
",",
"$",
"relation",
")",
"{",
"$",
"model",
"=",
"'App\\\\'",
".",
"$",
"model",
";",
"$",
"params",
"=",
"array_values",
"(",
"$",
"request",
"->"... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@param string $model
@param string $relation
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Middlewares/RelatedModel.php#L20-L46 |
cmsgears/module-community | common/actions/follower/Follow.php | Follow.run | public function run() {
if( isset( $this->model ) ) {
$followerService = Yii::$app->factory->get( 'followerService' );
$user = Yii::$app->core->getUser();
$model = $this->model;
$follower = $followerService->updateByParams([
'modelId' => $user->id, 'parentId' => $model->id,
'parentType' => $t... | php | public function run() {
if( isset( $this->model ) ) {
$followerService = Yii::$app->factory->get( 'followerService' );
$user = Yii::$app->core->getUser();
$model = $this->model;
$follower = $followerService->updateByParams([
'modelId' => $user->id, 'parentId' => $model->id,
'parentType' => $t... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"model",
")",
")",
"{",
"$",
"followerService",
"=",
"Yii",
"::",
"$",
"app",
"->",
"factory",
"->",
"get",
"(",
"'followerService'",
")",
";",
"$",
"user",
"="... | Follow -------------------------------- | [
"Follow",
"--------------------------------"
] | train | https://github.com/cmsgears/module-community/blob/0ca9cf0aa0cee395a4788bd6085f291e10728555/common/actions/follower/Follow.php#L57-L78 |
PenoaksDev/Milky-Framework | src/Milky/Queue/Listener.php | Listener.buildWorkerCommand | protected function buildWorkerCommand()
{
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
if (defined('HHVM_VERSION')) {
$binary .= ' --php';
}
if (defined('ARTISAN_BINARY')) {
$artisan = ProcessUtils::escapeArgument(ARTISAN_BINARY);
} else {
$artisan = 'artisan';
... | php | protected function buildWorkerCommand()
{
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
if (defined('HHVM_VERSION')) {
$binary .= ' --php';
}
if (defined('ARTISAN_BINARY')) {
$artisan = ProcessUtils::escapeArgument(ARTISAN_BINARY);
} else {
$artisan = 'artisan';
... | [
"protected",
"function",
"buildWorkerCommand",
"(",
")",
"{",
"$",
"binary",
"=",
"ProcessUtils",
"::",
"escapeArgument",
"(",
"(",
"new",
"PhpExecutableFinder",
")",
"->",
"find",
"(",
"false",
")",
")",
";",
"if",
"(",
"defined",
"(",
"'HHVM_VERSION'",
")"... | Build the environment specific worker command.
@return string | [
"Build",
"the",
"environment",
"specific",
"worker",
"command",
"."
] | train | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Queue/Listener.php#L69-L86 |
AnonymPHP/Anonym-HttpFoundation | Redirect.php | Redirect.route | public function route($name = ''){
$routes = AsCollector::getAs();
if (isset($routes[$name])) {
$this->to($routes[$name]);
}else{
throw new RouteNotFoundException(sprintf('%s Route Not Found'));
}
} | php | public function route($name = ''){
$routes = AsCollector::getAs();
if (isset($routes[$name])) {
$this->to($routes[$name]);
}else{
throw new RouteNotFoundException(sprintf('%s Route Not Found'));
}
} | [
"public",
"function",
"route",
"(",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"routes",
"=",
"AsCollector",
"::",
"getAs",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"routes",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"to",
"(",
... | redirect to a route
@param string $name
@throws RouteNotFoundException | [
"redirect",
"to",
"a",
"route"
] | train | https://github.com/AnonymPHP/Anonym-HttpFoundation/blob/943e5f40f45bc2e11a4b9e1d22c6583c31dc4317/Redirect.php#L52-L60 |
WellCommerce/CartBundle | Repository/CartProductRepository.php | CartProductRepository.getDataSetQueryBuilder | public function getDataSetQueryBuilder() : QueryBuilder
{
$queryBuilder = $this->getQueryBuilder();
$queryBuilder->groupBy('cart_product.id');
$queryBuilder->leftJoin('cart_product.product', 'product');
$queryBuilder->leftJoin('cart_product.variant', 'product_variant');
$quer... | php | public function getDataSetQueryBuilder() : QueryBuilder
{
$queryBuilder = $this->getQueryBuilder();
$queryBuilder->groupBy('cart_product.id');
$queryBuilder->leftJoin('cart_product.product', 'product');
$queryBuilder->leftJoin('cart_product.variant', 'product_variant');
$quer... | [
"public",
"function",
"getDataSetQueryBuilder",
"(",
")",
":",
"QueryBuilder",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
";",
"$",
"queryBuilder",
"->",
"groupBy",
"(",
"'cart_product.id'",
")",
";",
"$",
"queryBuilder",
"-... | {@inheritdoc} | [
"{"
] | train | https://github.com/WellCommerce/CartBundle/blob/77c1e12b36bde008dca61260481b21135e339396/Repository/CartProductRepository.php#L29-L43 |
prolic/HumusMvc | src/HumusMvc/View/View.php | View.setHelperPluginManager | public function setHelperPluginManager($helpers)
{
if (is_string($helpers)) {
if (!class_exists($helpers)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid helper helpers class provided (%s)',
$helpers
));
... | php | public function setHelperPluginManager($helpers)
{
if (is_string($helpers)) {
if (!class_exists($helpers)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid helper helpers class provided (%s)',
$helpers
));
... | [
"public",
"function",
"setHelperPluginManager",
"(",
"$",
"helpers",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"helpers",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"helpers",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgu... | Set helper plugin manager instance
@param string|HelperPluginManager $helpers
@return View
@throws Exception\InvalidArgumentException | [
"Set",
"helper",
"plugin",
"manager",
"instance"
] | train | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/View/View.php#L56-L77 |
Innmind/Compose | src/Definition/Service/Argument/Reference.php | Reference.resolve | public function resolve(
StreamInterface $built,
Services $services
): StreamInterface {
try {
return $built->add(
$services->arguments()->get($this->name)
);
} catch (ArgumentNotProvided $e) {
if ($e->argument()->hasDefault()) {
... | php | public function resolve(
StreamInterface $built,
Services $services
): StreamInterface {
try {
return $built->add(
$services->arguments()->get($this->name)
);
} catch (ArgumentNotProvided $e) {
if ($e->argument()->hasDefault()) {
... | [
"public",
"function",
"resolve",
"(",
"StreamInterface",
"$",
"built",
",",
"Services",
"$",
"services",
")",
":",
"StreamInterface",
"{",
"try",
"{",
"return",
"$",
"built",
"->",
"add",
"(",
"$",
"services",
"->",
"arguments",
"(",
")",
"->",
"get",
"(... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/Compose/blob/1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9/src/Definition/Service/Argument/Reference.php#L56-L90 |
phossa/phossa-db | src/Phossa/Db/Pdo/Driver.php | Driver.realConnect | protected function realConnect(array $parameters)
{
$this->link = new \PDO(
$parameters['dsn'],
isset($parameters['username']) ? $parameters['username'] : 'root',
isset($parameters['password']) ? $parameters['password'] : null,
isset($parameters['options... | php | protected function realConnect(array $parameters)
{
$this->link = new \PDO(
$parameters['dsn'],
isset($parameters['username']) ? $parameters['username'] : 'root',
isset($parameters['password']) ? $parameters['password'] : null,
isset($parameters['options... | [
"protected",
"function",
"realConnect",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"link",
"=",
"new",
"\\",
"PDO",
"(",
"$",
"parameters",
"[",
"'dsn'",
"]",
",",
"isset",
"(",
"$",
"parameters",
"[",
"'username'",
"]",
")",
"?",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa/phossa-db/blob/9ef2c0e0c3047f4ff2ce6b0a218187025ac64d29/src/Phossa/Db/Pdo/Driver.php#L133-L150 |
phossa/phossa-db | src/Phossa/Db/Pdo/Driver.php | Driver.realSetAttribute | protected function realSetAttribute(/*# string */ $attribute, $value)
{
if (is_string($attribute)) {
if (defined($attribute)) {
$this->link->setAttribute(constant($attribute), $value);
} else {
throw new LogicException(
Messa... | php | protected function realSetAttribute(/*# string */ $attribute, $value)
{
if (is_string($attribute)) {
if (defined($attribute)) {
$this->link->setAttribute(constant($attribute), $value);
} else {
throw new LogicException(
Messa... | [
"protected",
"function",
"realSetAttribute",
"(",
"/*# string */",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"attribute",
")",
")",
"{",
"if",
"(",
"defined",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"this",
"->... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa/phossa-db/blob/9ef2c0e0c3047f4ff2ce6b0a218187025ac64d29/src/Phossa/Db/Pdo/Driver.php#L177-L192 |
phossa/phossa-db | src/Phossa/Db/Pdo/Driver.php | Driver.realGetAttribute | protected function realGetAttribute(/*# string */ $attribute)
{
if (is_string($attribute)) {
if (defined($attribute)) {
return $this->link->getAttribute(constant($attribute));
} else {
throw new LogicException(
Message::get(M... | php | protected function realGetAttribute(/*# string */ $attribute)
{
if (is_string($attribute)) {
if (defined($attribute)) {
return $this->link->getAttribute(constant($attribute));
} else {
throw new LogicException(
Message::get(M... | [
"protected",
"function",
"realGetAttribute",
"(",
"/*# string */",
"$",
"attribute",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"attribute",
")",
")",
"{",
"if",
"(",
"defined",
"(",
"$",
"attribute",
")",
")",
"{",
"return",
"$",
"this",
"->",
"link",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa/phossa-db/blob/9ef2c0e0c3047f4ff2ce6b0a218187025ac64d29/src/Phossa/Db/Pdo/Driver.php#L197-L211 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.findAvailableByStockItemAndLocation | public function findAvailableByStockItemAndLocation(StockItemInterface $item,
Location $location, ?BatchInterface $batch = null, array $orderBy = []): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, $location, LocationType::INTERNAL);
$this->filterByAvaila... | php | public function findAvailableByStockItemAndLocation(StockItemInterface $item,
Location $location, ?BatchInterface $batch = null, array $orderBy = []): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, $location, LocationType::INTERNAL);
$this->filterByAvaila... | [
"public",
"function",
"findAvailableByStockItemAndLocation",
"(",
"StockItemInterface",
"$",
"item",
",",
"Location",
"$",
"location",
",",
"?",
"BatchInterface",
"$",
"batch",
"=",
"null",
",",
"array",
"$",
"orderBy",
"=",
"[",
"]",
")",
":",
"array",
"{",
... | @param StockItemInterface $item
@param BatchInterface|null $batch
@param array $orderBy
@return array|StockUnit[] | [
"@param",
"StockItemInterface",
"$item",
"@param",
"BatchInterface|null",
"$batch",
"@param",
"array",
"$orderBy"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L68-L78 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.findReservedByStockItem | public function findReservedByStockItem(StockItemInterface $item,
?BatchInterface $batch = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, null, LocationType::INTERNAL);
$this->filterByUnavailability($qb);
$this->filterByStockItem($qb, $item... | php | public function findReservedByStockItem(StockItemInterface $item,
?BatchInterface $batch = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, null, LocationType::INTERNAL);
$this->filterByUnavailability($qb);
$this->filterByStockItem($qb, $item... | [
"public",
"function",
"findReservedByStockItem",
"(",
"StockItemInterface",
"$",
"item",
",",
"?",
"BatchInterface",
"$",
"batch",
"=",
"null",
")",
":",
"array",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'su'",
")",
";",
"$",
"th... | @param StockItemInterface $item
@return array|StockUnit[] | [
"@param",
"StockItemInterface",
"$item"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L102-L111 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.findReservedByMovement | public function findReservedByMovement(Movement $mvt): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, null, LocationType::INTERNAL);
$this->filterByMovement($qb, $mvt);
return $qb->getQuery()->getResult();
} | php | public function findReservedByMovement(Movement $mvt): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, null, LocationType::INTERNAL);
$this->filterByMovement($qb, $mvt);
return $qb->getQuery()->getResult();
} | [
"public",
"function",
"findReservedByMovement",
"(",
"Movement",
"$",
"mvt",
")",
":",
"array",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'su'",
")",
";",
"$",
"this",
"->",
"filterByLocation",
"(",
"$",
"qb",
",",
"null",
",",
... | @param Movement $mvt
@return array|StockUnit[] | [
"@param",
"Movement",
"$mvt"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L118-L125 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.findByLocation | public function findByLocation(Location $location, array $orderBy = [],
?int $limit = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, $location);
$this->addOrderBy($qb, $orderBy);
$this->addLimit($qb, $limit);
return $qb->getQuery()... | php | public function findByLocation(Location $location, array $orderBy = [],
?int $limit = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByLocation($qb, $location);
$this->addOrderBy($qb, $orderBy);
$this->addLimit($qb, $limit);
return $qb->getQuery()... | [
"public",
"function",
"findByLocation",
"(",
"Location",
"$",
"location",
",",
"array",
"$",
"orderBy",
"=",
"[",
"]",
",",
"?",
"int",
"$",
"limit",
"=",
"null",
")",
":",
"array",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"... | @param Location $location
@param array $orderBy
@return array | [
"@param",
"Location",
"$location",
"@param",
"array",
"$orderBy"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L148-L157 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.findByStockItemAndLocation | public function findByStockItemAndLocation(StockItemInterface $item,
Location $location, ?BatchInterface $batch = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByStockItem($qb, $item, $batch);
$this->filterByLocation($qb, $location);
return $qb->getQuery... | php | public function findByStockItemAndLocation(StockItemInterface $item,
Location $location, ?BatchInterface $batch = null): array
{
$qb = $this->createQueryBuilder('su');
$this->filterByStockItem($qb, $item, $batch);
$this->filterByLocation($qb, $location);
return $qb->getQuery... | [
"public",
"function",
"findByStockItemAndLocation",
"(",
"StockItemInterface",
"$",
"item",
",",
"Location",
"$",
"location",
",",
"?",
"BatchInterface",
"$",
"batch",
"=",
"null",
")",
":",
"array",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder"... | @param StockItemInterface $item
@param Location $location
@return array|StockUnit[] | [
"@param",
"StockItemInterface",
"$item",
"@param",
"Location",
"$location"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L165-L173 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.filterByLocation | private function filterByLocation(QueryBuilder $qb,
?Location $location = null, ?string $locationType = null,
array $excludedLocations = [])
{
if (null == $locationType && null == $location) {
return $qb;
}
$alias = $qb->getAllAliases()[0];
$qb
... | php | private function filterByLocation(QueryBuilder $qb,
?Location $location = null, ?string $locationType = null,
array $excludedLocations = [])
{
if (null == $locationType && null == $location) {
return $qb;
}
$alias = $qb->getAllAliases()[0];
$qb
... | [
"private",
"function",
"filterByLocation",
"(",
"QueryBuilder",
"$",
"qb",
",",
"?",
"Location",
"$",
"location",
"=",
"null",
",",
"?",
"string",
"$",
"locationType",
"=",
"null",
",",
"array",
"$",
"excludedLocations",
"=",
"[",
"]",
")",
"{",
"if",
"(... | @param QueryBuilder $qb
@param Location|null $location
@param LocationType|null $locationType
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb",
"@param",
"Location|null",
"$location",
"@param",
"LocationType|null",
"$locationType"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L182-L214 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.filterByAvailability | private function filterByAvailability(QueryBuilder $qb)
{
$alias = $qb->getAllAliases()[0];
$qb->andWhere($alias . '.reservationMovement IS NULL');
return $qb;
} | php | private function filterByAvailability(QueryBuilder $qb)
{
$alias = $qb->getAllAliases()[0];
$qb->andWhere($alias . '.reservationMovement IS NULL');
return $qb;
} | [
"private",
"function",
"filterByAvailability",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"$",
"alias",
"=",
"$",
"qb",
"->",
"getAllAliases",
"(",
")",
"[",
"0",
"]",
";",
"$",
"qb",
"->",
"andWhere",
"(",
"$",
"alias",
".",
"'.reservationMovement IS NULL'... | @param QueryBuilder $qb
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L221-L227 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.filterByUnavailability | private function filterByUnavailability(QueryBuilder $qb)
{
$alias = $qb->getAllAliases()[0];
$qb->andWhere($alias . '.reservationMovement IS NOT NULL');
return $qb;
} | php | private function filterByUnavailability(QueryBuilder $qb)
{
$alias = $qb->getAllAliases()[0];
$qb->andWhere($alias . '.reservationMovement IS NOT NULL');
return $qb;
} | [
"private",
"function",
"filterByUnavailability",
"(",
"QueryBuilder",
"$",
"qb",
")",
"{",
"$",
"alias",
"=",
"$",
"qb",
"->",
"getAllAliases",
"(",
")",
"[",
"0",
"]",
";",
"$",
"qb",
"->",
"andWhere",
"(",
"$",
"alias",
".",
"'.reservationMovement IS NOT... | @param QueryBuilder $qb
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L234-L240 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.filterByStockItem | private function filterByStockItem(QueryBuilder $qb, $item, $batch = null)
{
$alias = $qb->getAllAliases()[0];
$qb
->andWhere($alias . '.stockItem = :item')
->setParameter('item', $item);
if (null !== $batch) {
$qb
->andWhere($alias . '.ba... | php | private function filterByStockItem(QueryBuilder $qb, $item, $batch = null)
{
$alias = $qb->getAllAliases()[0];
$qb
->andWhere($alias . '.stockItem = :item')
->setParameter('item', $item);
if (null !== $batch) {
$qb
->andWhere($alias . '.ba... | [
"private",
"function",
"filterByStockItem",
"(",
"QueryBuilder",
"$",
"qb",
",",
"$",
"item",
",",
"$",
"batch",
"=",
"null",
")",
"{",
"$",
"alias",
"=",
"$",
"qb",
"->",
"getAllAliases",
"(",
")",
"[",
"0",
"]",
";",
"$",
"qb",
"->",
"andWhere",
... | @param QueryBuilder $qb
@param StockItemInterface $item
@param BatchInterface $batch
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb",
"@param",
"StockItemInterface",
"$item",
"@param",
"BatchInterface",
"$batch"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L249-L263 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.filterByMovement | private function filterByMovement(QueryBuilder $qb, Movement $mvt)
{
$alias = $qb->getAllAliases()[0];
$qb
->andWhere($alias . '.reservationMovement = :mvt')
->setParameter('mvt', $mvt);
return $qb;
} | php | private function filterByMovement(QueryBuilder $qb, Movement $mvt)
{
$alias = $qb->getAllAliases()[0];
$qb
->andWhere($alias . '.reservationMovement = :mvt')
->setParameter('mvt', $mvt);
return $qb;
} | [
"private",
"function",
"filterByMovement",
"(",
"QueryBuilder",
"$",
"qb",
",",
"Movement",
"$",
"mvt",
")",
"{",
"$",
"alias",
"=",
"$",
"qb",
"->",
"getAllAliases",
"(",
")",
"[",
"0",
"]",
";",
"$",
"qb",
"->",
"andWhere",
"(",
"$",
"alias",
".",
... | @param QueryBuilder $qb
@param Movement $mvt
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb",
"@param",
"Movement",
"$mvt"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L271-L279 |
sil-project/StockBundle | src/Doctrine/ORM/StockUnitRepository.php | StockUnitRepository.addOrderBy | private function addOrderBy(QueryBuilder $qb, array $orderBy = [])
{
if (count($orderBy)) {
$alias = $qb->getAllAliases()[0];
foreach ($orderBy as $sortCol => $order) {
$qb->orderBy($alias . '.' . $sortCol, $order);
}
}
return $qb;
} | php | private function addOrderBy(QueryBuilder $qb, array $orderBy = [])
{
if (count($orderBy)) {
$alias = $qb->getAllAliases()[0];
foreach ($orderBy as $sortCol => $order) {
$qb->orderBy($alias . '.' . $sortCol, $order);
}
}
return $qb;
} | [
"private",
"function",
"addOrderBy",
"(",
"QueryBuilder",
"$",
"qb",
",",
"array",
"$",
"orderBy",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"orderBy",
")",
")",
"{",
"$",
"alias",
"=",
"$",
"qb",
"->",
"getAllAliases",
"(",
")",
"[",
... | @param QueryBuilder $qb
@param array $orderBy
@return QueryBuilder | [
"@param",
"QueryBuilder",
"$qb",
"@param",
"array",
"$orderBy"
] | train | https://github.com/sil-project/StockBundle/blob/c1af70e000d56cd53e8ad0dedaed9841bd2ea8a8/src/Doctrine/ORM/StockUnitRepository.php#L287-L297 |
ommu/mod-banner | controllers/o/CategoryController.php | CategoryController.actionManage | public function actionManage()
{
$model=new BannerCategory('search');
$model->unsetAttributes(); // clear any default values
if(Yii::app()->getRequest()->getParam('BannerCategory')) {
$model->attributes=Yii::app()->getRequest()->getParam('BannerCategory');
}
$columns = $model->getGridColumn($thi... | php | public function actionManage()
{
$model=new BannerCategory('search');
$model->unsetAttributes(); // clear any default values
if(Yii::app()->getRequest()->getParam('BannerCategory')) {
$model->attributes=Yii::app()->getRequest()->getParam('BannerCategory');
}
$columns = $model->getGridColumn($thi... | [
"public",
"function",
"actionManage",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"BannerCategory",
"(",
"'search'",
")",
";",
"$",
"model",
"->",
"unsetAttributes",
"(",
")",
";",
"// clear any default values\r",
"if",
"(",
"Yii",
"::",
"app",
"(",
")",
"->"... | Manages all models. | [
"Manages",
"all",
"models",
"."
] | train | https://github.com/ommu/mod-banner/blob/eb1c9fbb25a0a6be31749d5f32816de87fed8fdf/controllers/o/CategoryController.php#L96-L113 |
spryker/merchant-data-import | src/Spryker/Zed/MerchantDataImport/Business/MerchantDataImportFacade.php | MerchantDataImportFacade.import | public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
{
return $this->getFactory()->createMerchantDataImport()->import($dataImporterConfigurationTransfer);
} | php | public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
{
return $this->getFactory()->createMerchantDataImport()->import($dataImporterConfigurationTransfer);
} | [
"public",
"function",
"import",
"(",
"?",
"DataImporterConfigurationTransfer",
"$",
"dataImporterConfigurationTransfer",
"=",
"null",
")",
":",
"DataImporterReportTransfer",
"{",
"return",
"$",
"this",
"->",
"getFactory",
"(",
")",
"->",
"createMerchantDataImport",
"(",... | {@inheritdoc}
@api
@param \Generated\Shared\Transfer\DataImporterConfigurationTransfer|null $dataImporterConfigurationTransfer
@return \Generated\Shared\Transfer\DataImporterReportTransfer | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/spryker/merchant-data-import/blob/b3010824ca0765f890838d389e7c8e8a3e524b19/src/Spryker/Zed/MerchantDataImport/Business/MerchantDataImportFacade.php#L28-L31 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.addResource | public function addResource($format, $resource, $locale, $domain = null)
{
if (null !== $domain) {
$this->domains[] = $domain;
}
parent::addResource($format, $resource, $locale, $domain);
} | php | public function addResource($format, $resource, $locale, $domain = null)
{
if (null !== $domain) {
$this->domains[] = $domain;
}
parent::addResource($format, $resource, $locale, $domain);
} | [
"public",
"function",
"addResource",
"(",
"$",
"format",
",",
"$",
"resource",
",",
"$",
"locale",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"domain",
")",
"{",
"$",
"this",
"->",
"domains",
"[",
"]",
"=",
"$",
"do... | Adds a resource.
@see SymfonyTranslator::addResource() Keep track of the translation domains.
@param string $format The name of the loader (@see addLoader()).
@param mixed $resource The resource name.
@param string $locale The locale.
@param string|null $domain The domain.
@return void | [
"Adds",
"a",
"resource",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L87-L94 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.translation | public function translation($val, array $parameters = [], $domain = null)
{
if ($this->isValidTranslation($val) === false) {
return null;
}
$translation = new Translation($val, $this->manager());
$localized = (string)$translation;
foreach ($this->availableLocal... | php | public function translation($val, array $parameters = [], $domain = null)
{
if ($this->isValidTranslation($val) === false) {
return null;
}
$translation = new Translation($val, $this->manager());
$localized = (string)$translation;
foreach ($this->availableLocal... | [
"public",
"function",
"translation",
"(",
"$",
"val",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidTranslation",
"(",
"$",
"val",
")",
"===",
"false",
")",
"{",
"re... | Retrieve a translation object from a (mixed) message.
@uses SymfonyTranslator::trans()
@param mixed $val The string or translation-object to retrieve.
@param array $parameters An array of parameters for the message.
@param string|null $domain The domain for the message or NULL to use the de... | [
"Retrieve",
"a",
"translation",
"object",
"from",
"a",
"(",
"mixed",
")",
"message",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L115-L135 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.translate | public function translate($val, array $parameters = [], $domain = null, $locale = null)
{
if ($locale === null) {
$locale = $this->getLocale();
}
if ($val instanceof Translation) {
return strtr($val[$locale], $parameters);
}
if (is_object($val) && me... | php | public function translate($val, array $parameters = [], $domain = null, $locale = null)
{
if ($locale === null) {
$locale = $this->getLocale();
}
if ($val instanceof Translation) {
return strtr($val[$locale], $parameters);
}
if (is_object($val) && me... | [
"public",
"function",
"translate",
"(",
"$",
"val",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"locale",
"===",
"null",
")",
"{",
"$",
"locale",
"=",... | Translates the given (mixed) message.
@uses SymfonyTranslator::trans()
@uses Translator::translation()
@param mixed $val The string or translation-object to retrieve.
@param array $parameters An array of parameters for the message.
@param string|null $domain The domain for the message or ... | [
"Translates",
"the",
"given",
"(",
"mixed",
")",
"message",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L148-L168 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.translationChoice | public function translationChoice($val, $number, array $parameters = [], $domain = null)
{
if ($this->isValidTranslation($val) === false) {
return null;
}
$parameters = array_merge([
'%count%' => $number,
], $parameters);
$translation = new Translati... | php | public function translationChoice($val, $number, array $parameters = [], $domain = null)
{
if ($this->isValidTranslation($val) === false) {
return null;
}
$parameters = array_merge([
'%count%' => $number,
], $parameters);
$translation = new Translati... | [
"public",
"function",
"translationChoice",
"(",
"$",
"val",
",",
"$",
"number",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidTranslation",
"(",
"$",
"val",
")",
"==="... | Retrieve a translation object from a (mixed) message by choosing a translation according to a number.
@uses SymfonyTranslator::transChoice()
@param mixed $val The string or translation-object to retrieve.
@param integer $number The number to use to find the indice of the message.
@param array... | [
"Retrieve",
"a",
"translation",
"object",
"from",
"a",
"(",
"mixed",
")",
"message",
"by",
"choosing",
"a",
"translation",
"according",
"to",
"a",
"number",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L180-L204 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.translateChoice | public function translateChoice($val, $number, array $parameters = [], $domain = null, $locale = null)
{
if ($locale === null) {
$locale = $this->getLocale();
}
if ($val instanceof Translation) {
$parameters = array_merge([
'%count%' => $number,
... | php | public function translateChoice($val, $number, array $parameters = [], $domain = null, $locale = null)
{
if ($locale === null) {
$locale = $this->getLocale();
}
if ($val instanceof Translation) {
$parameters = array_merge([
'%count%' => $number,
... | [
"public",
"function",
"translateChoice",
"(",
"$",
"val",
",",
"$",
"number",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"locale",
"===",
"null",
")",
... | Translates the given (mixed) choice message by choosing a translation according to a number.
@uses SymfonyTranslator::transChoice()
@uses Translator::translationChoice()
@param mixed $val The string or translation-object to retrieve.
@param integer $number The number to use to find the indic... | [
"Translates",
"the",
"given",
"(",
"mixed",
")",
"choice",
"message",
"by",
"choosing",
"a",
"translation",
"according",
"to",
"a",
"number",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L218-L245 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.hasTrans | public function hasTrans($id, $domain = null, $locale = null)
{
if (null === $domain) {
$domain = 'messages';
}
return $this->getCatalogue($locale)->has($id, $domain);
} | php | public function hasTrans($id, $domain = null, $locale = null)
{
if (null === $domain) {
$domain = 'messages';
}
return $this->getCatalogue($locale)->has($id, $domain);
} | [
"public",
"function",
"hasTrans",
"(",
"$",
"id",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"domain",
")",
"{",
"$",
"domain",
"=",
"'messages'",
";",
"}",
"return",
"$",
"this",
"-... | Checks if a message has a translation.
@param string $id The message id.
@param string|null $domain The domain for the message or NULL to use the default.
@param string|null $locale The locale or NULL to use the default.
@return boolean TRUE if the message has a translation, FALSE otherwise. | [
"Checks",
"if",
"a",
"message",
"has",
"a",
"translation",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L334-L341 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.transExists | public function transExists($id, $domain = null, $locale = null)
{
if (null === $domain) {
$domain = 'messages';
}
return $this->getCatalogue($locale)->defines($id, $domain);
} | php | public function transExists($id, $domain = null, $locale = null)
{
if (null === $domain) {
$domain = 'messages';
}
return $this->getCatalogue($locale)->defines($id, $domain);
} | [
"public",
"function",
"transExists",
"(",
"$",
"id",
",",
"$",
"domain",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"domain",
")",
"{",
"$",
"domain",
"=",
"'messages'",
";",
"}",
"return",
"$",
"this",
... | Checks if a message has a translation (it does not take into account the fallback mechanism).
@param string $id The message id.
@param string|null $domain The domain for the message or NULL to use the default.
@param string|null $locale The locale or NULL to use the default.
@return boolean TRUE if the mes... | [
"Checks",
"if",
"a",
"message",
"has",
"a",
"translation",
"(",
"it",
"does",
"not",
"take",
"into",
"account",
"the",
"fallback",
"mechanism",
")",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L351-L358 |
locomotivemtl/charcoal-translator | src/Charcoal/Translator/Translator.php | Translator.isValidTranslation | protected function isValidTranslation($val)
{
if (empty($val) && !is_numeric($val)) {
return false;
}
if (is_string($val)) {
return !empty(trim($val));
}
if ($val instanceof Translation) {
return true;
}
if (is_array($val... | php | protected function isValidTranslation($val)
{
if (empty($val) && !is_numeric($val)) {
return false;
}
if (is_string($val)) {
return !empty(trim($val));
}
if ($val instanceof Translation) {
return true;
}
if (is_array($val... | [
"protected",
"function",
"isValidTranslation",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"val",
")",
"&&",
"!",
"is_numeric",
"(",
"$",
"val",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"val",
")",
... | Determine if the value is translatable.
@param mixed $val The value to be checked.
@return boolean | [
"Determine",
"if",
"the",
"value",
"is",
"translatable",
"."
] | train | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/Translator.php#L366-L396 |
spryker/product-discontinued-data-import | src/Spryker/Zed/ProductDiscontinuedDataImport/Business/ProductDiscontinuedImportStep/NoteExtractorStep.php | NoteExtractorStep.execute | public function execute(DataSetInterface $dataSet)
{
$localizedNotes = [];
foreach ($dataSet[ProductDiscontinuedDataSetInterface::KEY_LOCALES] as $localeName => $idLocale) {
$key = ProductDiscontinuedDataSetInterface::KEY_NOTE . '.' . $localeName;
if (!isset($dataSet[$key])) ... | php | public function execute(DataSetInterface $dataSet)
{
$localizedNotes = [];
foreach ($dataSet[ProductDiscontinuedDataSetInterface::KEY_LOCALES] as $localeName => $idLocale) {
$key = ProductDiscontinuedDataSetInterface::KEY_NOTE . '.' . $localeName;
if (!isset($dataSet[$key])) ... | [
"public",
"function",
"execute",
"(",
"DataSetInterface",
"$",
"dataSet",
")",
"{",
"$",
"localizedNotes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"dataSet",
"[",
"ProductDiscontinuedDataSetInterface",
"::",
"KEY_LOCALES",
"]",
"as",
"$",
"localeName",
"=>",
... | @param \Spryker\Zed\DataImport\Business\Model\DataSet\DataSetInterface $dataSet
@throws \Spryker\Zed\DataImport\Business\Exception\InvalidDataException
@return void | [
"@param",
"\\",
"Spryker",
"\\",
"Zed",
"\\",
"DataImport",
"\\",
"Business",
"\\",
"Model",
"\\",
"DataSet",
"\\",
"DataSetInterface",
"$dataSet"
] | train | https://github.com/spryker/product-discontinued-data-import/blob/e471f536ae6fc3882a49cb37295a202057c85e75/src/Spryker/Zed/ProductDiscontinuedDataImport/Business/ProductDiscontinuedImportStep/NoteExtractorStep.php#L24-L43 |
inetstudio/widgets | src/Providers/WidgetsServiceProvider.php | WidgetsServiceProvider.boot | public function boot(): void
{
$this->registerConsoleCommands();
$this->registerPublishes();
$this->registerRoutes();
$this->registerViews();
$this->registerFormComponents();
$this->registerBladeDirectives();
} | php | public function boot(): void
{
$this->registerConsoleCommands();
$this->registerPublishes();
$this->registerRoutes();
$this->registerViews();
$this->registerFormComponents();
$this->registerBladeDirectives();
} | [
"public",
"function",
"boot",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"registerConsoleCommands",
"(",
")",
";",
"$",
"this",
"->",
"registerPublishes",
"(",
")",
";",
"$",
"this",
"->",
"registerRoutes",
"(",
")",
";",
"$",
"this",
"->",
"regist... | Загрузка сервиса.
@return void | [
"Загрузка",
"сервиса",
"."
] | train | https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Providers/WidgetsServiceProvider.php#L19-L27 |
inetstudio/widgets | src/Providers/WidgetsServiceProvider.php | WidgetsServiceProvider.registerBladeDirectives | protected function registerBladeDirectives()
{
Blade::directive('widget', function ($expression) {
$widgetsService = app()->make('InetStudio\Widgets\Contracts\Services\Back\WidgetsServiceContract');
$widget = $widgetsService->getWidgetObject($expression);
if ($widget->i... | php | protected function registerBladeDirectives()
{
Blade::directive('widget', function ($expression) {
$widgetsService = app()->make('InetStudio\Widgets\Contracts\Services\Back\WidgetsServiceContract');
$widget = $widgetsService->getWidgetObject($expression);
if ($widget->i... | [
"protected",
"function",
"registerBladeDirectives",
"(",
")",
"{",
"Blade",
"::",
"directive",
"(",
"'widget'",
",",
"function",
"(",
"$",
"expression",
")",
"{",
"$",
"widgetsService",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"'InetStudio\\Widgets\\Contracts\\S... | Регистрация директив blade.
@return void | [
"Регистрация",
"директив",
"blade",
"."
] | train | https://github.com/inetstudio/widgets/blob/bc9357a1183a028f93f725b55b9db2867b7ec731/src/Providers/WidgetsServiceProvider.php#L104-L121 |
RocketPropelledTortoise/Core | src/Taxonomy/Utils/PathResolver.php | PathResolver.resolvePaths | public function resolvePaths(Vertex $start_vertex)
{
$this->paths = [];
/**
* @var DirectedEdge
*/
foreach ($start_vertex->incoming_edges as $edge) {
$this->current_path = [$start_vertex->get_data()];
$this->getPathsRecursion($edge->get_source(), $e... | php | public function resolvePaths(Vertex $start_vertex)
{
$this->paths = [];
/**
* @var DirectedEdge
*/
foreach ($start_vertex->incoming_edges as $edge) {
$this->current_path = [$start_vertex->get_data()];
$this->getPathsRecursion($edge->get_source(), $e... | [
"public",
"function",
"resolvePaths",
"(",
"Vertex",
"$",
"start_vertex",
")",
"{",
"$",
"this",
"->",
"paths",
"=",
"[",
"]",
";",
"/**\n * @var DirectedEdge\n */",
"foreach",
"(",
"$",
"start_vertex",
"->",
"incoming_edges",
"as",
"$",
"edge",
... | Resolve all paths that can be resolved from the start point.
@param Vertex $start_vertex
@return array | [
"Resolve",
"all",
"paths",
"that",
"can",
"be",
"resolved",
"from",
"the",
"start",
"point",
"."
] | train | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Utils/PathResolver.php#L48-L61 |
RocketPropelledTortoise/Core | src/Taxonomy/Utils/PathResolver.php | PathResolver.getPathsRecursion | protected function getPathsRecursion(Vertex $start, DirectedEdge $edge)
{
// We don't want to visit the same vertex twice within a single path. (avoid loops)
if (in_array($start->get_data(), $this->current_path)) {
$this->paths[] = array_reverse($this->current_path);
return;... | php | protected function getPathsRecursion(Vertex $start, DirectedEdge $edge)
{
// We don't want to visit the same vertex twice within a single path. (avoid loops)
if (in_array($start->get_data(), $this->current_path)) {
$this->paths[] = array_reverse($this->current_path);
return;... | [
"protected",
"function",
"getPathsRecursion",
"(",
"Vertex",
"$",
"start",
",",
"DirectedEdge",
"$",
"edge",
")",
"{",
"// We don't want to visit the same vertex twice within a single path. (avoid loops)",
"if",
"(",
"in_array",
"(",
"$",
"start",
"->",
"get_data",
"(",
... | Recurse on all paths from the start point
@param Vertex $start The Vertex to get started from
@param DirectedEdge $edge | [
"Recurse",
"on",
"all",
"paths",
"from",
"the",
"start",
"point"
] | train | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Utils/PathResolver.php#L69-L95 |
pluf/geo | src/Geo/Point.php | Geo_Point.init | function init ()
{
$this->_a['table'] = 'geo_point';
$this->_a['engine'] = 'MyISAM';
$this->_a['cols'] = array(
'id' => array(
'type' => 'Pluf_DB_Field_Sequence',
'blank' => true
),
'point' => arr... | php | function init ()
{
$this->_a['table'] = 'geo_point';
$this->_a['engine'] = 'MyISAM';
$this->_a['cols'] = array(
'id' => array(
'type' => 'Pluf_DB_Field_Sequence',
'blank' => true
),
'point' => arr... | [
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"_a",
"[",
"'table'",
"]",
"=",
"'geo_point'",
";",
"$",
"this",
"->",
"_a",
"[",
"'engine'",
"]",
"=",
"'MyISAM'",
";",
"$",
"this",
"->",
"_a",
"[",
"'cols'",
"]",
"=",
"array",
"(",
"'id'",... | @brief مدل دادهای را بارگذاری میکند.
@see Pluf_Model::init() | [
"@brief",
"مدل",
"دادهای",
"را",
"بارگذاری",
"میکند",
"."
] | train | https://github.com/pluf/geo/blob/53413e06627d12ab0e4239eeb72a7a146c4fb820/src/Geo/Point.php#L17-L33 |
miaoxing/plugin | src/Service/UrlMapper.php | UrlMapper.setPathInfo | protected function setPathInfo($path)
{
$key = 'urlMapper.' . ltrim($this->request->getBaseUrl(), '/') . $this->request->getPathInfo();
$this->request->setPathInfo($path);
$this->statsD->increment($key);
} | php | protected function setPathInfo($path)
{
$key = 'urlMapper.' . ltrim($this->request->getBaseUrl(), '/') . $this->request->getPathInfo();
$this->request->setPathInfo($path);
$this->statsD->increment($key);
} | [
"protected",
"function",
"setPathInfo",
"(",
"$",
"path",
")",
"{",
"$",
"key",
"=",
"'urlMapper.'",
".",
"ltrim",
"(",
"$",
"this",
"->",
"request",
"->",
"getBaseUrl",
"(",
")",
",",
"'/'",
")",
".",
"$",
"this",
"->",
"request",
"->",
"getPathInfo",... | 更改路径并上报旧路径
@param string $path | [
"更改路径并上报旧路径"
] | train | https://github.com/miaoxing/plugin/blob/f287a1e6c97abba6f06906255b8c26e8ab0afe61/src/Service/UrlMapper.php#L62-L67 |
story75/Bonefish-Router | src/Collectors/CombinedRouteCollector.php | CombinedRouteCollector.collectRoutes | public function collectRoutes()
{
$routes = [];
foreach($this->getCollectors() as $collector) {
$routes = array_merge($routes, $collector->collectRoutes());
}
return $routes;
} | php | public function collectRoutes()
{
$routes = [];
foreach($this->getCollectors() as $collector) {
$routes = array_merge($routes, $collector->collectRoutes());
}
return $routes;
} | [
"public",
"function",
"collectRoutes",
"(",
")",
"{",
"$",
"routes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getCollectors",
"(",
")",
"as",
"$",
"collector",
")",
"{",
"$",
"routes",
"=",
"array_merge",
"(",
"$",
"routes",
",",
"$",
... | Aggregate routes and return an array of Route DTOs
@return RouteInterface[] | [
"Aggregate",
"routes",
"and",
"return",
"an",
"array",
"of",
"Route",
"DTOs"
] | train | https://github.com/story75/Bonefish-Router/blob/bb16960c9442303ceeb0c9d14b14be62018de05d/src/Collectors/CombinedRouteCollector.php#L73-L82 |
mtils/cmsable | src/Cmsable/Routing/SiteTreeUrlDispatcher.php | SiteTreeUrlDispatcher.to | public function to($path, $extra = array(), $secure = null){
return $this->forwarder()->to($path, $extra, $secure);
} | php | public function to($path, $extra = array(), $secure = null){
return $this->forwarder()->to($path, $extra, $secure);
} | [
"public",
"function",
"to",
"(",
"$",
"path",
",",
"$",
"extra",
"=",
"array",
"(",
")",
",",
"$",
"secure",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"forwarder",
"(",
")",
"->",
"to",
"(",
"$",
"path",
",",
"$",
"extra",
",",
"$",
... | Generate a absolute URL to the given path.
@param mixed $path or SiteTreeNodeInterface Instance
@param mixed $extra
@param bool $secure
@return string | [
"Generate",
"a",
"absolute",
"URL",
"to",
"the",
"given",
"path",
"."
] | train | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/SiteTreeUrlDispatcher.php#L19-L21 |
mtils/cmsable | src/Cmsable/Routing/SiteTreeUrlDispatcher.php | SiteTreeUrlDispatcher.route | public function route($name, $parameters = array(), $absolute = true, $route = null)
{
return $this->forwarder()->route($name, $parameters, $absolute, $route);
} | php | public function route($name, $parameters = array(), $absolute = true, $route = null)
{
return $this->forwarder()->route($name, $parameters, $absolute, $route);
} | [
"public",
"function",
"route",
"(",
"$",
"name",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"absolute",
"=",
"true",
",",
"$",
"route",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"forwarder",
"(",
")",
"->",
"route",
"(",
... | Get the URL to a named route.
@param string $name
@param mixed $parameters
@param bool $absolute
@param \Illuminate\Routing\Route $route
@return string
@throws \InvalidArgumentException | [
"Get",
"the",
"URL",
"to",
"a",
"named",
"route",
"."
] | train | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/SiteTreeUrlDispatcher.php#L34-L37 |
mtils/cmsable | src/Cmsable/Routing/SiteTreeUrlDispatcher.php | SiteTreeUrlDispatcher.action | public function action($action, $parameters = array(), $absolute = true)
{
return $this->forwarder()->action($action, $parameters, $absolute);
} | php | public function action($action, $parameters = array(), $absolute = true)
{
return $this->forwarder()->action($action, $parameters, $absolute);
} | [
"public",
"function",
"action",
"(",
"$",
"action",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"absolute",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"forwarder",
"(",
")",
"->",
"action",
"(",
"$",
"action",
",",
"$",
"para... | Get the URL to a controller action.
@param string $action
@param mixed $parameters
@param bool $absolute
@return string | [
"Get",
"the",
"URL",
"to",
"a",
"controller",
"action",
"."
] | train | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Routing/SiteTreeUrlDispatcher.php#L47-L50 |
xolens/pglarautil | src/database/migrations/0000_00_00_000200_pglarautil_create_database_log_trigger_function.php | PgLarautilCreateDatabaseLogTriggerFunction.up | public function up()
{
DB::statement("
CREATE OR REPLACE FUNCTION ".self::table()."() RETURNS trigger
LANGUAGE plpgsql AS $$
DECLARE
__log_type varchar(20);
__last_value json;
BEGIN
IF TG_OP = 'INSERT' THEN
... | php | public function up()
{
DB::statement("
CREATE OR REPLACE FUNCTION ".self::table()."() RETURNS trigger
LANGUAGE plpgsql AS $$
DECLARE
__log_type varchar(20);
__last_value json;
BEGIN
IF TG_OP = 'INSERT' THEN
... | [
"public",
"function",
"up",
"(",
")",
"{",
"DB",
"::",
"statement",
"(",
"\"\n CREATE OR REPLACE FUNCTION \"",
".",
"self",
"::",
"table",
"(",
")",
".",
"\"() RETURNS trigger\n LANGUAGE plpgsql AS $$\n DECLARE\n __log_type varchar(... | Run the migrations.
@return void | [
"Run",
"the",
"migrations",
"."
] | train | https://github.com/xolens/pglarautil/blob/20416881566cf94469cba882db39edd783c4f360/src/database/migrations/0000_00_00_000200_pglarautil_create_database_log_trigger_function.php#L24-L53 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.render | public final function render(OutputBuffer $out, ViewModelInterface $model, array $params = [])
{
$this->context->bind($model);
$this->context->set('@view', $this);
foreach($params as $k => $v)
{
$this->context->set($k, $v);
}
try
{
if($this->getParent() === NULL)
{
$this->renderMain($o... | php | public final function render(OutputBuffer $out, ViewModelInterface $model, array $params = [])
{
$this->context->bind($model);
$this->context->set('@view', $this);
foreach($params as $k => $v)
{
$this->context->set($k, $v);
}
try
{
if($this->getParent() === NULL)
{
$this->renderMain($o... | [
"public",
"final",
"function",
"render",
"(",
"OutputBuffer",
"$",
"out",
",",
"ViewModelInterface",
"$",
"model",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"context",
"->",
"bind",
"(",
"$",
"model",
")",
";",
"$",
"th... | Bind to the given view model and render contents of the compiled view.
@param OutputBuffer $out
@param ViewModelInterface $model
@param array<string, mixed> $params
@return OutputBuffer $out | [
"Bind",
"to",
"the",
"given",
"view",
"model",
"and",
"render",
"contents",
"of",
"the",
"compiled",
"view",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L90-L118 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.renderMain | protected function renderMain(OutputBuffer $out)
{
if($this->getParent() === NULL)
{
throw new \RuntimeException('Failed to render main part');
}
$this->parent->renderMain($out);
} | php | protected function renderMain(OutputBuffer $out)
{
if($this->getParent() === NULL)
{
throw new \RuntimeException('Failed to render main part');
}
$this->parent->renderMain($out);
} | [
"protected",
"function",
"renderMain",
"(",
"OutputBuffer",
"$",
"out",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
"===",
"NULL",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Failed to render main part'",
")",
";",
"}",
"$... | Render main content of the view.
@param OutputBuffer $out
@throws \RuntimeException If no parent view is available. | [
"Render",
"main",
"content",
"of",
"the",
"view",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L141-L149 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.renderBlock | public function renderBlock(OutputBuffer $out, $name)
{
$method = 'block_' . $name;
if(method_exists($this, $method))
{
$this->$method($out);
}
elseif($this->getParent() !== NULL)
{
$this->parent->renderBlock($out, $name);
}
else
{
throw new \RuntimeException(sprintf('Block not found: "%s... | php | public function renderBlock(OutputBuffer $out, $name)
{
$method = 'block_' . $name;
if(method_exists($this, $method))
{
$this->$method($out);
}
elseif($this->getParent() !== NULL)
{
$this->parent->renderBlock($out, $name);
}
else
{
throw new \RuntimeException(sprintf('Block not found: "%s... | [
"public",
"function",
"renderBlock",
"(",
"OutputBuffer",
"$",
"out",
",",
"$",
"name",
")",
"{",
"$",
"method",
"=",
"'block_'",
".",
"$",
"name",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"$",
"this",
"... | Render contents of a named block.
@param OutputBuffer $out
@param string $name Name of the block to be rendered.
@throws \RuntimeException When no such block exists. | [
"Render",
"contents",
"of",
"a",
"named",
"block",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L159-L175 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.renderParentBlock | public function renderParentBlock(OutputBuffer $out, $name)
{
if($this->getParent() === NULL)
{
throw new \RuntimeException('Cannot render parent block because no template is inherited');
}
$this->parent->renderBlock($out, $name);
} | php | public function renderParentBlock(OutputBuffer $out, $name)
{
if($this->getParent() === NULL)
{
throw new \RuntimeException('Cannot render parent block because no template is inherited');
}
$this->parent->renderBlock($out, $name);
} | [
"public",
"function",
"renderParentBlock",
"(",
"OutputBuffer",
"$",
"out",
",",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
"===",
"NULL",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Cannot render parent block ... | Render a named block from the parent view.
@param OutputBuffer $out
@param string $name Name of the block to be rendered.
@throws \RuntimeException When no parent view is available. | [
"Render",
"a",
"named",
"block",
"from",
"the",
"parent",
"view",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L185-L193 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.inherit | public final function inherit(ExpressContext $context, ExpressionContextInterface $exp)
{
$this->context = $context;
$this->exp = $exp;
} | php | public final function inherit(ExpressContext $context, ExpressionContextInterface $exp)
{
$this->context = $context;
$this->exp = $exp;
} | [
"public",
"final",
"function",
"inherit",
"(",
"ExpressContext",
"$",
"context",
",",
"ExpressionContextInterface",
"$",
"exp",
")",
"{",
"$",
"this",
"->",
"context",
"=",
"$",
"context",
";",
"$",
"this",
"->",
"exp",
"=",
"$",
"exp",
";",
"}"
] | Inherit the given express context and bound expression context.
@param ExpressContext $context
@param ExpressionContextInterface $exp | [
"Inherit",
"the",
"given",
"express",
"context",
"and",
"bound",
"expression",
"context",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L241-L245 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.getParent | protected final function getParent()
{
if($this->parent === false)
{
if(NULL === ($file = $this->getExtended()))
{
$this->parent = NULL;
}
else
{
$typeName = $this->factory->createView($this->renderer, $this->resolveResource($file));
$this->parent = new $typeName($this->factory, $th... | php | protected final function getParent()
{
if($this->parent === false)
{
if(NULL === ($file = $this->getExtended()))
{
$this->parent = NULL;
}
else
{
$typeName = $this->factory->createView($this->renderer, $this->resolveResource($file));
$this->parent = new $typeName($this->factory, $th... | [
"protected",
"final",
"function",
"getParent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parent",
"===",
"false",
")",
"{",
"if",
"(",
"NULL",
"===",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"getExtended",
"(",
")",
")",
")",
"{",
"$",
"this... | Get the parent view of this view or NULL if no parent view exists.
@return CompiledTemplate | [
"Get",
"the",
"parent",
"view",
"of",
"this",
"view",
"or",
"NULL",
"if",
"no",
"parent",
"view",
"exists",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L252-L270 |
koolkode/view-express | src/CompiledTemplate.php | CompiledTemplate.resolveResource | protected final function resolveResource($file)
{
if(0 === strpos($file, './') || 0 === strpos($file, '../'))
{
$file = rtrim(dirname($this->getResource()), '/\\') . '/' . $file;
}
elseif(!preg_match("'^/|(?:[^:]+://)|(?:[a-z]:[\\\\/])'i", $file))
{
$dir = rtrim(dirname($this->getResource()), '/\\');
... | php | protected final function resolveResource($file)
{
if(0 === strpos($file, './') || 0 === strpos($file, '../'))
{
$file = rtrim(dirname($this->getResource()), '/\\') . '/' . $file;
}
elseif(!preg_match("'^/|(?:[^:]+://)|(?:[a-z]:[\\\\/])'i", $file))
{
$dir = rtrim(dirname($this->getResource()), '/\\');
... | [
"protected",
"final",
"function",
"resolveResource",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
"file",
",",
"'./'",
")",
"||",
"0",
"===",
"strpos",
"(",
"$",
"file",
",",
"'../'",
")",
")",
"{",
"$",
"file",
"=",
"rt... | Resolve a path considering the location of the view if a relative path is given.
@param string $file The path to be resolved.
@return string | [
"Resolve",
"a",
"path",
"considering",
"the",
"location",
"of",
"the",
"view",
"if",
"a",
"relative",
"path",
"is",
"given",
"."
] | train | https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/CompiledTemplate.php#L278-L291 |
freialib/ran.tools | src/Temp.php | Temp.conf | protected static function conf() {
return [
'given_names' => array
(
//// male
// UK
'Oliver', 'Jack', 'Harry', 'Alfie', 'Charlie', 'Thomas', 'William', 'Joshua', 'George', 'James',
// France
'Nathan', 'Lucas', 'Jules', 'Enzo', 'Gabriel', 'Louis', 'Arthur', 'Raphaël', 'Mathis', 'Ethan... | php | protected static function conf() {
return [
'given_names' => array
(
//// male
// UK
'Oliver', 'Jack', 'Harry', 'Alfie', 'Charlie', 'Thomas', 'William', 'Joshua', 'George', 'James',
// France
'Nathan', 'Lucas', 'Jules', 'Enzo', 'Gabriel', 'Louis', 'Arthur', 'Raphaël', 'Mathis', 'Ethan... | [
"protected",
"static",
"function",
"conf",
"(",
")",
"{",
"return",
"[",
"'given_names'",
"=>",
"array",
"(",
"//// male",
"// UK",
"'Oliver'",
",",
"'Jack'",
",",
"'Harry'",
",",
"'Alfie'",
",",
"'Charlie'",
",",
"'Thomas'",
",",
"'William'",
",",
"'Joshua'... | Overwrite if you need to replace or enhance the configuration.
@return array | [
"Overwrite",
"if",
"you",
"need",
"to",
"replace",
"or",
"enhance",
"the",
"configuration",
"."
] | train | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Temp.php#L15-L91 |
freialib/ran.tools | src/Temp.php | Temp.lorempixel | static function lorempixel($width, $height, $category = null, $grayscale = null) {
$defaults = [
'category' => 'technics',
'grayscale' => true,
];
if ($category == null) {
$category = $defaults['category'];
}
if ($grayscale == null) {
$grayscale = $defaults['grayscale'];
}
return static::i... | php | static function lorempixel($width, $height, $category = null, $grayscale = null) {
$defaults = [
'category' => 'technics',
'grayscale' => true,
];
if ($category == null) {
$category = $defaults['category'];
}
if ($grayscale == null) {
$grayscale = $defaults['grayscale'];
}
return static::i... | [
"static",
"function",
"lorempixel",
"(",
"$",
"width",
",",
"$",
"height",
",",
"$",
"category",
"=",
"null",
",",
"$",
"grayscale",
"=",
"null",
")",
"{",
"$",
"defaults",
"=",
"[",
"'category'",
"=>",
"'technics'",
",",
"'grayscale'",
"=>",
"true",
"... | Similar to Temp::img, only produces real life images.
Categories: abstract, animals, city, food, nightlife, fashion, people,
nature, sports, technics, transport
Set category to random to get random categories.
@return static | [
"Similar",
"to",
"Temp",
"::",
"img",
"only",
"produces",
"real",
"life",
"images",
"."
] | train | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Temp.php#L148-L169 |
ScaraMVC/Framework | src/Scara/Console/Database/Truncate.php | Truncate.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$table = $input->getArgument('table');
$db = new Database();
$cap = $db->getCapsule();
$sch = $db->schema();
if ($sch->hasTable($table)) {
$t = $cap->table($table);
if ($t->... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$table = $input->getArgument('table');
$db = new Database();
$cap = $db->getCapsule();
$sch = $db->schema();
if ($sch->hasTable($table)) {
$t = $cap->table($table);
if ($t->... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"table",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'table'",
")",
";",
"$",
"db",
"=",
"new",
"Database",
"(",
")",
";",
... | Execute console command.
@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return void | [
"Execute",
"console",
"command",
"."
] | train | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Console/Database/Truncate.php#L36-L56 |
spiffyjr/spiffy-package | src/Plugin/LoadModulesPlugin.php | LoadModulesPlugin.plug | public function plug(Manager $events)
{
$events->on(PackageManager::EVENT_LOAD, [$this, 'onLoad'], 1000);
$events->plug(new ResolvePackagePlugin());
} | php | public function plug(Manager $events)
{
$events->on(PackageManager::EVENT_LOAD, [$this, 'onLoad'], 1000);
$events->plug(new ResolvePackagePlugin());
} | [
"public",
"function",
"plug",
"(",
"Manager",
"$",
"events",
")",
"{",
"$",
"events",
"->",
"on",
"(",
"PackageManager",
"::",
"EVENT_LOAD",
",",
"[",
"$",
"this",
",",
"'onLoad'",
"]",
",",
"1000",
")",
";",
"$",
"events",
"->",
"plug",
"(",
"new",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/spiffyjr/spiffy-package/blob/42ca8a687efb2d06ecb3d4e0c09456d938a2bc09/src/Plugin/LoadModulesPlugin.php#L16-L20 |
gplcart/cli | controllers/commands/Database.php | Database.cmdTruncateDatabase | public function cmdTruncateDatabase()
{
$all = $this->getParam('all');
$tables = $this->getArguments();
if (empty($tables) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$confirm = null;
if (!empty($tables)) {
$conf... | php | public function cmdTruncateDatabase()
{
$all = $this->getParam('all');
$tables = $this->getArguments();
if (empty($tables) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
$confirm = null;
if (!empty($tables)) {
$conf... | [
"public",
"function",
"cmdTruncateDatabase",
"(",
")",
"{",
"$",
"all",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'all'",
")",
";",
"$",
"tables",
"=",
"$",
"this",
"->",
"getArguments",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"tables",
")",
"... | Callback for "database-truncate" command | [
"Callback",
"for",
"database",
"-",
"truncate",
"command"
] | train | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Database.php#L39-L64 |
gplcart/cli | controllers/commands/Database.php | Database.cmdAddDatabase | public function cmdAddDatabase()
{
$table = $this->getParam(0);
$data = $this->getOptions();
if (empty($table) || empty($data)) {
$this->errorAndExit($this->text('Invalid command'));
}
$this->line($this->db->insert($table, $data));
$this->output();
} | php | public function cmdAddDatabase()
{
$table = $this->getParam(0);
$data = $this->getOptions();
if (empty($table) || empty($data)) {
$this->errorAndExit($this->text('Invalid command'));
}
$this->line($this->db->insert($table, $data));
$this->output();
} | [
"public",
"function",
"cmdAddDatabase",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"table",
")",
"||",
"empt... | Callback for "database-add" command | [
"Callback",
"for",
"database",
"-",
"add",
"command"
] | train | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Database.php#L99-L110 |
gplcart/cli | controllers/commands/Database.php | Database.cmdDeleteDatabase | public function cmdDeleteDatabase()
{
$table = $this->getParam(0);
$conditions = $this->getOptions();
if (empty($table) || empty($conditions)) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!$this->db->delete($table, $conditions)) {
$th... | php | public function cmdDeleteDatabase()
{
$table = $this->getParam(0);
$conditions = $this->getOptions();
if (empty($table) || empty($conditions)) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!$this->db->delete($table, $conditions)) {
$th... | [
"public",
"function",
"cmdDeleteDatabase",
"(",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"conditions",
"=",
"$",
"this",
"->",
"getOptions",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"table",
")",
"||"... | Callback for "database-delete" command | [
"Callback",
"for",
"database",
"-",
"delete",
"command"
] | train | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Database.php#L115-L129 |
gplcart/cli | controllers/commands/Database.php | Database.cmdSqlDatabase | public function cmdSqlDatabase()
{
$sql = $this->getParam(0);
if (empty($sql)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = $this->db->query($sql);
if ($this->getParam('fetch')) {
$result = $result->fetchAll(\PDO::FETCH_ASSOC);... | php | public function cmdSqlDatabase()
{
$sql = $this->getParam(0);
if (empty($sql)) {
$this->errorAndExit($this->text('Invalid command'));
}
$result = $this->db->query($sql);
if ($this->getParam('fetch')) {
$result = $result->fetchAll(\PDO::FETCH_ASSOC);... | [
"public",
"function",
"cmdSqlDatabase",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"sql",
")",
")",
"{",
"$",
"this",
"->",
"errorAndExit",
"(",
"$",
"this",
"->",
"text",
"(",... | Callback for "database-sql" command | [
"Callback",
"for",
"database",
"-",
"sql",
"command"
] | train | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Database.php#L134-L151 |
gplcart/cli | controllers/commands/Database.php | Database.outputFormatTableDatabase | protected function outputFormatTableDatabase(array $items)
{
$header = $rows = array();
if (!empty($items)) {
$first = reset($items);
$header = array_keys($first);
foreach ($items as $item) {
$rows[] = array_values($item);
}
... | php | protected function outputFormatTableDatabase(array $items)
{
$header = $rows = array();
if (!empty($items)) {
$first = reset($items);
$header = array_keys($first);
foreach ($items as $item) {
$rows[] = array_values($item);
}
... | [
"protected",
"function",
"outputFormatTableDatabase",
"(",
"array",
"$",
"items",
")",
"{",
"$",
"header",
"=",
"$",
"rows",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"items",
")",
")",
"{",
"$",
"first",
"=",
"reset",
"(",
"$... | Output table format
@param array $items | [
"Output",
"table",
"format"
] | train | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Database.php#L157-L172 |
mvccore/ext-router-media | src/MvcCore/Ext/Routers/Media/UrlByRoute.php | UrlByRoute.UrlByRoute | public function UrlByRoute (\MvcCore\IRoute & $route, array & $params = [], $urlParamRouteName = NULL) {
// get domain with base path url section,
// path with query string url section
// and system params for url prefixes
list($urlBaseSection, $urlPathWithQuerySection, $systemParams) = $this->urlByRouteSecti... | php | public function UrlByRoute (\MvcCore\IRoute & $route, array & $params = [], $urlParamRouteName = NULL) {
// get domain with base path url section,
// path with query string url section
// and system params for url prefixes
list($urlBaseSection, $urlPathWithQuerySection, $systemParams) = $this->urlByRouteSecti... | [
"public",
"function",
"UrlByRoute",
"(",
"\\",
"MvcCore",
"\\",
"IRoute",
"&",
"$",
"route",
",",
"array",
"&",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"urlParamRouteName",
"=",
"NULL",
")",
"{",
"// get domain with base path url section, ",
"// path with query ... | Complete non-absolute, url by route instance reverse info with special
media type prefix or without the prefix. If there is key `media_version`
in `$params`, unset this param before route URL completing and choose by
this param url prefix to prepend completed URL string.
Example:
Input (`\MvcCore\Route::$reverse`):
`"/... | [
"Complete",
"non",
"-",
"absolute",
"url",
"by",
"route",
"instance",
"reverse",
"info",
"with",
"special",
"media",
"type",
"prefix",
"or",
"without",
"the",
"prefix",
".",
"If",
"there",
"is",
"key",
"media_version",
"in",
"$params",
"unset",
"this",
"para... | train | https://github.com/mvccore/ext-router-media/blob/976e83290cf25ad6bc32e4824790b5e0d5d4c08b/src/MvcCore/Ext/Routers/Media/UrlByRoute.php#L40-L52 |
teonsystems/php-base | src/Stdlib/StringUtils.php | StringUtils.convertCamelCaseToDash | public static function convertCamelCaseToDash ($value)
{
$Filter = new \Zend\Filter\Word\CamelCaseToDash();
return $Filter->filter($value);
} | php | public static function convertCamelCaseToDash ($value)
{
$Filter = new \Zend\Filter\Word\CamelCaseToDash();
return $Filter->filter($value);
} | [
"public",
"static",
"function",
"convertCamelCaseToDash",
"(",
"$",
"value",
")",
"{",
"$",
"Filter",
"=",
"new",
"\\",
"Zend",
"\\",
"Filter",
"\\",
"Word",
"\\",
"CamelCaseToDash",
"(",
")",
";",
"return",
"$",
"Filter",
"->",
"filter",
"(",
"$",
"valu... | /*
Convert CamelCasedString to dash-separated-string
@param string CamelCasedString
@return string dash-separated-string | [
"/",
"*",
"Convert",
"CamelCasedString",
"to",
"dash",
"-",
"separated",
"-",
"string"
] | train | https://github.com/teonsystems/php-base/blob/010418fd9df3c447a74b36cf0d31e2d38a6527ac/src/Stdlib/StringUtils.php#L64-L68 |
teonsystems/php-base | src/Stdlib/StringUtils.php | StringUtils.convertDashToCamelCase | public static function convertDashToCamelCase ($value)
{
$Filter = new \Zend\Filter\Word\DashToCamelCase();
return $Filter->filter($value);
} | php | public static function convertDashToCamelCase ($value)
{
$Filter = new \Zend\Filter\Word\DashToCamelCase();
return $Filter->filter($value);
} | [
"public",
"static",
"function",
"convertDashToCamelCase",
"(",
"$",
"value",
")",
"{",
"$",
"Filter",
"=",
"new",
"\\",
"Zend",
"\\",
"Filter",
"\\",
"Word",
"\\",
"DashToCamelCase",
"(",
")",
";",
"return",
"$",
"Filter",
"->",
"filter",
"(",
"$",
"valu... | /*
Convert dash-separated-string to CamelCasedString
@param string dash-separated-string
@return string CamelCasedString | [
"/",
"*",
"Convert",
"dash",
"-",
"separated",
"-",
"string",
"to",
"CamelCasedString"
] | train | https://github.com/teonsystems/php-base/blob/010418fd9df3c447a74b36cf0d31e2d38a6527ac/src/Stdlib/StringUtils.php#L78-L82 |
teonsystems/php-base | src/Stdlib/StringUtils.php | StringUtils.sanitizeForFilename | public static function sanitizeForFilename ($string, $forceLowercase=false, $forceAnal=false)
{
// Perform the cleaning
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
"}", "\\", "|", ";", ":", "\"", "'", "‘", "... | php | public static function sanitizeForFilename ($string, $forceLowercase=false, $forceAnal=false)
{
// Perform the cleaning
$strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]",
"}", "\\", "|", ";", ":", "\"", "'", "‘", "... | [
"public",
"static",
"function",
"sanitizeForFilename",
"(",
"$",
"string",
",",
"$",
"forceLowercase",
"=",
"false",
",",
"$",
"forceAnal",
"=",
"false",
")",
"{",
"// Perform the cleaning",
"$",
"strip",
"=",
"array",
"(",
"\"~\"",
",",
"\"`\"",
",",
"\"!\"... | /*
Sanitize string to be acceptable as filename
Initial implementation source:
http://stackoverflow.com/questions/2668854/sanitizing-strings-to-make-them-url-and-filename-safe
@param string String to sanitize
@param bool Force lower case?
@param bool Force anal (hm, should this be spelled "rape" in... | [
"/",
"*",
"Sanitize",
"string",
"to",
"be",
"acceptable",
"as",
"filename"
] | train | https://github.com/teonsystems/php-base/blob/010418fd9df3c447a74b36cf0d31e2d38a6527ac/src/Stdlib/StringUtils.php#L97-L110 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.setDataSource | protected function setDataSource($dataSource)
{
if (is_array($dataSource) || $dataSource instanceof \Traversable) {
foreach ($dataSource as $value) {
$this->internalDataListData[] = $value;
}
return;
}
if (is_callable($dataSource)) {
... | php | protected function setDataSource($dataSource)
{
if (is_array($dataSource) || $dataSource instanceof \Traversable) {
foreach ($dataSource as $value) {
$this->internalDataListData[] = $value;
}
return;
}
if (is_callable($dataSource)) {
... | [
"protected",
"function",
"setDataSource",
"(",
"$",
"dataSource",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"dataSource",
")",
"||",
"$",
"dataSource",
"instanceof",
"\\",
"Traversable",
")",
"{",
"foreach",
"(",
"$",
"dataSource",
"as",
"$",
"value",
")"... | Sets a new data source for the list.
@param array|iterable|callback $dataSource An array or an iterable containing objects or arrays that will be converted into data objects or a callback that returns such. The callback option enables lazy data loading.
@throws \InvalidArgumentException | [
"Sets",
"a",
"new",
"data",
"source",
"for",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L59-L72 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.get | public function get(int $index)
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[$index])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
}
return null;
} | php | public function get(int $index)
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[$index])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
}
return null;
} | [
"public",
"function",
"get",
"(",
"int",
"$",
"index",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"internalDataListData",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"$",
"th... | Returns the object at the index specified or null if not found.
@param int $index The index of the item.
@return object|null The object at the index specified or null if not found.
@throws \InvalidArgumentException | [
"Returns",
"the",
"object",
"at",
"the",
"index",
"specified",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L91-L98 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.getFirst | public function getFirst()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
}
return null;
} | php | public function getFirst()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
}
return null;
} | [
"public",
"function",
"getFirst",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"internalDataListData",
"[",
"0",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"internalDataListU... | Returns the first object or null if not found.
@return object|null The first object or null if not found.
@throws \InvalidArgumentException | [
"Returns",
"the",
"first",
"object",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L106-L113 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.getLast | public function getLast()
{
$this->internalDataListUpdate();
$count = sizeof($this->internalDataListData);
if (isset($this->internalDataListData[$count - 1])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $count - 1);
}
return nu... | php | public function getLast()
{
$this->internalDataListUpdate();
$count = sizeof($this->internalDataListData);
if (isset($this->internalDataListData[$count - 1])) {
return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $count - 1);
}
return nu... | [
"public",
"function",
"getLast",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"$",
"count",
"=",
"sizeof",
"(",
"$",
"this",
"->",
"internalDataListData",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"internalDataLi... | Returns the last object or null if not found.
@return object|null The last object or null if not found.
@throws \InvalidArgumentException | [
"Returns",
"the",
"last",
"object",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L121-L129 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.getRandom | public function getRandom()
{
$this->internalDataListUpdate();
$count = sizeof($this->internalDataListData);
if ($count > 0) {
$index = rand(0, $count - 1);
if (isset($this->internalDataListData[$index])) {
return $this->internalDataListUpdateValueIfNe... | php | public function getRandom()
{
$this->internalDataListUpdate();
$count = sizeof($this->internalDataListData);
if ($count > 0) {
$index = rand(0, $count - 1);
if (isset($this->internalDataListData[$index])) {
return $this->internalDataListUpdateValueIfNe... | [
"public",
"function",
"getRandom",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"$",
"count",
"=",
"sizeof",
"(",
"$",
"this",
"->",
"internalDataListData",
")",
";",
"if",
"(",
"$",
"count",
">",
"0",
")",
"{",
"$",
"in... | Returns a random object from the list or null if the list is empty.
@return object|null A random object from the list or null if the list is empty.
@throws \InvalidArgumentException | [
"Returns",
"a",
"random",
"object",
"from",
"the",
"list",
"or",
"null",
"if",
"the",
"list",
"is",
"empty",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L137-L148 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.filterBy | public function filterBy(string $property, $value, string $operator = 'equal'): self
{
if (array_search($operator, ['equal', 'notEqual', 'regExp', 'notRegExp', 'startWith', 'notStartWith', 'endWith', 'notEndWith', 'inArray', 'notInArray']) === false) {
throw new \InvalidArgumentException('Invali... | php | public function filterBy(string $property, $value, string $operator = 'equal'): self
{
if (array_search($operator, ['equal', 'notEqual', 'regExp', 'notRegExp', 'startWith', 'notStartWith', 'endWith', 'notEndWith', 'inArray', 'notInArray']) === false) {
throw new \InvalidArgumentException('Invali... | [
"public",
"function",
"filterBy",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"operator",
"=",
"'equal'",
")",
":",
"self",
"{",
"if",
"(",
"array_search",
"(",
"$",
"operator",
",",
"[",
"'equal'",
",",
"'notEqual'",
",",
"'... | Filters the elements of the list by specific property value.
@param string $property The property name.
@param mixed $value The value of the property.
@param string $operator Available values: equal, notEqual, regExp, notRegExp, startWith, notStartWith, endWith, notEndWith, inArray, notInArray.
@return self A referenc... | [
"Filters",
"the",
"elements",
"of",
"the",
"list",
"by",
"specific",
"property",
"value",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L171-L178 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.sortBy | public function sortBy(string $property, string $order = 'asc'): self
{
if ($order !== 'asc' && $order !== 'desc') {
throw new \InvalidArgumentException('The order argument \'asc\' or \'desc\'');
}
$this->internalDataListActions[] = ['sortBy', $property, $order];
return $... | php | public function sortBy(string $property, string $order = 'asc'): self
{
if ($order !== 'asc' && $order !== 'desc') {
throw new \InvalidArgumentException('The order argument \'asc\' or \'desc\'');
}
$this->internalDataListActions[] = ['sortBy', $property, $order];
return $... | [
"public",
"function",
"sortBy",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"order",
"=",
"'asc'",
")",
":",
"self",
"{",
"if",
"(",
"$",
"order",
"!==",
"'asc'",
"&&",
"$",
"order",
"!==",
"'desc'",
")",
"{",
"throw",
"new",
"\\",
"InvalidAr... | Sorts the elements of the list by specific property.
@param string $property The property name.
@param string $order The sort order.
@return self A reference to the list.
@throws \InvalidArgumentException | [
"Sorts",
"the",
"elements",
"of",
"the",
"list",
"by",
"specific",
"property",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L200-L207 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.unshift | public function unshift($object): self
{
$this->internalDataListUpdate();
array_unshift($this->internalDataListData, $object);
return $this;
} | php | public function unshift($object): self
{
$this->internalDataListUpdate();
array_unshift($this->internalDataListData, $object);
return $this;
} | [
"public",
"function",
"unshift",
"(",
"$",
"object",
")",
":",
"self",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"array_unshift",
"(",
"$",
"this",
"->",
"internalDataListData",
",",
"$",
"object",
")",
";",
"return",
"$",
"this",
... | Prepends an object to the beginning of the list.
@param object|array $object The data to be prepended.
@return self A reference to the list.
@throws \InvalidArgumentException | [
"Prepends",
"an",
"object",
"to",
"the",
"beginning",
"of",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L250-L255 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.shift | public function shift()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
$this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
return array_shift($this->internalDataListData);
}
return null;
} | php | public function shift()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
$this->internalDataListUpdateValueIfNeeded($this->internalDataListData, 0);
return array_shift($this->internalDataListData);
}
return null;
} | [
"public",
"function",
"shift",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"internalDataListData",
"[",
"0",
"]",
")",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdateValueIfNee... | Shift an object off the beginning of the list.
@return object|null Returns the shifted object or null if the list is empty.
@throws \InvalidArgumentException | [
"Shift",
"an",
"object",
"off",
"the",
"beginning",
"of",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L263-L271 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.push | public function push($object): self
{
$this->internalDataListUpdate();
array_push($this->internalDataListData, $object);
return $this;
} | php | public function push($object): self
{
$this->internalDataListUpdate();
array_push($this->internalDataListData, $object);
return $this;
} | [
"public",
"function",
"push",
"(",
"$",
"object",
")",
":",
"self",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"array_push",
"(",
"$",
"this",
"->",
"internalDataListData",
",",
"$",
"object",
")",
";",
"return",
"$",
"this",
";",
... | Pushes an object onto the end of the list.
@param object|array $object The data to be pushed.
@return self A reference to the list.
@throws \InvalidArgumentException | [
"Pushes",
"an",
"object",
"onto",
"the",
"end",
"of",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L280-L285 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.pop | public function pop()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
$this->internalDataListUpdateValueIfNeeded($this->internalDataListData, sizeof($this->internalDataListData) - 1);
return array_pop($this->internalDataListData);
}
... | php | public function pop()
{
$this->internalDataListUpdate();
if (isset($this->internalDataListData[0])) {
$this->internalDataListUpdateValueIfNeeded($this->internalDataListData, sizeof($this->internalDataListData) - 1);
return array_pop($this->internalDataListData);
}
... | [
"public",
"function",
"pop",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"internalDataListData",
"[",
"0",
"]",
")",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdateValueIfNeede... | Pops an object off the end of the list.
@return object|null Returns the popped object or null if the list is empty.
@throws \InvalidArgumentException | [
"Pops",
"an",
"object",
"off",
"the",
"end",
"of",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L293-L301 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.concat | public function concat($list): self
{
$this->internalDataListUpdate();
foreach ($list as $object) {
array_push($this->internalDataListData, $object);
}
return $this;
} | php | public function concat($list): self
{
$this->internalDataListUpdate();
foreach ($list as $object) {
array_push($this->internalDataListData, $object);
}
return $this;
} | [
"public",
"function",
"concat",
"(",
"$",
"list",
")",
":",
"self",
"{",
"$",
"this",
"->",
"internalDataListUpdate",
"(",
")",
";",
"foreach",
"(",
"$",
"list",
"as",
"$",
"object",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"internalDataListData",... | Appends the items of the list provided to the current list.
@param array|iterable $list A list to append after the current one.
@return self A reference to the list.
@throws \InvalidArgumentException | [
"Appends",
"the",
"items",
"of",
"the",
"list",
"provided",
"to",
"the",
"current",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L310-L317 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.slice | public function slice(int $offset, int $length = null)
{
$actions = $this->internalDataListActions;
$actions[] = ['slice', $offset, $length];
$data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
$slice = array_slice($data, $offset, $length);
$clas... | php | public function slice(int $offset, int $length = null)
{
$actions = $this->internalDataListActions;
$actions[] = ['slice', $offset, $length];
$data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
$slice = array_slice($data, $offset, $length);
$clas... | [
"public",
"function",
"slice",
"(",
"int",
"$",
"offset",
",",
"int",
"$",
"length",
"=",
"null",
")",
"{",
"$",
"actions",
"=",
"$",
"this",
"->",
"internalDataListActions",
";",
"$",
"actions",
"[",
"]",
"=",
"[",
"'slice'",
",",
"$",
"offset",
","... | Extract a slice of the list.
@param int $offset The index position where the extraction should begin
@param int $length The max length of the items in the extracted slice.
@return mixed Returns a slice of the list.
@throws \InvalidArgumentException | [
"Extract",
"a",
"slice",
"of",
"the",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L327-L339 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.sliceProperties | public function sliceProperties(array $properties)
{
$actions = $this->internalDataListActions;
$actions[] = ['sliceProperties', $properties];
$data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
$className = get_class($this);
$list = new $classNa... | php | public function sliceProperties(array $properties)
{
$actions = $this->internalDataListActions;
$actions[] = ['sliceProperties', $properties];
$data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
$className = get_class($this);
$list = new $classNa... | [
"public",
"function",
"sliceProperties",
"(",
"array",
"$",
"properties",
")",
"{",
"$",
"actions",
"=",
"$",
"this",
"->",
"internalDataListActions",
";",
"$",
"actions",
"[",
"]",
"=",
"[",
"'sliceProperties'",
",",
"$",
"properties",
"]",
";",
"$",
"dat... | Returns a new list of object that contain only the specified properties of the objects in the current list.
@param array $properties The list of property names.
@return mixed Returns a new list. | [
"Returns",
"a",
"new",
"list",
"of",
"object",
"that",
"contain",
"only",
"the",
"specified",
"properties",
"of",
"the",
"objects",
"in",
"the",
"current",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L347-L365 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.internalDataListUpdateValueIfNeeded | private function internalDataListUpdateValueIfNeeded(&$data, $index)
{
$value = $data[$index];
if (is_callable($value)) {
$value = call_user_func($value);
$data[$index] = $value;
}
if (is_object($value)) {
return $value;
}
$value = ... | php | private function internalDataListUpdateValueIfNeeded(&$data, $index)
{
$value = $data[$index];
if (is_callable($value)) {
$value = call_user_func($value);
$data[$index] = $value;
}
if (is_object($value)) {
return $value;
}
$value = ... | [
"private",
"function",
"internalDataListUpdateValueIfNeeded",
"(",
"&",
"$",
"data",
",",
"$",
"index",
")",
"{",
"$",
"value",
"=",
"$",
"data",
"[",
"$",
"index",
"]",
";",
"if",
"(",
"is_callable",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"... | Converts the value into object if needed.
@param int $index | [
"Converts",
"the",
"value",
"into",
"object",
"if",
"needed",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L383-L396 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.internalDataListUpdateAllValuesIfNeeded | private function internalDataListUpdateAllValuesIfNeeded(&$data)
{
foreach ($data as $index => $value) {
$this->internalDataListUpdateValueIfNeeded($data, $index);
}
} | php | private function internalDataListUpdateAllValuesIfNeeded(&$data)
{
foreach ($data as $index => $value) {
$this->internalDataListUpdateValueIfNeeded($data, $index);
}
} | [
"private",
"function",
"internalDataListUpdateAllValuesIfNeeded",
"(",
"&",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"index",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"internalDataListUpdateValueIfNeeded",
"(",
"$",
"data",
",",
... | Converts all values into objects if needed. | [
"Converts",
"all",
"values",
"into",
"objects",
"if",
"needed",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L401-L406 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.internalDataListUpdate | private function internalDataListUpdate()
{
$this->internalDataListData = $this->internalDataListUpdateData($this->internalDataListData, $this->internalDataListActions);
$this->internalDataListActions = [];
} | php | private function internalDataListUpdate()
{
$this->internalDataListData = $this->internalDataListUpdateData($this->internalDataListData, $this->internalDataListActions);
$this->internalDataListActions = [];
} | [
"private",
"function",
"internalDataListUpdate",
"(",
")",
"{",
"$",
"this",
"->",
"internalDataListData",
"=",
"$",
"this",
"->",
"internalDataListUpdateData",
"(",
"$",
"this",
"->",
"internalDataListData",
",",
"$",
"this",
"->",
"internalDataListActions",
")",
... | Applies the pending actions to the data list.
@throws \InvalidArgumentException | [
"Applies",
"the",
"pending",
"actions",
"to",
"the",
"data",
"list",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L413-L417 |
ivopetkov/data-object | src/DataListTrait.php | DataListTrait.internalDataListUpdateData | private function internalDataListUpdateData($data, $actions): array
{
if (is_callable($data)) {
$actionsList = [];
foreach ($actions as $actionData) {
if ($actionData[0] === 'filterBy') {
$class = $this->internalDataListClasses['IvoPetkov\DataListF... | php | private function internalDataListUpdateData($data, $actions): array
{
if (is_callable($data)) {
$actionsList = [];
foreach ($actions as $actionData) {
if ($actionData[0] === 'filterBy') {
$class = $this->internalDataListClasses['IvoPetkov\DataListF... | [
"private",
"function",
"internalDataListUpdateData",
"(",
"$",
"data",
",",
"$",
"actions",
")",
":",
"array",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"data",
")",
")",
"{",
"$",
"actionsList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"actions",
"as",... | Applies the actions to the data list provided.
@param mixed $data
@param array $actions
@throws \InvalidArgumentException
@return array Returns the updated data | [
"Applies",
"the",
"actions",
"to",
"the",
"data",
"list",
"provided",
"."
] | train | https://github.com/ivopetkov/data-object/blob/024039017fd9e6e3aca6edbad79aaf45764b8991/src/DataListTrait.php#L427-L589 |
scaleplan/event | src/AbstractListener.php | AbstractListener.sendByHttp | protected function sendByHttp(string $url, string $token = null) : void
{
$content = ['event' => static::NAME, 'data' => $this->data];
$request = new Request($url, $content);
if ($token) {
$request->addHeader(Header::AUTHORIZATION, $token);
}
$request->send();
... | php | protected function sendByHttp(string $url, string $token = null) : void
{
$content = ['event' => static::NAME, 'data' => $this->data];
$request = new Request($url, $content);
if ($token) {
$request->addHeader(Header::AUTHORIZATION, $token);
}
$request->send();
... | [
"protected",
"function",
"sendByHttp",
"(",
"string",
"$",
"url",
",",
"string",
"$",
"token",
"=",
"null",
")",
":",
"void",
"{",
"$",
"content",
"=",
"[",
"'event'",
"=>",
"static",
"::",
"NAME",
",",
"'data'",
"=>",
"$",
"this",
"->",
"data",
"]",... | @param string $url
@param string|null $token
@throws \Scaleplan\DTO\Exceptions\ValidationException
@throws \Scaleplan\Http\Exceptions\HttpException
@throws \Scaleplan\Http\Exceptions\RemoteServiceNotAvailableException | [
"@param",
"string",
"$url",
"@param",
"string|null",
"$token"
] | train | https://github.com/scaleplan/event/blob/248aa456e41c8a7949dd3b6be9bfe3dc108f5915/src/AbstractListener.php#L48-L58 |
scaleplan/event | src/AbstractListener.php | AbstractListener.sendAsyncByDb | public function sendAsyncByDb(\PDO $connection) : void
{
if ($this->data) {
throw new DataNotSupportedException();
}
$connection->exec('NOTIFY ' . static::NAME);
} | php | public function sendAsyncByDb(\PDO $connection) : void
{
if ($this->data) {
throw new DataNotSupportedException();
}
$connection->exec('NOTIFY ' . static::NAME);
} | [
"public",
"function",
"sendAsyncByDb",
"(",
"\\",
"PDO",
"$",
"connection",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"data",
")",
"{",
"throw",
"new",
"DataNotSupportedException",
"(",
")",
";",
"}",
"$",
"connection",
"->",
"exec",
"(",
"'... | @param \PDO $connection
@throws DataNotSupportedException | [
"@param",
"\\",
"PDO",
"$connection"
] | train | https://github.com/scaleplan/event/blob/248aa456e41c8a7949dd3b6be9bfe3dc108f5915/src/AbstractListener.php#L71-L78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.