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 |
|---|---|---|---|---|---|---|---|---|---|---|
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.flatNamedElements | protected function flatNamedElements(Collection $elements)
{
return $elements->reduce(function (Collection $initial, $element) {
if ($element instanceof NamedFormElement) {
// Is it what we're looking for? if so we'll push it to final collection
$initial->push($el... | php | protected function flatNamedElements(Collection $elements)
{
return $elements->reduce(function (Collection $initial, $element) {
if ($element instanceof NamedFormElement) {
// Is it what we're looking for? if so we'll push it to final collection
$initial->push($el... | [
"protected",
"function",
"flatNamedElements",
"(",
"Collection",
"$",
"elements",
")",
"{",
"return",
"$",
"elements",
"->",
"reduce",
"(",
"function",
"(",
"Collection",
"$",
"initial",
",",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"instanceof",... | Returns flat collection of elements in form ignoring everything but NamedFormElement. Works recursive.
@param \Illuminate\Support\Collection $elements
@return mixed | [
"Returns",
"flat",
"collection",
"of",
"elements",
"in",
"form",
"ignoring",
"everything",
"but",
"NamedFormElement",
".",
"Works",
"recursive",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L472-L485 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.save | public function save(Request $request)
{
$connection = app(\Illuminate\Database\ConnectionInterface::class);
$this->prepareRelatedValues($this->getRequestData());
$this->transactionLevel = $connection->transactionLevel();
$connection->beginTransaction();
// Nothing to do her... | php | public function save(Request $request)
{
$connection = app(\Illuminate\Database\ConnectionInterface::class);
$this->prepareRelatedValues($this->getRequestData());
$this->transactionLevel = $connection->transactionLevel();
$connection->beginTransaction();
// Nothing to do her... | [
"public",
"function",
"save",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"connection",
"=",
"app",
"(",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"ConnectionInterface",
"::",
"class",
")",
";",
"$",
"this",
"->",
"prepareRelatedValues",
"(",
"$",
"th... | Saves request.
@param \Illuminate\Http\Request $request | [
"Saves",
"request",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L529-L537 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.toArray | public function toArray()
{
$this->buildGroupsCollection();
return parent::toArray() + [
'stub' => $this->stubElements,
'name' => $this->relationName,
'label' => $this->label,
'groups' => $t... | php | public function toArray()
{
$this->buildGroupsCollection();
return parent::toArray() + [
'stub' => $this->stubElements,
'name' => $this->relationName,
'label' => $this->label,
'groups' => $t... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"buildGroupsCollection",
"(",
")",
";",
"return",
"parent",
"::",
"toArray",
"(",
")",
"+",
"[",
"'stub'",
"=>",
"$",
"this",
"->",
"stubElements",
",",
"'name'",
"=>",
"$",
"this",
"->... | Get the instance as an array.
@return array | [
"Get",
"the",
"instance",
"as",
"an",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L602-L615 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.exceedsLimit | public function exceedsLimit()
{
if ($this->limit === null) {
return false;
}
return $this->relatedValues->count() >= $this->limit;
} | php | public function exceedsLimit()
{
if ($this->limit === null) {
return false;
}
return $this->relatedValues->count() >= $this->limit;
} | [
"public",
"function",
"exceedsLimit",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"limit",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"relatedValues",
"->",
"count",
"(",
")",
">=",
"$",
"this",
"->",
"limit",... | Checks if count of relations to be created exceeds limit.
@return int | [
"Checks",
"if",
"count",
"of",
"relations",
"to",
"be",
"created",
"exceeds",
"limit",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L634-L641 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Elements.php | Elements.addOrGetRelated | protected function addOrGetRelated($key)
{
$related = $this->relatedValues->get($key) ?? $this->getFreshModelForElements();
if (! $related->exists && ! $this->exceedsLimit()) {
$this->relatedValues->put($key, $related);
}
return $related;
} | php | protected function addOrGetRelated($key)
{
$related = $this->relatedValues->get($key) ?? $this->getFreshModelForElements();
if (! $related->exists && ! $this->exceedsLimit()) {
$this->relatedValues->put($key, $related);
}
return $related;
} | [
"protected",
"function",
"addOrGetRelated",
"(",
"$",
"key",
")",
"{",
"$",
"related",
"=",
"$",
"this",
"->",
"relatedValues",
"->",
"get",
"(",
"$",
"key",
")",
"??",
"$",
"this",
"->",
"getFreshModelForElements",
"(",
")",
";",
"if",
"(",
"!",
"$",
... | Appends fresh related model if total count is not exceeding limit.
@param $key
@return $this | [
"Appends",
"fresh",
"related",
"model",
"if",
"total",
"count",
"is",
"not",
"exceeding",
"limit",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Elements.php#L650-L659 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayDatatables.php | DisplayDatatables.initialize | public function initialize()
{
parent::initialize();
$id = str_random(10);
$this->setHtmlAttribute('class', 'datatables');
$this->setHtmlAttribute('data-id', $id);
$this->getColumnFilters()->setHtmlAttribute('data-datatables-id', $id);
$this->setHtmlAttribute('data... | php | public function initialize()
{
parent::initialize();
$id = str_random(10);
$this->setHtmlAttribute('class', 'datatables');
$this->setHtmlAttribute('data-id', $id);
$this->getColumnFilters()->setHtmlAttribute('data-datatables-id', $id);
$this->setHtmlAttribute('data... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"$",
"id",
"=",
"str_random",
"(",
"10",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'class'",
",",
"'datatables'",
")",
";",
"$",
"this",
"->",
... | Initialize display. | [
"Initialize",
"display",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayDatatables.php#L29-L55 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayDatatables.php | DisplayDatatables.setOrder | public function setOrder($order)
{
if (! is_array($order)) {
$order = func_get_args();
}
$this->order = $order;
return $this;
} | php | public function setOrder($order)
{
if (! is_array($order)) {
$order = func_get_args();
}
$this->order = $order;
return $this;
} | [
"public",
"function",
"setOrder",
"(",
"$",
"order",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"order",
")",
")",
"{",
"$",
"order",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"order",
"=",
"$",
"order",
";",
"return",
"$"... | @param array $order
@return $this | [
"@param",
"array",
"$order"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayDatatables.php#L90-L99 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.initialize | public function initialize()
{
$this->getButtons()->setHtmlAttribute('class', 'panel-footer');
$this->setHtmlAttribute('class', 'panel panel-default '.$this->getPanelClass());
parent::initialize();
} | php | public function initialize()
{
$this->getButtons()->setHtmlAttribute('class', 'panel-footer');
$this->setHtmlAttribute('class', 'panel panel-default '.$this->getPanelClass());
parent::initialize();
} | [
"public",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"getButtons",
"(",
")",
"->",
"setHtmlAttribute",
"(",
"'class'",
",",
"'panel-footer'",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'class'",
",",
"'panel panel-default '",
".",
... | Initialize form. | [
"Initialize",
"form",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L42-L49 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.setItems | public function setItems($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addBody($items);
return $this;
} | php | public function setItems($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addBody($items);
return $this;
} | [
"public",
"function",
"setItems",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"items",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"addBody",
"(",
"$",
"items",
")",
";",
"retur... | @param array|FormElementInterface $items
@return $this | [
"@param",
"array|FormElementInterface",
"$items"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L56-L65 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.addItem | public function addItem($item)
{
if ($part = $this->getElements()->last()) {
$part->addElement($item);
} else {
$this->addBody($item);
}
return $this;
} | php | public function addItem($item)
{
if ($part = $this->getElements()->last()) {
$part->addElement($item);
} else {
$this->addBody($item);
}
return $this;
} | [
"public",
"function",
"addItem",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"part",
"=",
"$",
"this",
"->",
"getElements",
"(",
")",
"->",
"last",
"(",
")",
")",
"{",
"$",
"part",
"->",
"addElement",
"(",
"$",
"item",
")",
";",
"}",
"else",
"{... | @param FormElementInterface $item
@return $this | [
"@param",
"FormElementInterface",
"$item"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L72-L81 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.addHeader | public function addHeader($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addElement(new Header($items));
return $this;
} | php | public function addHeader($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addElement(new Header($items));
return $this;
} | [
"public",
"function",
"addHeader",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"items",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"addElement",
"(",
"new",
"Header",
"(",
"$",
... | @param array|FormElementInterface $items
@return $this | [
"@param",
"array|FormElementInterface",
"$items"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L88-L97 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.addBody | public function addBody($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$class = $this->getElements()->last();
if (is_object($class) && get_class($class) === Body::class) {
$this->addElement(new Html('<hr />'));
}
$this->addEl... | php | public function addBody($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$class = $this->getElements()->last();
if (is_object($class) && get_class($class) === Body::class) {
$this->addElement(new Html('<hr />'));
}
$this->addEl... | [
"public",
"function",
"addBody",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"items",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"class",
"=",
"$",
"this",
"->",
"getElements",
"(",
")",
"->... | @param array|FormElementInterface $items
@return $this | [
"@param",
"array|FormElementInterface",
"$items"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L104-L118 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormPanel.php | FormPanel.addFooter | public function addFooter($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addElement(new Footer($items));
return $this;
} | php | public function addFooter($items)
{
if (! is_array($items)) {
$items = func_get_args();
}
$this->addElement(new Footer($items));
return $this;
} | [
"public",
"function",
"addFooter",
"(",
"$",
"items",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"items",
")",
")",
"{",
"$",
"items",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"addElement",
"(",
"new",
"Footer",
"(",
"$",
... | @param array|FormElementInterface $items
@return $this | [
"@param",
"array|FormElementInterface",
"$items"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormPanel.php#L125-L134 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormElement.php | FormElement.addValidationMessage | public function addValidationMessage($rule, $message)
{
if (($pos = strpos($rule, ':')) !== false) {
$rule = substr($rule, 0, $pos);
}
$this->validationMessages[$rule] = $message;
return $this;
} | php | public function addValidationMessage($rule, $message)
{
if (($pos = strpos($rule, ':')) !== false) {
$rule = substr($rule, 0, $pos);
}
$this->validationMessages[$rule] = $message;
return $this;
} | [
"public",
"function",
"addValidationMessage",
"(",
"$",
"rule",
",",
"$",
"message",
")",
"{",
"if",
"(",
"(",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"rule",
",",
"':'",
")",
")",
"!==",
"false",
")",
"{",
"$",
"rule",
"=",
"substr",
"(",
"$",
"rul... | @param string $rule
@param string $message
@return $this | [
"@param",
"string",
"$rule",
"@param",
"string",
"$message"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormElement.php#L82-L91 |
LaravelRUS/SleepingOwlAdmin | src/Form/FormElement.php | FormElement.setValidationRules | public function setValidationRules($validationRules)
{
if (! is_array($validationRules)) {
$validationRules = func_get_args();
}
$this->validationRules = [];
foreach ($validationRules as $rule) {
if ($rule instanceof \Illuminate\Validation\Rule || $rule insta... | php | public function setValidationRules($validationRules)
{
if (! is_array($validationRules)) {
$validationRules = func_get_args();
}
$this->validationRules = [];
foreach ($validationRules as $rule) {
if ($rule instanceof \Illuminate\Validation\Rule || $rule insta... | [
"public",
"function",
"setValidationRules",
"(",
"$",
"validationRules",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"validationRules",
")",
")",
"{",
"$",
"validationRules",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"validationRules",... | @param array|string $validationRules
@return $this | [
"@param",
"array|string",
"$validationRules"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/FormElement.php#L143-L162 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Filters.php | Filters.set | public function set($filters)
{
if (! is_array($filters)) {
$filters = func_get_args();
}
$this->clear();
foreach ($filters as $filter) {
$this->push($filter);
}
return $this->getDisplay();
} | php | public function set($filters)
{
if (! is_array($filters)) {
$filters = func_get_args();
}
$this->clear();
foreach ($filters as $filter) {
$this->push($filter);
}
return $this->getDisplay();
} | [
"public",
"function",
"set",
"(",
"$",
"filters",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"filters",
")",
")",
"{",
"$",
"filters",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
... | @param array|FilterInterface $filters
@return \SleepingOwl\Admin\Contracts\Display\DisplayInterface | [
"@param",
"array|FilterInterface",
"$filters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Filters.php#L42-L55 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/NamedColumn.php | NamedColumn.getValueFromObject | protected function getValueFromObject($instance, $name)
{
if ($name instanceof Closure) {
return $name($instance);
}
/*
* Implement json parsing
*/
if (strpos($name, '.') === false && strpos($name, '->') !== false) {
$casts = collect($instan... | php | protected function getValueFromObject($instance, $name)
{
if ($name instanceof Closure) {
return $name($instance);
}
/*
* Implement json parsing
*/
if (strpos($name, '.') === false && strpos($name, '->') !== false) {
$casts = collect($instan... | [
"protected",
"function",
"getValueFromObject",
"(",
"$",
"instance",
",",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"instanceof",
"Closure",
")",
"{",
"return",
"$",
"name",
"(",
"$",
"instance",
")",
";",
"}",
"/*\n * Implement json parsing\n ... | Get column value from instance.
@param Collection|Model|Closure $instance
@param string $name
@return mixed | [
"Get",
"column",
"value",
"from",
"instance",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/NamedColumn.php#L143-L192 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/View.php | View.setView | public function setView($view)
{
$this->view = $view;
$this->setDisplay(function ($model) {
$this->data['model'] = $model;
return view($this->getView(), $this->data);
});
return $this;
} | php | public function setView($view)
{
$this->view = $view;
$this->setDisplay(function ($model) {
$this->data['model'] = $model;
return view($this->getView(), $this->data);
});
return $this;
} | [
"public",
"function",
"setView",
"(",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"view",
"=",
"$",
"view",
";",
"$",
"this",
"->",
"setDisplay",
"(",
"function",
"(",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'model'",
"]",
"=",
"$"... | @param string $view
@return $this | [
"@param",
"string",
"$view"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/View.php#L45-L56 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Select.php | Select.setSortable | public function setSortable($sortable, $sortable_flags = null)
{
$this->sortable = (bool) $sortable;
$this->sortable_flags = $sortable_flags;
return $this;
} | php | public function setSortable($sortable, $sortable_flags = null)
{
$this->sortable = (bool) $sortable;
$this->sortable_flags = $sortable_flags;
return $this;
} | [
"public",
"function",
"setSortable",
"(",
"$",
"sortable",
",",
"$",
"sortable_flags",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"sortable",
"=",
"(",
"bool",
")",
"$",
"sortable",
";",
"$",
"this",
"->",
"sortable_flags",
"=",
"$",
"sortable_flags",
";"... | @param bool $sortable
@param null $sortable_flags
@return $this | [
"@param",
"bool",
"$sortable"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Select.php#L139-L145 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/Select.php | Select.exclude | public function exclude($keys)
{
if (! is_array($keys)) {
$keys = func_get_args();
}
$this->exclude = array_filter($keys);
return $this;
} | php | public function exclude($keys)
{
if (! is_array($keys)) {
$keys = func_get_args();
}
$this->exclude = array_filter($keys);
return $this;
} | [
"public",
"function",
"exclude",
"(",
"$",
"keys",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keys",
")",
")",
"{",
"$",
"keys",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"exclude",
"=",
"array_filter",
"(",
"$",
"keys",
... | @param array $keys
@return $this | [
"@param",
"array",
"$keys"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/Select.php#L187-L196 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.getBootstrapPath | protected function getBootstrapPath($path = null)
{
if (! is_null($path)) {
$path = DIRECTORY_SEPARATOR.$path;
}
return $this->getConfig('bootstrapDirectory').$path;
} | php | protected function getBootstrapPath($path = null)
{
if (! is_null($path)) {
$path = DIRECTORY_SEPARATOR.$path;
}
return $this->getConfig('bootstrapDirectory').$path;
} | [
"protected",
"function",
"getBootstrapPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"DIRECTORY_SEPARATOR",
".",
"$",
"path",
";",
"}",
"return",
"$",
"this",
"->",
"getCo... | @param string $path
@return string | [
"@param",
"string",
"$path"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L118-L125 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerWidgets | protected function registerWidgets()
{
$widgetsRegistry = $this->app[WidgetsRegistryInterface::class];
foreach ($this->widgets as $widget) {
$widgetsRegistry->registerWidget($widget);
}
} | php | protected function registerWidgets()
{
$widgetsRegistry = $this->app[WidgetsRegistryInterface::class];
foreach ($this->widgets as $widget) {
$widgetsRegistry->registerWidget($widget);
}
} | [
"protected",
"function",
"registerWidgets",
"(",
")",
"{",
"$",
"widgetsRegistry",
"=",
"$",
"this",
"->",
"app",
"[",
"WidgetsRegistryInterface",
"::",
"class",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"widgets",
"as",
"$",
"widget",
")",
"{",
"$",
... | Global register widgets. | [
"Global",
"register",
"widgets",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L137-L144 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerMessages | protected function registerMessages()
{
$messageTypes = [
'error' => ErrorMessages::class,
'info' => InfoMessages::class,
'success' => SuccessMessages::class,
'warning' => WarningMessages::class,
];
foreach ($messageTypes as $messageType) ... | php | protected function registerMessages()
{
$messageTypes = [
'error' => ErrorMessages::class,
'info' => InfoMessages::class,
'success' => SuccessMessages::class,
'warning' => WarningMessages::class,
];
foreach ($messageTypes as $messageType) ... | [
"protected",
"function",
"registerMessages",
"(",
")",
"{",
"$",
"messageTypes",
"=",
"[",
"'error'",
"=>",
"ErrorMessages",
"::",
"class",
",",
"'info'",
"=>",
"InfoMessages",
"::",
"class",
",",
"'success'",
"=>",
"SuccessMessages",
"::",
"class",
",",
"'war... | Global register messages of adminpanel. | [
"Global",
"register",
"messages",
"of",
"adminpanel",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L149-L164 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerBootstrap | protected function registerBootstrap()
{
$directory = $this->getBootstrapPath();
if (! is_dir($directory)) {
return;
}
$files = Finder::create()
->files()
->name('/^.+\.php$/')
->notName('routes.php')
->notName('navigation... | php | protected function registerBootstrap()
{
$directory = $this->getBootstrapPath();
if (! is_dir($directory)) {
return;
}
$files = Finder::create()
->files()
->name('/^.+\.php$/')
->notName('routes.php')
->notName('navigation... | [
"protected",
"function",
"registerBootstrap",
"(",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"getBootstrapPath",
"(",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"return",
";",
"}",
"$",
"files",
"=",
"Finder",
... | Register bootstrap file. | [
"Register",
"bootstrap",
"file",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L208-L229 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerCustomRoutes | protected function registerCustomRoutes()
{
if (file_exists($file = $this->getBootstrapPath('routes.php'))) {
$this->registerRoutes(function (Router $route) use ($file) {
require $file;
});
}
} | php | protected function registerCustomRoutes()
{
if (file_exists($file = $this->getBootstrapPath('routes.php'))) {
$this->registerRoutes(function (Router $route) use ($file) {
require $file;
});
}
} | [
"protected",
"function",
"registerCustomRoutes",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"getBootstrapPath",
"(",
"'routes.php'",
")",
")",
")",
"{",
"$",
"this",
"->",
"registerRoutes",
"(",
"function",
"(",
"Rou... | Register Custom Routes From Users. | [
"Register",
"Custom",
"Routes",
"From",
"Users",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L242-L249 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerDefaultRoutes | protected function registerDefaultRoutes()
{
$this->registerRoutes(function (Router $router) {
(new ModelRouter($this->app, $router))->register($this->app['sleeping_owl']->getModels());
if (file_exists($routesFile = __DIR__.'/../Http/routes.php')) {
require $routesFi... | php | protected function registerDefaultRoutes()
{
$this->registerRoutes(function (Router $router) {
(new ModelRouter($this->app, $router))->register($this->app['sleeping_owl']->getModels());
if (file_exists($routesFile = __DIR__.'/../Http/routes.php')) {
require $routesFi... | [
"protected",
"function",
"registerDefaultRoutes",
"(",
")",
"{",
"$",
"this",
"->",
"registerRoutes",
"(",
"function",
"(",
"Router",
"$",
"router",
")",
"{",
"(",
"new",
"ModelRouter",
"(",
"$",
"this",
"->",
"app",
",",
"$",
"router",
")",
")",
"->",
... | Register Default Admin Routes. | [
"Register",
"Default",
"Admin",
"Routes",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L254-L265 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerSupportRoutes | protected function registerSupportRoutes()
{
$domain = config('sleeping_owl.domain', false);
$middlewares = collect($this->getConfig('middleware'));
$configGroup = collect([
'prefix' => $this->getConfig('url_prefix'),
'middleware' => $middlewares,
]);
... | php | protected function registerSupportRoutes()
{
$domain = config('sleeping_owl.domain', false);
$middlewares = collect($this->getConfig('middleware'));
$configGroup = collect([
'prefix' => $this->getConfig('url_prefix'),
'middleware' => $middlewares,
]);
... | [
"protected",
"function",
"registerSupportRoutes",
"(",
")",
"{",
"$",
"domain",
"=",
"config",
"(",
"'sleeping_owl.domain'",
",",
"false",
")",
";",
"$",
"middlewares",
"=",
"collect",
"(",
"$",
"this",
"->",
"getConfig",
"(",
"'middleware'",
")",
")",
";",
... | Register CKEditor Upload and D&D plugins. | [
"Register",
"CKEditor",
"Upload",
"and",
"D&D",
"plugins",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L270-L295 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminServiceProvider.php | AdminServiceProvider.registerNavigationFile | protected function registerNavigationFile()
{
if (file_exists($navigation = $this->getBootstrapPath('navigation.php'))) {
$items = include $navigation;
if (is_array($items)) {
$this->app['sleeping_owl.navigation']->setFromArray($items);
}
}
} | php | protected function registerNavigationFile()
{
if (file_exists($navigation = $this->getBootstrapPath('navigation.php'))) {
$items = include $navigation;
if (is_array($items)) {
$this->app['sleeping_owl.navigation']->setFromArray($items);
}
}
} | [
"protected",
"function",
"registerNavigationFile",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"navigation",
"=",
"$",
"this",
"->",
"getBootstrapPath",
"(",
"'navigation.php'",
")",
")",
")",
"{",
"$",
"items",
"=",
"include",
"$",
"navigation",
";",... | Register navigation file. | [
"Register",
"navigation",
"file",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminServiceProvider.php#L320-L329 |
LaravelRUS/SleepingOwlAdmin | src/Form/Columns/Column.php | Column.setSize | public function setSize($size)
{
if (strpos($size, 'col-') === false) {
$size = 'col-'.$size.'-';
}
$this->size = $size;
return $this;
} | php | public function setSize($size)
{
if (strpos($size, 'col-') === false) {
$size = 'col-'.$size.'-';
}
$this->size = $size;
return $this;
} | [
"public",
"function",
"setSize",
"(",
"$",
"size",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"size",
",",
"'col-'",
")",
"===",
"false",
")",
"{",
"$",
"size",
"=",
"'col-'",
".",
"$",
"size",
".",
"'-'",
";",
"}",
"$",
"this",
"->",
"size",
"="... | @param string $size
@return $this | [
"@param",
"string",
"$size"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Columns/Column.php#L68-L77 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/DependentSelect.php | DependentSelect.getDependValue | public function getDependValue($key)
{
return array_get($this->params, $key, $this->getModel()->getAttribute($key));
} | php | public function getDependValue($key)
{
return array_get($this->params, $key, $this->getModel()->getAttribute($key));
} | [
"public",
"function",
"getDependValue",
"(",
"$",
"key",
")",
"{",
"return",
"array_get",
"(",
"$",
"this",
"->",
"params",
",",
"$",
"key",
",",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getAttribute",
"(",
"$",
"key",
")",
")",
";",
"}"
] | @param string $key
@return mixed | [
"@param",
"string",
"$key"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/DependentSelect.php#L73-L76 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Scopes.php | Scopes.set | public function set($scopes)
{
$this->scopes = func_get_args();
if (is_array($scopes)) {
$this->scopes[] = $scopes;
}
return $this->getDisplay();
} | php | public function set($scopes)
{
$this->scopes = func_get_args();
if (is_array($scopes)) {
$this->scopes[] = $scopes;
}
return $this->getDisplay();
} | [
"public",
"function",
"set",
"(",
"$",
"scopes",
")",
"{",
"$",
"this",
"->",
"scopes",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"scopes",
")",
")",
"{",
"$",
"this",
"->",
"scopes",
"[",
"]",
"=",
"$",
"scopes",
";",... | @param array|string $scopes
@return DisplayInterface|Scopes | [
"@param",
"array|string",
"$scopes"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Scopes.php#L28-L37 |
LaravelRUS/SleepingOwlAdmin | src/Display/Extension/Scopes.php | Scopes.push | public function push($scope)
{
if (! is_array($scope)) {
$scope = func_get_args();
}
$this->scopes[] = $scope;
return $this;
} | php | public function push($scope)
{
if (! is_array($scope)) {
$scope = func_get_args();
}
$this->scopes[] = $scope;
return $this;
} | [
"public",
"function",
"push",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"scope",
")",
")",
"{",
"$",
"scope",
"=",
"func_get_args",
"(",
")",
";",
"}",
"$",
"this",
"->",
"scopes",
"[",
"]",
"=",
"$",
"scope",
";",
"ret... | @param string $scope
@return $this | [
"@param",
"string",
"$scope"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Extension/Scopes.php#L44-L53 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Control.php | Control.isEditable | protected function isEditable()
{
return
$this->editable
&&
! $this->isTrashed()
&&
$this->getModelConfiguration()->isEditable(
$this->getModel()
);
} | php | protected function isEditable()
{
return
$this->editable
&&
! $this->isTrashed()
&&
$this->getModelConfiguration()->isEditable(
$this->getModel()
);
} | [
"protected",
"function",
"isEditable",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"editable",
"&&",
"!",
"$",
"this",
"->",
"isTrashed",
"(",
")",
"&&",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"isEditable",
"(",
"$",
"this",
"->",
... | Check if instance editable.
@return bool | [
"Check",
"if",
"instance",
"editable",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Control.php#L203-L213 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Control.php | Control.isDeletable | protected function isDeletable()
{
return
$this->deletable
&&
! $this->isTrashed()
&&
$this->getModelConfiguration()->isDeletable(
$this->getModel()
);
} | php | protected function isDeletable()
{
return
$this->deletable
&&
! $this->isTrashed()
&&
$this->getModelConfiguration()->isDeletable(
$this->getModel()
);
} | [
"protected",
"function",
"isDeletable",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"deletable",
"&&",
"!",
"$",
"this",
"->",
"isTrashed",
"(",
")",
"&&",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"isDeletable",
"(",
"$",
"this",
"->",... | Check if instance is deletable.
@return bool | [
"Check",
"if",
"instance",
"is",
"deletable",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Control.php#L220-L230 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Control.php | Control.isDestroyable | protected function isDestroyable()
{
return
$this->destroyable
&&
$this->isTrashed()
&&
$this->getModelConfiguration()->isDestroyable(
$this->getModel()
);
} | php | protected function isDestroyable()
{
return
$this->destroyable
&&
$this->isTrashed()
&&
$this->getModelConfiguration()->isDestroyable(
$this->getModel()
);
} | [
"protected",
"function",
"isDestroyable",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"destroyable",
"&&",
"$",
"this",
"->",
"isTrashed",
"(",
")",
"&&",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"isDestroyable",
"(",
"$",
"this",
"->",
... | Check if instance is force deletable.
@return bool | [
"Check",
"if",
"instance",
"is",
"force",
"deletable",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Control.php#L237-L247 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Control.php | Control.isRestorable | protected function isRestorable()
{
return
$this->restorable
&&
$this->isTrashed()
&&
$this->getModelConfiguration()->isRestorable(
$this->getModel()
);
} | php | protected function isRestorable()
{
return
$this->restorable
&&
$this->isTrashed()
&&
$this->getModelConfiguration()->isRestorable(
$this->getModel()
);
} | [
"protected",
"function",
"isRestorable",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"restorable",
"&&",
"$",
"this",
"->",
"isTrashed",
"(",
")",
"&&",
"$",
"this",
"->",
"getModelConfiguration",
"(",
")",
"->",
"isRestorable",
"(",
"$",
"this",
"->",
"... | Check if instance is restorable.
@return bool | [
"Check",
"if",
"instance",
"is",
"restorable",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Control.php#L254-L264 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.can | public function can($action, Model $model)
{
if (! $this->checkAccess) {
return true;
}
return \Gate::allows($action, [$this, $model]);
} | php | public function can($action, Model $model)
{
if (! $this->checkAccess) {
return true;
}
return \Gate::allows($action, [$this, $model]);
} | [
"public",
"function",
"can",
"(",
"$",
"action",
",",
"Model",
"$",
"model",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkAccess",
")",
"{",
"return",
"true",
";",
"}",
"return",
"\\",
"Gate",
"::",
"allows",
"(",
"$",
"action",
",",
"[",
"... | @param string $action
@param \Illuminate\Database\Eloquent\Model $model
@return bool | [
"@param",
"string",
"$action",
"@param",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Eloquent",
"\\",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L307-L314 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.getEditUrl | public function getEditUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.edit', $parameters);
} | php | public function getEditUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.edit', $parameters);
} | [
"public",
"function",
"getEditUrl",
"(",
"$",
"id",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"array_unshift",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"getAlias",
"(",
")",
",",
"$",
"id",
")",
";",
"return",
"route",
"(",
"... | @param string|int $id
@param array $parameters
@return string | [
"@param",
"string|int",
"$id",
"@param",
"array",
"$parameters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L398-L403 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.getUpdateUrl | public function getUpdateUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.update', $parameters);
} | php | public function getUpdateUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.update', $parameters);
} | [
"public",
"function",
"getUpdateUrl",
"(",
"$",
"id",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"array_unshift",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"getAlias",
"(",
")",
",",
"$",
"id",
")",
";",
"return",
"route",
"(",
... | @param string|int $id
@param array $parameters
@return string | [
"@param",
"string|int",
"$id",
"@param",
"array",
"$parameters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L411-L416 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.getDeleteUrl | public function getDeleteUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.delete', $parameters);
} | php | public function getDeleteUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.delete', $parameters);
} | [
"public",
"function",
"getDeleteUrl",
"(",
"$",
"id",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"array_unshift",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"getAlias",
"(",
")",
",",
"$",
"id",
")",
";",
"return",
"route",
"(",
... | @param string|int $id
@param array $parameters
@return string | [
"@param",
"string|int",
"$id",
"@param",
"array",
"$parameters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L424-L429 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.getDestroyUrl | public function getDestroyUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.destroy', $parameters);
} | php | public function getDestroyUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.destroy', $parameters);
} | [
"public",
"function",
"getDestroyUrl",
"(",
"$",
"id",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"array_unshift",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"getAlias",
"(",
")",
",",
"$",
"id",
")",
";",
"return",
"route",
"(",
... | @param string|int $id
@param array $parameters
@return string | [
"@param",
"string|int",
"$id",
"@param",
"array",
"$parameters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L437-L442 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.getRestoreUrl | public function getRestoreUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.restore', $parameters);
} | php | public function getRestoreUrl($id, array $parameters = [])
{
array_unshift($parameters, $this->getAlias(), $id);
return route('admin.model.restore', $parameters);
} | [
"public",
"function",
"getRestoreUrl",
"(",
"$",
"id",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"array_unshift",
"(",
"$",
"parameters",
",",
"$",
"this",
"->",
"getAlias",
"(",
")",
",",
"$",
"id",
")",
";",
"return",
"route",
"(",
... | @param string|int $id
@param array $parameters
@return string | [
"@param",
"string|int",
"$id",
"@param",
"array",
"$parameters"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L450-L455 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.addToNavigation | public function addToNavigation($priority = 100, $badge = null)
{
$page = $this->makePage($priority, $badge);
$this->getNavigation()->addPage($page);
return $page;
} | php | public function addToNavigation($priority = 100, $badge = null)
{
$page = $this->makePage($priority, $badge);
$this->getNavigation()->addPage($page);
return $page;
} | [
"public",
"function",
"addToNavigation",
"(",
"$",
"priority",
"=",
"100",
",",
"$",
"badge",
"=",
"null",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"makePage",
"(",
"$",
"priority",
",",
"$",
"badge",
")",
";",
"$",
"this",
"->",
"getNavigation... | @param int $priority
@param string|\Closure|BadgeInterface $badge
@return Page | [
"@param",
"int",
"$priority",
"@param",
"string|",
"\\",
"Closure|BadgeInterface",
"$badge"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L511-L518 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.makePage | protected function makePage($priority = 100, $badge = null)
{
$page = new Page($this->getClass());
$page->setPriority($priority);
if ($badge) {
if (! ($badge instanceof BadgeInterface)) {
$badge = new Badge($badge);
}
$page->setBadge($bad... | php | protected function makePage($priority = 100, $badge = null)
{
$page = new Page($this->getClass());
$page->setPriority($priority);
if ($badge) {
if (! ($badge instanceof BadgeInterface)) {
$badge = new Badge($badge);
}
$page->setBadge($bad... | [
"protected",
"function",
"makePage",
"(",
"$",
"priority",
"=",
"100",
",",
"$",
"badge",
"=",
"null",
")",
"{",
"$",
"page",
"=",
"new",
"Page",
"(",
"$",
"this",
"->",
"getClass",
"(",
")",
")",
";",
"$",
"page",
"->",
"setPriority",
"(",
"$",
... | @param int $priority
@param string|\Closure|BadgeInterface $badge
@return Page | [
"@param",
"int",
"$priority",
"@param",
"string|",
"\\",
"Closure|BadgeInterface",
"$badge"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L535-L549 |
LaravelRUS/SleepingOwlAdmin | src/Model/ModelConfigurationManager.php | ModelConfigurationManager.fireEvent | public function fireEvent($event, $halt = true, Model $model = null, ...$payload)
{
if (! isset(self::$dispatcher)) {
return true;
}
if (is_null($model)) {
$model = $this->getModel();
}
// We will append the names of the class to the event to disting... | php | public function fireEvent($event, $halt = true, Model $model = null, ...$payload)
{
if (! isset(self::$dispatcher)) {
return true;
}
if (is_null($model)) {
$model = $this->getModel();
}
// We will append the names of the class to the event to disting... | [
"public",
"function",
"fireEvent",
"(",
"$",
"event",
",",
"$",
"halt",
"=",
"true",
",",
"Model",
"$",
"model",
"=",
"null",
",",
"...",
"$",
"payload",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"dispatcher",
")",
")",
"{",
"ret... | Fire the given event for the model.
@param string $event
@param bool $halt
@param Model|null $model
@param array $payload
@return mixed | [
"Fire",
"the",
"given",
"event",
"for",
"the",
"model",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Model/ModelConfigurationManager.php#L580-L608 |
LaravelRUS/SleepingOwlAdmin | src/Http/Controllers/UploadController.php | UploadController.fromField | public function fromField(Request $request, ModelConfigurationInterface $model, $field, $id = null)
{
if (! is_null($id)) {
$item = $model->getRepository()->find($id);
if (is_null($item) || ! $model->isEditable($item)) {
return new JsonResponse([
'... | php | public function fromField(Request $request, ModelConfigurationInterface $model, $field, $id = null)
{
if (! is_null($id)) {
$item = $model->getRepository()->find($id);
if (is_null($item) || ! $model->isEditable($item)) {
return new JsonResponse([
'... | [
"public",
"function",
"fromField",
"(",
"Request",
"$",
"request",
",",
"ModelConfigurationInterface",
"$",
"model",
",",
"$",
"field",
",",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"$",
"item",
"=",... | @param Request $request
@param ModelConfigurationInterface $model
@param string $field
@param int|null $id
@return JsonResponse | [
"@param",
"Request",
"$request",
"@param",
"ModelConfigurationInterface",
"$model",
"@param",
"string",
"$field",
"@param",
"int|null",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Http/Controllers/UploadController.php#L24-L76 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/MultiSelectAjax.php | MultiSelectAjax.afterSave | public function afterSave(Request $request)
{
$attribute = $this->getModelAttributeKey();
if (! method_exists($this->getModel(), $attribute)) {
return;
}
parent::afterSave($request);
} | php | public function afterSave(Request $request)
{
$attribute = $this->getModelAttributeKey();
if (! method_exists($this->getModel(), $attribute)) {
return;
}
parent::afterSave($request);
} | [
"public",
"function",
"afterSave",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getModelAttributeKey",
"(",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
"->",
"getModel",
"(",
")",
",",
"$",
"attr... | @param Request $request
@return void | [
"@param",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/MultiSelectAjax.php#L234-L243 |
LaravelRUS/SleepingOwlAdmin | src/Wysiwyg/Manager.php | Manager.register | public function register($editorId, WysiwygFilterInterface $filter = null, $name = null)
{
$this->getFilters()->push(
$editor = new Editor($editorId, $name, $filter, $this->config->get($editorId, []))
);
return $editor;
} | php | public function register($editorId, WysiwygFilterInterface $filter = null, $name = null)
{
$this->getFilters()->push(
$editor = new Editor($editorId, $name, $filter, $this->config->get($editorId, []))
);
return $editor;
} | [
"public",
"function",
"register",
"(",
"$",
"editorId",
",",
"WysiwygFilterInterface",
"$",
"filter",
"=",
"null",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getFilters",
"(",
")",
"->",
"push",
"(",
"$",
"editor",
"=",
"new",
"Editor... | @param string $editorId
@param WysiwygFilterInterface|null $filter
@param string|null $name
@return WysiwygEditorInterface | [
"@param",
"string",
"$editorId",
"@param",
"WysiwygFilterInterface|null",
"$filter",
"@param",
"string|null",
"$name"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Wysiwyg/Manager.php#L62-L69 |
LaravelRUS/SleepingOwlAdmin | src/Wysiwyg/Manager.php | Manager.getEditor | public function getEditor($editorId)
{
return $this->getFilters()->filter(function (WysiwygEditorInterface $editor) use ($editorId) {
return $editor->getId() == $editorId;
})->first();
} | php | public function getEditor($editorId)
{
return $this->getFilters()->filter(function (WysiwygEditorInterface $editor) use ($editorId) {
return $editor->getId() == $editorId;
})->first();
} | [
"public",
"function",
"getEditor",
"(",
"$",
"editorId",
")",
"{",
"return",
"$",
"this",
"->",
"getFilters",
"(",
")",
"->",
"filter",
"(",
"function",
"(",
"WysiwygEditorInterface",
"$",
"editor",
")",
"use",
"(",
"$",
"editorId",
")",
"{",
"return",
"... | @param string $editorId
@return WysiwygEditorInterface|null | [
"@param",
"string",
"$editorId"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Wysiwyg/Manager.php#L84-L89 |
LaravelRUS/SleepingOwlAdmin | src/Wysiwyg/Manager.php | Manager.loadEditor | public function loadEditor($editorId)
{
if (! is_null($editor = $this->getEditor($editorId))) {
if ($editor->isUsed()) {
return true;
}
return $editor->load();
}
return false;
} | php | public function loadEditor($editorId)
{
if (! is_null($editor = $this->getEditor($editorId))) {
if ($editor->isUsed()) {
return true;
}
return $editor->load();
}
return false;
} | [
"public",
"function",
"loadEditor",
"(",
"$",
"editorId",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"editor",
"=",
"$",
"this",
"->",
"getEditor",
"(",
"$",
"editorId",
")",
")",
")",
"{",
"if",
"(",
"$",
"editor",
"->",
"isUsed",
"(",
")",
... | @param string $editorId
@return bool | [
"@param",
"string",
"$editorId"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Wysiwyg/Manager.php#L101-L112 |
LaravelRUS/SleepingOwlAdmin | src/Wysiwyg/Manager.php | Manager.applyFilter | public function applyFilter($editorId, $text)
{
if (! is_null($editor = $this->getEditor($editorId))) {
return $editor->applyFilter($text);
}
throw new WysiwygException("Editor [{$editorId}] not found");
} | php | public function applyFilter($editorId, $text)
{
if (! is_null($editor = $this->getEditor($editorId))) {
return $editor->applyFilter($text);
}
throw new WysiwygException("Editor [{$editorId}] not found");
} | [
"public",
"function",
"applyFilter",
"(",
"$",
"editorId",
",",
"$",
"text",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"editor",
"=",
"$",
"this",
"->",
"getEditor",
"(",
"$",
"editorId",
")",
")",
")",
"{",
"return",
"$",
"editor",
"->",
"app... | @param string $editorId
@param string $text
@return string string
@throws WysiwygException | [
"@param",
"string",
"$editorId",
"@param",
"string",
"$text"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Wysiwyg/Manager.php#L121-L128 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/DateRange.php | DateRange.setModelAttribute | public function setModelAttribute($value)
{
$value = ! empty($value) ? array_map(function ($date) {
return Carbon::createFromFormat($this->getPickerFormat(), $date);
}, explode('::', $value)) : null;
parent::setModelAttribute($value);
} | php | public function setModelAttribute($value)
{
$value = ! empty($value) ? array_map(function ($date) {
return Carbon::createFromFormat($this->getPickerFormat(), $date);
}, explode('::', $value)) : null;
parent::setModelAttribute($value);
} | [
"public",
"function",
"setModelAttribute",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"!",
"empty",
"(",
"$",
"value",
")",
"?",
"array_map",
"(",
"function",
"(",
"$",
"date",
")",
"{",
"return",
"Carbon",
"::",
"createFromFormat",
"(",
"$",
"thi... | @param mixed $value
@return void | [
"@param",
"mixed",
"$value"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/DateRange.php#L86-L93 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Filter/Select.php | Select.parseValue | public function parseValue($selected)
{
if (is_string($selected) && strpos($selected, ':::') !== false) {
return explode(':::', $selected);
}
return $selected;
} | php | public function parseValue($selected)
{
if (is_string($selected) && strpos($selected, ':::') !== false) {
return explode(':::', $selected);
}
return $selected;
} | [
"public",
"function",
"parseValue",
"(",
"$",
"selected",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"selected",
")",
"&&",
"strpos",
"(",
"$",
"selected",
",",
"':::'",
")",
"!==",
"false",
")",
"{",
"return",
"explode",
"(",
"':::'",
",",
"$",
"se... | @param mixed $selected
@return array | [
"@param",
"mixed",
"$selected"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Filter/Select.php#L211-L218 |
LaravelRUS/SleepingOwlAdmin | src/Navigation.php | Navigation.setAliasesId | public function setAliasesId(Collection $pages)
{
$pages->each(function (PageInterface $page) {
$page->setAliasId();
if ($page->getPages()->count()) {
$this->setAliasesId($page->getPages());
}
});
} | php | public function setAliasesId(Collection $pages)
{
$pages->each(function (PageInterface $page) {
$page->setAliasId();
if ($page->getPages()->count()) {
$this->setAliasesId($page->getPages());
}
});
} | [
"public",
"function",
"setAliasesId",
"(",
"Collection",
"$",
"pages",
")",
"{",
"$",
"pages",
"->",
"each",
"(",
"function",
"(",
"PageInterface",
"$",
"page",
")",
"{",
"$",
"page",
"->",
"setAliasId",
"(",
")",
";",
"if",
"(",
"$",
"page",
"->",
"... | Set Alias Id to Page.
@param Collection $pages | [
"Set",
"Alias",
"Id",
"to",
"Page",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Navigation.php#L31-L40 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Filter/Date.php | Date.parseValue | public function parseValue($date)
{
if (empty($date)) {
return;
}
try {
$date = Carbon::parse($date);
} catch (Exception $e) {
\Log::info('unable to parse date, re-trying with given format', [
'exception' => $e,
'da... | php | public function parseValue($date)
{
if (empty($date)) {
return;
}
try {
$date = Carbon::parse($date);
} catch (Exception $e) {
\Log::info('unable to parse date, re-trying with given format', [
'exception' => $e,
'da... | [
"public",
"function",
"parseValue",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$",
"date",
"=",
"Carbon",
"::",
"parse",
"(",
"$",
"date",
")",
";",
"}",
"catch",
"(",
"Exce... | @param string $date
@return string | [
"@param",
"string",
"$date"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Filter/Date.php#L146-L173 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/MultiSelect.php | MultiSelect.save | public function save(\Illuminate\Http\Request $request)
{
if (is_null($this->getModelForOptions())) {
parent::save($request);
}
} | php | public function save(\Illuminate\Http\Request $request)
{
if (is_null($this->getModelForOptions())) {
parent::save($request);
}
} | [
"public",
"function",
"save",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getModelForOptions",
"(",
")",
")",
")",
"{",
"parent",
"::",
"save",
"(",
"$",
"request",
... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/MultiSelect.php#L147-L152 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/MultiSelect.php | MultiSelect.afterSave | public function afterSave(\Illuminate\Http\Request $request)
{
if (is_null($this->getModelForOptions())) {
return;
}
if ($this->isValueSkipped()) {
return;
}
$attribute = $this->getModelAttributeKey();
if (is_null($request->input($this->getP... | php | public function afterSave(\Illuminate\Http\Request $request)
{
if (is_null($this->getModelForOptions())) {
return;
}
if ($this->isValueSkipped()) {
return;
}
$attribute = $this->getModelAttributeKey();
if (is_null($request->input($this->getP... | [
"public",
"function",
"afterSave",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getModelForOptions",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"thi... | @param \Illuminate\Http\Request $request
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/MultiSelect.php#L159-L185 |
LaravelRUS/SleepingOwlAdmin | src/Form/Element/MultiSelect.php | MultiSelect.syncBelongsToManyRelation | protected function syncBelongsToManyRelation(
\Illuminate\Database\Eloquent\Relations\BelongsToMany $relation,
array $values
) {
foreach ($values as $i => $value) {
if (! array_key_exists($value, $this->getOptions()) && $this->isTaggable()) {
$model = clone $this-... | php | protected function syncBelongsToManyRelation(
\Illuminate\Database\Eloquent\Relations\BelongsToMany $relation,
array $values
) {
foreach ($values as $i => $value) {
if (! array_key_exists($value, $this->getOptions()) && $this->isTaggable()) {
$model = clone $this-... | [
"protected",
"function",
"syncBelongsToManyRelation",
"(",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Eloquent",
"\\",
"Relations",
"\\",
"BelongsToMany",
"$",
"relation",
",",
"array",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"i",
... | @param \Illuminate\Database\Eloquent\Relations\BelongsToMany $relation
@param array $values
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Eloquent",
"\\",
"Relations",
"\\",
"BelongsToMany",
"$relation",
"@param",
"array",
"$values"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Element/MultiSelect.php#L193-L215 |
LaravelRUS/SleepingOwlAdmin | src/Console/Installation/CreatePublicDirectory.php | CreatePublicDirectory.install | public function install()
{
$directory = $this->getDirectory();
$this->command->files()->makeDirectory($directory, 0755, true, true);
$directoryPath = str_replace(base_path(), '', $directory);
$this->command->line("<info>Public upload directory is [{$directoryPath}]</info>");
} | php | public function install()
{
$directory = $this->getDirectory();
$this->command->files()->makeDirectory($directory, 0755, true, true);
$directoryPath = str_replace(base_path(), '', $directory);
$this->command->line("<info>Public upload directory is [{$directoryPath}]</info>");
} | [
"public",
"function",
"install",
"(",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"getDirectory",
"(",
")",
";",
"$",
"this",
"->",
"command",
"->",
"files",
"(",
")",
"->",
"makeDirectory",
"(",
"$",
"directory",
",",
"0755",
",",
"true",
",... | Install the components.
@return void | [
"Install",
"the",
"components",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Console/Installation/CreatePublicDirectory.php#L17-L24 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/TreeRepository.php | TreeRepository.setTreeType | public function setTreeType($treeType)
{
$this->treeType = new $treeType($this);
if (! ($this->treeType instanceof TreeTypeInterface)) {
throw new DisplayTreeException('Tree type class must be instanced of [SleepingOwl\Admin\Contracts\Display\Tree\TreeTypeInterface]');
}
} | php | public function setTreeType($treeType)
{
$this->treeType = new $treeType($this);
if (! ($this->treeType instanceof TreeTypeInterface)) {
throw new DisplayTreeException('Tree type class must be instanced of [SleepingOwl\Admin\Contracts\Display\Tree\TreeTypeInterface]');
}
} | [
"public",
"function",
"setTreeType",
"(",
"$",
"treeType",
")",
"{",
"$",
"this",
"->",
"treeType",
"=",
"new",
"$",
"treeType",
"(",
"$",
"this",
")",
";",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"treeType",
"instanceof",
"TreeTypeInterface",
")",
")"... | @param string $treeType
@throws DisplayTreeException | [
"@param",
"string",
"$treeType"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/TreeRepository.php#L53-L60 |
LaravelRUS/SleepingOwlAdmin | src/Repositories/TreeRepository.php | TreeRepository.detectType | protected function detectType()
{
$model = $this->getModel();
$traits = trait_uses_recursive($model);
$type = SimpleTreeType::class;
if ($model instanceof \Baum\Node) {
$type = BaumNodeType::class;
} elseif (class_exists('Kalnoy\Nestedset\Node') && $model instanc... | php | protected function detectType()
{
$model = $this->getModel();
$traits = trait_uses_recursive($model);
$type = SimpleTreeType::class;
if ($model instanceof \Baum\Node) {
$type = BaumNodeType::class;
} elseif (class_exists('Kalnoy\Nestedset\Node') && $model instanc... | [
"protected",
"function",
"detectType",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
";",
"$",
"traits",
"=",
"trait_uses_recursive",
"(",
"$",
"model",
")",
";",
"$",
"type",
"=",
"SimpleTreeType",
"::",
"class",
";",
"if"... | Detect tree type.
@return $this | [
"Detect",
"tree",
"type",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Repositories/TreeRepository.php#L170-L187 |
LaravelRUS/SleepingOwlAdmin | src/Console/Installation/Command.php | Command.fire | public function fire(Filesystem $files)
{
if (! defined('SLEEPINGOWL_STUB_PATH')) {
define('SLEEPINGOWL_STUB_PATH', __DIR__.'/stubs');
}
if (! $this->confirmToProceed('SleepingOwl Admin')) {
return;
}
$this->call('vendor:publish', [
'--ta... | php | public function fire(Filesystem $files)
{
if (! defined('SLEEPINGOWL_STUB_PATH')) {
define('SLEEPINGOWL_STUB_PATH', __DIR__.'/stubs');
}
if (! $this->confirmToProceed('SleepingOwl Admin')) {
return;
}
$this->call('vendor:publish', [
'--ta... | [
"public",
"function",
"fire",
"(",
"Filesystem",
"$",
"files",
")",
"{",
"if",
"(",
"!",
"defined",
"(",
"'SLEEPINGOWL_STUB_PATH'",
")",
")",
"{",
"define",
"(",
"'SLEEPINGOWL_STUB_PATH'",
",",
"__DIR__",
".",
"'/stubs'",
")",
";",
"}",
"if",
"(",
"!",
"... | Execute the console command.
@param Filesystem $files | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Console/Installation/Command.php#L30-L49 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/Filter/Range.php | Range.initialize | public function initialize()
{
parent::initialize();
$this->setHtmlAttribute('data-type', 'range');
$this->setHtmlAttribute('class', 'column-filter');
$this->getFrom()->initialize();
$this->getTo()->initialize();
$this->getFrom()->removeHtmlAttribute('data-type');
... | php | public function initialize()
{
parent::initialize();
$this->setHtmlAttribute('data-type', 'range');
$this->setHtmlAttribute('class', 'column-filter');
$this->getFrom()->initialize();
$this->getTo()->initialize();
$this->getFrom()->removeHtmlAttribute('data-type');
... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"parent",
"::",
"initialize",
"(",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'data-type'",
",",
"'range'",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'class'",
",",
"'column-filter'"... | Initialize column filter. | [
"Initialize",
"column",
"filter",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/Filter/Range.php#L27-L39 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.initialize | public function initialize()
{
$this->initializeElements();
$tabs = $this->getTabs();
foreach ($tabs as $tab) {
if (method_exists($tab->getContent(), 'getElements')) {
$elements = $tab->getContent()->getElements();
foreach ($elements as $element)... | php | public function initialize()
{
$this->initializeElements();
$tabs = $this->getTabs();
foreach ($tabs as $tab) {
if (method_exists($tab->getContent(), 'getElements')) {
$elements = $tab->getContent()->getElements();
foreach ($elements as $element)... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"initializeElements",
"(",
")",
";",
"$",
"tabs",
"=",
"$",
"this",
"->",
"getTabs",
"(",
")",
";",
"foreach",
"(",
"$",
"tabs",
"as",
"$",
"tab",
")",
"{",
"if",
"(",
"method_ex... | Initialize tabbed interface. | [
"Initialize",
"tabbed",
"interface",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L44-L77 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.setModelClass | public function setModelClass($class)
{
$this->getTabs()->each(function (TabInterface $tab) use ($class) {
if ($tab instanceof DisplayInterface) {
$tab->setModelClass($class);
}
});
return $this;
} | php | public function setModelClass($class)
{
$this->getTabs()->each(function (TabInterface $tab) use ($class) {
if ($tab instanceof DisplayInterface) {
$tab->setModelClass($class);
}
});
return $this;
} | [
"public",
"function",
"setModelClass",
"(",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"getTabs",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"TabInterface",
"$",
"tab",
")",
"use",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"tab",
"instanceof",
... | @param string $class
@return $this | [
"@param",
"string",
"$class"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L96-L105 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.setTabs | public function setTabs($tabs)
{
if (is_callable($tabs)) {
$tabs = call_user_func($tabs, $this);
}
return $this->setElements($tabs);
} | php | public function setTabs($tabs)
{
if (is_callable($tabs)) {
$tabs = call_user_func($tabs, $this);
}
return $this->setElements($tabs);
} | [
"public",
"function",
"setTabs",
"(",
"$",
"tabs",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"tabs",
")",
")",
"{",
"$",
"tabs",
"=",
"call_user_func",
"(",
"$",
"tabs",
",",
"$",
"this",
")",
";",
"}",
"return",
"$",
"this",
"->",
"setElements... | @param Closure|TabInterface[] $tabs
@return $this | [
"@param",
"Closure|TabInterface",
"[]",
"$tabs"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L120-L127 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.setElements | public function setElements(array $elements)
{
foreach ($elements as $label => $tab) {
if ($tab instanceof TabInterface) {
$this->addElement($tab);
} else {
$this->appendTab($tab, $label);
}
}
return $this;
} | php | public function setElements(array $elements)
{
foreach ($elements as $label => $tab) {
if ($tab instanceof TabInterface) {
$this->addElement($tab);
} else {
$this->appendTab($tab, $label);
}
}
return $this;
} | [
"public",
"function",
"setElements",
"(",
"array",
"$",
"elements",
")",
"{",
"foreach",
"(",
"$",
"elements",
"as",
"$",
"label",
"=>",
"$",
"tab",
")",
"{",
"if",
"(",
"$",
"tab",
"instanceof",
"TabInterface",
")",
"{",
"$",
"this",
"->",
"addElement... | @param array $elements
@return $this | [
"@param",
"array",
"$elements"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L134-L145 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.appendTab | public function appendTab(Renderable $display, $label, $active = false)
{
$this->addElement(
$tab = app('sleeping_owl.display')->tab($display, $label)->setActive($active)
);
return $tab;
} | php | public function appendTab(Renderable $display, $label, $active = false)
{
$this->addElement(
$tab = app('sleeping_owl.display')->tab($display, $label)->setActive($active)
);
return $tab;
} | [
"public",
"function",
"appendTab",
"(",
"Renderable",
"$",
"display",
",",
"$",
"label",
",",
"$",
"active",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"addElement",
"(",
"$",
"tab",
"=",
"app",
"(",
"'sleeping_owl.display'",
")",
"->",
"tab",
"(",
"$"... | @param Renderable $display
@param string $label
@param bool|false $active
@return TabInterface | [
"@param",
"Renderable",
"$display",
"@param",
"string",
"$label",
"@param",
"bool|false",
"$active"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L154-L161 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.setAction | public function setAction($action)
{
$this->getTabs()->each(function (TabInterface $tab) use ($action) {
if ($tab instanceof FormInterface) {
$tab->setAction($action);
}
});
return $this;
} | php | public function setAction($action)
{
$this->getTabs()->each(function (TabInterface $tab) use ($action) {
if ($tab instanceof FormInterface) {
$tab->setAction($action);
}
});
return $this;
} | [
"public",
"function",
"setAction",
"(",
"$",
"action",
")",
"{",
"$",
"this",
"->",
"getTabs",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"TabInterface",
"$",
"tab",
")",
"use",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"$",
"tab",
"instanceof",
... | @param string $action
@return $this | [
"@param",
"string",
"$action"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L180-L189 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.setId | public function setId($id)
{
$this->getTabs()->each(function (TabInterface $tab) use ($id) {
if ($tab instanceof FormInterface) {
$tab->setId($id);
}
});
return $this;
} | php | public function setId($id)
{
$this->getTabs()->each(function (TabInterface $tab) use ($id) {
if ($tab instanceof FormInterface) {
$tab->setId($id);
}
});
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"getTabs",
"(",
")",
"->",
"each",
"(",
"function",
"(",
"TabInterface",
"$",
"tab",
")",
"use",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"tab",
"instanceof",
"FormInterfa... | @param int $id
@return $this | [
"@param",
"int",
"$id"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L196-L205 |
LaravelRUS/SleepingOwlAdmin | src/Display/DisplayTabbed.php | DisplayTabbed.validateForm | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null)
{
$this->getTabs()->each(function ($tab) use ($request, $model) {
$tabId = $request->get('sleeping_owl_tab_id');
if ($tab instanceof FormInterface && $tab->getName() == $tabId)... | php | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null)
{
$this->getTabs()->each(function ($tab) use ($request, $model) {
$tabId = $request->get('sleeping_owl_tab_id');
if ($tab instanceof FormInterface && $tab->getName() == $tabId)... | [
"public",
"function",
"validateForm",
"(",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$",
"request",
",",
"ModelConfigurationInterface",
"$",
"model",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getTabs",
"(",
")",
"->",
"each",
"(",
"function",
"(... | @param \Illuminate\Http\Request $request
@param ModelConfigurationInterface $model
@return void | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Request",
"$request",
"@param",
"ModelConfigurationInterface",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/DisplayTabbed.php#L213-L222 |
LaravelRUS/SleepingOwlAdmin | src/Display/TableHeaderColumn.php | TableHeaderColumn.toArray | public function toArray()
{
$this->setHtmlAttribute('data-orderable', $this->isOrderable() ? 'true' : 'false');
return [
'attributes' => $this->htmlAttributesToString(),
'title' => $this->getTitle(),
'isOrderable' => $this->isOrderable(),
];
} | php | public function toArray()
{
$this->setHtmlAttribute('data-orderable', $this->isOrderable() ? 'true' : 'false');
return [
'attributes' => $this->htmlAttributesToString(),
'title' => $this->getTitle(),
'isOrderable' => $this->isOrderable(),
];
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'data-orderable'",
",",
"$",
"this",
"->",
"isOrderable",
"(",
")",
"?",
"'true'",
":",
"'false'",
")",
";",
"return",
"[",
"'attributes'",
"=>",
"$",
"this",
"-... | Get the instance as an array.
@return array | [
"Get",
"the",
"instance",
"as",
"an",
"array",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/TableHeaderColumn.php#L80-L89 |
LaravelRUS/SleepingOwlAdmin | src/Providers/AdminSectionsServiceProvider.php | AdminSectionsServiceProvider.policies | public function policies($namespace = null)
{
if (is_null($namespace)) {
$namespace = config('sleeping_owl.policies_namespace', '\\App\\Policies\\');
}
$policies = [];
$preparedPolicies = collect($this->policies);
foreach ($this->sections as $model => $section) ... | php | public function policies($namespace = null)
{
if (is_null($namespace)) {
$namespace = config('sleeping_owl.policies_namespace', '\\App\\Policies\\');
}
$policies = [];
$preparedPolicies = collect($this->policies);
foreach ($this->sections as $model => $section) ... | [
"public",
"function",
"policies",
"(",
"$",
"namespace",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"namespace",
")",
")",
"{",
"$",
"namespace",
"=",
"config",
"(",
"'sleeping_owl.policies_namespace'",
",",
"'\\\\App\\\\Policies\\\\'",
")",
";",
... | @param string|null $namespace
@return array | [
"@param",
"string|null",
"$namespace"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Providers/AdminSectionsServiceProvider.php#L51-L70 |
LaravelRUS/SleepingOwlAdmin | src/Display/Tree/SimpleTreeType.php | SimpleTreeType.getTree | public function getTree(\Illuminate\Database\Eloquent\Collection $collection)
{
$collection = $collection->sortBy($this->repository->getParentField())
->sortBy($this->repository->getOrderField());
return $this->getChildren(
$collection,
$this->repository->getRoot... | php | public function getTree(\Illuminate\Database\Eloquent\Collection $collection)
{
$collection = $collection->sortBy($this->repository->getParentField())
->sortBy($this->repository->getOrderField());
return $this->getChildren(
$collection,
$this->repository->getRoot... | [
"public",
"function",
"getTree",
"(",
"\\",
"Illuminate",
"\\",
"Database",
"\\",
"Eloquent",
"\\",
"Collection",
"$",
"collection",
")",
"{",
"$",
"collection",
"=",
"$",
"collection",
"->",
"sortBy",
"(",
"$",
"this",
"->",
"repository",
"->",
"getParentFi... | Get tree structure.
@param \Illuminate\Database\Eloquent\Collection $collection
@return mixed | [
"Get",
"tree",
"structure",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Tree/SimpleTreeType.php#L39-L48 |
LaravelRUS/SleepingOwlAdmin | src/Display/Tree/SimpleTreeType.php | SimpleTreeType.getChildren | protected function getChildren($collection, $id)
{
$parentField = $this->repository->getParentField();
$result = [];
foreach ($collection as $instance) {
if ((int) $instance->$parentField != $id) {
continue;
}
$instance->setRelation(
... | php | protected function getChildren($collection, $id)
{
$parentField = $this->repository->getParentField();
$result = [];
foreach ($collection as $instance) {
if ((int) $instance->$parentField != $id) {
continue;
}
$instance->setRelation(
... | [
"protected",
"function",
"getChildren",
"(",
"$",
"collection",
",",
"$",
"id",
")",
"{",
"$",
"parentField",
"=",
"$",
"this",
"->",
"repository",
"->",
"getParentField",
"(",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collecti... | Get children for simple tree type structure.
@param $collection
@param $id
@return Collection | [
"Get",
"children",
"for",
"simple",
"tree",
"type",
"structure",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Tree/SimpleTreeType.php#L91-L109 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/DateTime.php | DateTime.setModel | public function setModel(Model $model)
{
parent::setModel($model);
$this->setHtmlAttribute('data-value', $this->getModelValue());
return $this;
} | php | public function setModel(Model $model)
{
parent::setModel($model);
$this->setHtmlAttribute('data-value', $this->getModelValue());
return $this;
} | [
"public",
"function",
"setModel",
"(",
"Model",
"$",
"model",
")",
"{",
"parent",
"::",
"setModel",
"(",
"$",
"model",
")",
";",
"$",
"this",
"->",
"setHtmlAttribute",
"(",
"'data-value'",
",",
"$",
"this",
"->",
"getModelValue",
"(",
")",
")",
";",
"r... | @param Model $model
@return $this | [
"@param",
"Model",
"$model"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/DateTime.php#L34-L40 |
LaravelRUS/SleepingOwlAdmin | src/Display/Column/DateTime.php | DateTime.getFormatedDate | protected function getFormatedDate($date)
{
if (! is_null($date)) {
if (! ($date instanceof Carbon)) {
$date = Carbon::parse($date);
}
$date = $date->timezone($this->getTimezone())->format($this->getFormat());
}
return $date;
} | php | protected function getFormatedDate($date)
{
if (! is_null($date)) {
if (! ($date instanceof Carbon)) {
$date = Carbon::parse($date);
}
$date = $date->timezone($this->getTimezone())->format($this->getFormat());
}
return $date;
} | [
"protected",
"function",
"getFormatedDate",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"date",
")",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"date",
"instanceof",
"Carbon",
")",
")",
"{",
"$",
"date",
"=",
"Carbon",
"::",
"parse",
... | @param string $date
@return null|string | [
"@param",
"string",
"$date"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Display/Column/DateTime.php#L60-L71 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Forms/ManyToMany.php | ManyToMany.initializeRelatedElement | protected function initializeRelatedElement()
{
$select = $this->getRelatedElement();
$select->setName($name = $this->getRelatedForeignKeyName());
$select->setModelAttributeKey($name);
$select->setPath($this->getEmptyRelation()->getRelated()->getKeyName());
$select->setModel... | php | protected function initializeRelatedElement()
{
$select = $this->getRelatedElement();
$select->setName($name = $this->getRelatedForeignKeyName());
$select->setModelAttributeKey($name);
$select->setPath($this->getEmptyRelation()->getRelated()->getKeyName());
$select->setModel... | [
"protected",
"function",
"initializeRelatedElement",
"(",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getRelatedElement",
"(",
")",
";",
"$",
"select",
"->",
"setName",
"(",
"$",
"name",
"=",
"$",
"this",
"->",
"getRelatedForeignKeyName",
"(",
")",
"... | Initializes related element. First element (select) is created by default because it's many-to-many, you know. | [
"Initializes",
"related",
"element",
".",
"First",
"element",
"(",
"select",
")",
"is",
"created",
"by",
"default",
"because",
"it",
"s",
"many",
"-",
"to",
"-",
"many",
"you",
"know",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Forms/ManyToMany.php#L75-L97 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/Forms/ManyToMany.php | ManyToMany.buildRelatedMap | protected function buildRelatedMap(Collection $values): Collection
{
$relatedKey = $this->getRelatedForeignKeyName();
$chunksIterator = 0;
$chunks = [];
foreach ($values as $pivot) {
if (! array_key_exists($chunksIterator, $chunks)) {
$chunks[$chunksItera... | php | protected function buildRelatedMap(Collection $values): Collection
{
$relatedKey = $this->getRelatedForeignKeyName();
$chunksIterator = 0;
$chunks = [];
foreach ($values as $pivot) {
if (! array_key_exists($chunksIterator, $chunks)) {
$chunks[$chunksItera... | [
"protected",
"function",
"buildRelatedMap",
"(",
"Collection",
"$",
"values",
")",
":",
"Collection",
"{",
"$",
"relatedKey",
"=",
"$",
"this",
"->",
"getRelatedForeignKeyName",
"(",
")",
";",
"$",
"chunksIterator",
"=",
"0",
";",
"$",
"chunks",
"=",
"[",
... | @param \Illuminate\Support\Collection $values
@return Collection | [
"@param",
"\\",
"Illuminate",
"\\",
"Support",
"\\",
"Collection",
"$values"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/Forms/ManyToMany.php#L121-L146 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.assetPath | public function assetPath($path = null)
{
return ! is_null($path) ? $this->assetDir().'/'.ltrim($path, '/') : $this->assetDir();
} | php | public function assetPath($path = null)
{
return ! is_null($path) ? $this->assetDir().'/'.ltrim($path, '/') : $this->assetDir();
} | [
"public",
"function",
"assetPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"return",
"!",
"is_null",
"(",
"$",
"path",
")",
"?",
"$",
"this",
"->",
"assetDir",
"(",
")",
".",
"'/'",
".",
"ltrim",
"(",
"$",
"path",
",",
"'/'",
")",
":",
"$",
"t... | Генерация относительно пути до asset файлов для текущей темы.
@param string $path относительный путь до файла, например `js/app.js`
@return string | [
"Генерация",
"относительно",
"пути",
"до",
"asset",
"файлов",
"для",
"текущей",
"темы",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L103-L106 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.makeTitle | public function makeTitle($title, $separator = ' | ')
{
if (empty($title)) {
return $this->getTitle();
}
return $title."{$separator}".$this->getTitle();
} | php | public function makeTitle($title, $separator = ' | ')
{
if (empty($title)) {
return $this->getTitle();
}
return $title."{$separator}".$this->getTitle();
} | [
"public",
"function",
"makeTitle",
"(",
"$",
"title",
",",
"$",
"separator",
"=",
"' | '",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"title",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getTitle",
"(",
")",
";",
"}",
"return",
"$",
"title",
".",
"... | @param string $title
@param string $separator
@return string | [
"@param",
"string",
"$title",
"@param",
"string",
"$separator"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L122-L129 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.getViewPath | public function getViewPath($view)
{
if ($view instanceof View) {
return $view->getPath();
}
if (strpos($view, '::') !== false) {
return $view;
}
return $this->getViewNamespace().'.'.$view;
} | php | public function getViewPath($view)
{
if ($view instanceof View) {
return $view->getPath();
}
if (strpos($view, '::') !== false) {
return $view;
}
return $this->getViewNamespace().'.'.$view;
} | [
"public",
"function",
"getViewPath",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"$",
"view",
"instanceof",
"View",
")",
"{",
"return",
"$",
"view",
"->",
"getPath",
"(",
")",
";",
"}",
"if",
"(",
"strpos",
"(",
"$",
"view",
",",
"'::'",
")",
"!==",
"... | @param string $view
@return string | [
"@param",
"string",
"$view"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L136-L147 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.view | public function view($view, array $data = [], $mergeData = [])
{
$data['template'] = $this;
if ($view instanceof View) {
return $view->with($data);
}
return view($this->getViewPath($view), $data, $mergeData);
} | php | public function view($view, array $data = [], $mergeData = [])
{
$data['template'] = $this;
if ($view instanceof View) {
return $view->with($data);
}
return view($this->getViewPath($view), $data, $mergeData);
} | [
"public",
"function",
"view",
"(",
"$",
"view",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"mergeData",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"[",
"'template'",
"]",
"=",
"$",
"this",
";",
"if",
"(",
"$",
"view",
"instanceof",
"View",
... | @param string|View $view
@param array $data
@param array $mergeData
@return \Illuminate\Contracts\View\Factory|View | [
"@param",
"string|View",
"$view",
"@param",
"array",
"$data",
"@param",
"array",
"$mergeData"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L156-L165 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.renderBreadcrumbs | public function renderBreadcrumbs($key)
{
if (config('sleeping_owl.breadcrumbs')) {
$this->breadcrumbs()->setView(
$this->getViewPath('_partials.breadcrumbs')
);
return $this->breadcrumbs()->renderIfExists($key);
}
} | php | public function renderBreadcrumbs($key)
{
if (config('sleeping_owl.breadcrumbs')) {
$this->breadcrumbs()->setView(
$this->getViewPath('_partials.breadcrumbs')
);
return $this->breadcrumbs()->renderIfExists($key);
}
} | [
"public",
"function",
"renderBreadcrumbs",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"config",
"(",
"'sleeping_owl.breadcrumbs'",
")",
")",
"{",
"$",
"this",
"->",
"breadcrumbs",
"(",
")",
"->",
"setView",
"(",
"$",
"this",
"->",
"getViewPath",
"(",
"'_partial... | @param string $key
@return string | [
"@param",
"string",
"$key"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L172-L181 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.setGlobalVariables | protected function setGlobalVariables()
{
$globalVars = $this->admin->scriptVariables();
foreach ($globalVars as $var => $value) {
$this->meta->putGlobalVar($var, $value);
}
} | php | protected function setGlobalVariables()
{
$globalVars = $this->admin->scriptVariables();
foreach ($globalVars as $var => $value) {
$this->meta->putGlobalVar($var, $value);
}
} | [
"protected",
"function",
"setGlobalVariables",
"(",
")",
"{",
"$",
"globalVars",
"=",
"$",
"this",
"->",
"admin",
"->",
"scriptVariables",
"(",
")",
";",
"foreach",
"(",
"$",
"globalVars",
"as",
"$",
"var",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"-... | Регистрация стандартны�
глобальны�
Javascript перменны�
. | [
"Регистрация",
"стандартны�",
"глобальны�",
"Javascript",
"перменны�",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L199-L206 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.renderMeta | public function renderMeta($title)
{
$this->setGlobalVariables();
return $this->meta()
->setTitle($this->makeTitle($title))
->addMeta(['charset' => 'utf-8'], 'meta::charset')
->addMeta(['content' => csrf_token(), 'name' => 'csrf-token'])
->addMeta(['c... | php | public function renderMeta($title)
{
$this->setGlobalVariables();
return $this->meta()
->setTitle($this->makeTitle($title))
->addMeta(['charset' => 'utf-8'], 'meta::charset')
->addMeta(['content' => csrf_token(), 'name' => 'csrf-token'])
->addMeta(['c... | [
"public",
"function",
"renderMeta",
"(",
"$",
"title",
")",
"{",
"$",
"this",
"->",
"setGlobalVariables",
"(",
")",
";",
"return",
"$",
"this",
"->",
"meta",
"(",
")",
"->",
"setTitle",
"(",
"$",
"this",
"->",
"makeTitle",
"(",
"$",
"title",
")",
")"... | @param string $title
@return string | [
"@param",
"string",
"$title"
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L213-L224 |
LaravelRUS/SleepingOwlAdmin | src/Templates/Template.php | Template.toArray | public function toArray()
{
return [
'asset_dir' => $this->assetDir(),
'view_namespace' => $this->getViewNamespace(),
'name' => $this->name(),
'version' => $this->version(),
'homepage' => $this->homepage(),
];
} | php | public function toArray()
{
return [
'asset_dir' => $this->assetDir(),
'view_namespace' => $this->getViewNamespace(),
'name' => $this->name(),
'version' => $this->version(),
'homepage' => $this->homepage(),
];
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"[",
"'asset_dir'",
"=>",
"$",
"this",
"->",
"assetDir",
"(",
")",
",",
"'view_namespace'",
"=>",
"$",
"this",
"->",
"getViewNamespace",
"(",
")",
",",
"'name'",
"=>",
"$",
"this",
"->",
"name",
... | Render func.
@return array | [
"Render",
"func",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Templates/Template.php#L230-L239 |
LaravelRUS/SleepingOwlAdmin | src/Form/Related/HasUniqueValidation.php | HasUniqueValidation.unique | public function unique(array $columns, string $message = null)
{
$this->initializeUniqueValidator($message);
$this->unique = $columns;
return $this;
} | php | public function unique(array $columns, string $message = null)
{
$this->initializeUniqueValidator($message);
$this->unique = $columns;
return $this;
} | [
"public",
"function",
"unique",
"(",
"array",
"$",
"columns",
",",
"string",
"$",
"message",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"initializeUniqueValidator",
"(",
"$",
"message",
")",
";",
"$",
"this",
"->",
"unique",
"=",
"$",
"columns",
";",
"r... | Columns, that should be unique.
@param array $columns
@param string|null $message
@return static | [
"Columns",
"that",
"should",
"be",
"unique",
"."
] | train | https://github.com/LaravelRUS/SleepingOwlAdmin/blob/b91cde14fcf523cd3bdd71051212c162e2c9b7ea/src/Form/Related/HasUniqueValidation.php#L19-L25 |
oscarotero/Gettext | src/Extractors/JsCode.php | JsCode.fromString | public static function fromString($string, Translations $translations, array $options = [])
{
$options += static::$options;
$functions = new JsFunctionsScanner($string);
$functions->saveGettextFunctions($translations, $options);
} | php | public static function fromString($string, Translations $translations, array $options = [])
{
$options += static::$options;
$functions = new JsFunctionsScanner($string);
$functions->saveGettextFunctions($translations, $options);
} | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"string",
",",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"static",
"::",
"$",
"options",
";",
"$",
"functions",
"=",
"new",
... | {@inheritdoc}
@throws \Exception | [
"{"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Extractors/JsCode.php#L42-L48 |
oscarotero/Gettext | src/Generators/YamlDictionary.php | YamlDictionary.toString | public static function toString(Translations $translations, array $options = [])
{
$options += static::$options;
return YamlDumper::dump(
self::toArray($translations, $options['includeHeaders']),
$options['inline'],
$options['indent']
);
} | php | public static function toString(Translations $translations, array $options = [])
{
$options += static::$options;
return YamlDumper::dump(
self::toArray($translations, $options['includeHeaders']),
$options['inline'],
$options['indent']
);
} | [
"public",
"static",
"function",
"toString",
"(",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"static",
"::",
"$",
"options",
";",
"return",
"YamlDumper",
"::",
"dump",
"(",
"self",
"::... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Generators/YamlDictionary.php#L22-L31 |
oscarotero/Gettext | src/Generators/Xliff.php | Xliff.toString | public static function toString(Translations $translations, array $options = [])
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
$xliff = $dom->appendChild($dom->createElement('xliff'));
$xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0');
... | php | public static function toString(Translations $translations, array $options = [])
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
$xliff = $dom->appendChild($dom->createElement('xliff'));
$xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0');
... | [
"public",
"static",
"function",
"toString",
"(",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"dom",
"->",
"formatOutput",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Generators/Xliff.php#L13-L82 |
oscarotero/Gettext | src/Utils/CsvTrait.php | CsvTrait.supportsCsvEscapeChar | private static function supportsCsvEscapeChar()
{
if (self::$csvEscapeChar === null) {
self::$csvEscapeChar = version_compare(PHP_VERSION, '5.5.4') >= 0;
}
return self::$csvEscapeChar;
} | php | private static function supportsCsvEscapeChar()
{
if (self::$csvEscapeChar === null) {
self::$csvEscapeChar = version_compare(PHP_VERSION, '5.5.4') >= 0;
}
return self::$csvEscapeChar;
} | [
"private",
"static",
"function",
"supportsCsvEscapeChar",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"csvEscapeChar",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"csvEscapeChar",
"=",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.5.4'",
")",
">=",
"0",
... | Check whether support the escape_char argument to fgetcsv/fputcsv or not
@return bool | [
"Check",
"whether",
"support",
"the",
"escape_char",
"argument",
"to",
"fgetcsv",
"/",
"fputcsv",
"or",
"not"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Utils/CsvTrait.php#L17-L24 |
oscarotero/Gettext | src/Utils/CsvTrait.php | CsvTrait.fgetcsv | private static function fgetcsv($handle, $options)
{
if (self::supportsCsvEscapeChar()) {
return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure'], $options['escape_char']);
}
return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure']);
} | php | private static function fgetcsv($handle, $options)
{
if (self::supportsCsvEscapeChar()) {
return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure'], $options['escape_char']);
}
return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure']);
} | [
"private",
"static",
"function",
"fgetcsv",
"(",
"$",
"handle",
",",
"$",
"options",
")",
"{",
"if",
"(",
"self",
"::",
"supportsCsvEscapeChar",
"(",
")",
")",
"{",
"return",
"fgetcsv",
"(",
"$",
"handle",
",",
"0",
",",
"$",
"options",
"[",
"'delimite... | @param resource $handle
@param array $options
@return array | [
"@param",
"resource",
"$handle",
"@param",
"array",
"$options"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Utils/CsvTrait.php#L32-L39 |
oscarotero/Gettext | src/Utils/CsvTrait.php | CsvTrait.fputcsv | private static function fputcsv($handle, $fields, $options)
{
if (self::supportsCsvEscapeChar()) {
return fputcsv($handle, $fields, $options['delimiter'], $options['enclosure'], $options['escape_char']);
}
return fputcsv($handle, $fields, $options['delimiter'], $options['enclosu... | php | private static function fputcsv($handle, $fields, $options)
{
if (self::supportsCsvEscapeChar()) {
return fputcsv($handle, $fields, $options['delimiter'], $options['enclosure'], $options['escape_char']);
}
return fputcsv($handle, $fields, $options['delimiter'], $options['enclosu... | [
"private",
"static",
"function",
"fputcsv",
"(",
"$",
"handle",
",",
"$",
"fields",
",",
"$",
"options",
")",
"{",
"if",
"(",
"self",
"::",
"supportsCsvEscapeChar",
"(",
")",
")",
"{",
"return",
"fputcsv",
"(",
"$",
"handle",
",",
"$",
"fields",
",",
... | @param resource $handle
@param array $fields
@param array $options
@return bool|int | [
"@param",
"resource",
"$handle",
"@param",
"array",
"$fields",
"@param",
"array",
"$options"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Utils/CsvTrait.php#L48-L55 |
oscarotero/Gettext | src/Extractors/Extractor.php | Extractor.fromFile | public static function fromFile($file, Translations $translations, array $options = [])
{
foreach (self::getFiles($file) as $file) {
$options['file'] = $file;
static::fromString(self::readFile($file), $translations, $options);
}
} | php | public static function fromFile($file, Translations $translations, array $options = [])
{
foreach (self::getFiles($file) as $file) {
$options['file'] = $file;
static::fromString(self::readFile($file), $translations, $options);
}
} | [
"public",
"static",
"function",
"fromFile",
"(",
"$",
"file",
",",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"self",
"::",
"getFiles",
"(",
"$",
"file",
")",
"as",
"$",
"file",
")",
"{... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Extractors/Extractor.php#L14-L20 |
oscarotero/Gettext | src/Extractors/Extractor.php | Extractor.getFiles | protected static function getFiles($file)
{
if (empty($file)) {
throw new InvalidArgumentException('There is not any file defined');
}
if (is_string($file)) {
if (!is_file($file)) {
throw new InvalidArgumentException("'$file' is not a valid file");
... | php | protected static function getFiles($file)
{
if (empty($file)) {
throw new InvalidArgumentException('There is not any file defined');
}
if (is_string($file)) {
if (!is_file($file)) {
throw new InvalidArgumentException("'$file' is not a valid file");
... | [
"protected",
"static",
"function",
"getFiles",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'There is not any file defined'",
")",
";",
"}",
"if",
"(",
"is_string",
"(",
... | Checks and returns all files.
@param string|array $file The file/s
@return array The file paths | [
"Checks",
"and",
"returns",
"all",
"files",
"."
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Extractors/Extractor.php#L29-L58 |
oscarotero/Gettext | src/Extractors/Extractor.php | Extractor.readFile | protected static function readFile($file)
{
$length = filesize($file);
if (!($fd = fopen($file, 'rb'))) {
throw new Exception("Cannot read the file '$file', probably permissions");
}
$content = $length ? fread($fd, $length) : '';
fclose($fd);
return $co... | php | protected static function readFile($file)
{
$length = filesize($file);
if (!($fd = fopen($file, 'rb'))) {
throw new Exception("Cannot read the file '$file', probably permissions");
}
$content = $length ? fread($fd, $length) : '';
fclose($fd);
return $co... | [
"protected",
"static",
"function",
"readFile",
"(",
"$",
"file",
")",
"{",
"$",
"length",
"=",
"filesize",
"(",
"$",
"file",
")",
";",
"if",
"(",
"!",
"(",
"$",
"fd",
"=",
"fopen",
"(",
"$",
"file",
",",
"'rb'",
")",
")",
")",
"{",
"throw",
"ne... | Reads and returns the content of a file.
@param string $file
@return string | [
"Reads",
"and",
"returns",
"the",
"content",
"of",
"a",
"file",
"."
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Extractors/Extractor.php#L67-L79 |
oscarotero/Gettext | src/Utils/FunctionsScanner.php | FunctionsScanner.saveGettextFunctions | public function saveGettextFunctions(Translations $translations, array $options)
{
$functions = $options['functions'];
$file = $options['file'];
foreach ($this->getFunctions($options['constants']) as $function) {
list($name, $line, $args) = $function;
if (isset($opt... | php | public function saveGettextFunctions(Translations $translations, array $options)
{
$functions = $options['functions'];
$file = $options['file'];
foreach ($this->getFunctions($options['constants']) as $function) {
list($name, $line, $args) = $function;
if (isset($opt... | [
"public",
"function",
"saveGettextFunctions",
"(",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
")",
"{",
"$",
"functions",
"=",
"$",
"options",
"[",
"'functions'",
"]",
";",
"$",
"file",
"=",
"$",
"options",
"[",
"'file'",
"]",
";",
... | Search for specific functions and create translations.
@param Translations $translations The translations instance where save the values
@param array $options The extractor options
@throws Exception | [
"Search",
"for",
"specific",
"functions",
"and",
"create",
"translations",
"."
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Utils/FunctionsScanner.php#L26-L139 |
oscarotero/Gettext | src/Generators/PhpArray.php | PhpArray.generate | public static function generate(Translations $translations, array $options = [])
{
$options += static::$options;
return self::toArray($translations, $options['includeHeaders'], true);
} | php | public static function generate(Translations $translations, array $options = [])
{
$options += static::$options;
return self::toArray($translations, $options['includeHeaders'], true);
} | [
"public",
"static",
"function",
"generate",
"(",
"Translations",
"$",
"translations",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"+=",
"static",
"::",
"$",
"options",
";",
"return",
"self",
"::",
"toArray",
"(",
"$",
"translat... | Generates an array with the translations.
@param Translations $translations
@param array $options
@return array | [
"Generates",
"an",
"array",
"with",
"the",
"translations",
"."
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Generators/PhpArray.php#L34-L39 |
oscarotero/Gettext | src/Generators/Generator.php | Generator.toFile | public static function toFile(Translations $translations, $file, array $options = [])
{
$content = static::toString($translations, $options);
if (file_put_contents($file, $content) === false) {
return false;
}
return true;
} | php | public static function toFile(Translations $translations, $file, array $options = [])
{
$content = static::toString($translations, $options);
if (file_put_contents($file, $content) === false) {
return false;
}
return true;
} | [
"public",
"static",
"function",
"toFile",
"(",
"Translations",
"$",
"translations",
",",
"$",
"file",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"content",
"=",
"static",
"::",
"toString",
"(",
"$",
"translations",
",",
"$",
"options",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Gettext/blob/2a3fe4b5b22c6a73099b7ac074713ae471258ebe/src/Generators/Generator.php#L12-L21 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.