PHP Класс app\Category

Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$appends array The attributes to append.
$family_tree boolean Select if return the categories family tree.
$fillable array The attributes that are mass assignable.
$table string The database table used by the model.

Открытые методы

Метод Описание
category ( )
getChildsAttribute ( ) : collection Return a collection of a category's childs, or null if don't have.
getParentAttribute ( ) : app\category Return the parent of a category, or null if don't have.
getParentTreeAttribute ( ) : app\category Return the the full tree of parents of a category, or null if don't have.
hasChildren ( )
hasChilds ( )
hasParent ( )
newCollection ( array $models = [] ) : App\Collection\Categories Override Collection Method.
parentsTree ( [int] $id, [array] &$array, [array] $fields = ['id', 'category_id', 'name'] ) parentsTree Retrieve all the categories parents of one passed through parameter, checking data from bottom to top.
product ( )
progeny ( [int] $id, &$list, [array] $fields = ['id', 'name'] ) progeny Retrieve all the categories children of one passed through parameter, checking data from bottom to top.
scopeActives ( $query )
scopeByName ( $query )
scopeChildsOf ( $query, $id ) scopeChildsOf Return all the children of a category. If the id is empty, 'parents' or 'others' will be given.
scopeFull ( [type] $query ) : [type] scopeFull Retrieve the total of products contained in a category.
scopeGroup ( $query )
scopeInactives ( $query )
scopeLightSelection ( [object] $query ) scopeLightSelection Retrieve build the query select as scope.
scopeMothers ( [type] $query ) : [type] scopeMothers Retrieve the main categories.
scopeSearch ( $query, $name )
scopeStore ( $query )
withChilds ( )
withFamilyTree ( $value = true )
withParentTree ( )

Описание методов

category() публичный метод

public category ( )

getChildsAttribute() публичный метод

Return a collection of a category's childs, or null if don't have.
public getChildsAttribute ( ) : collection
Результат collection

getParentAttribute() публичный метод

Return the parent of a category, or null if don't have.
public getParentAttribute ( ) : app\category
Результат app\category model

getParentTreeAttribute() публичный метод

The tree contains the master parent, and a child attribute that contains next element, up to.
public getParentTreeAttribute ( ) : app\category
Результат app\category model

hasChildren() публичный метод

public hasChildren ( )

hasChilds() публичный метод

public hasChilds ( )

hasParent() публичный метод

public hasParent ( )

newCollection() публичный метод

Override Collection Method.
public newCollection ( array $models = [] ) : App\Collection\Categories
$models array
Результат App\Collection\Categories Collection

parentsTree() публичный статический метод

parentsTree Retrieve all the categories parents of one passed through parameter, checking data from bottom to top.
public static parentsTree ( [int] $id, [array] &$array, [array] $fields = ['id', 'category_id', 'name'] )
$id [int]
$array [array]
$fields [array]

product() публичный метод

public product ( )

progeny() публичный статический метод

progeny Retrieve all the categories children of one passed through parameter, checking data from bottom to top.
public static progeny ( [int] $id, &$list, [array] $fields = ['id', 'name'] )
$id [int]
$fields [array]

scopeActives() публичный метод

public scopeActives ( $query )

scopeByName() публичный метод

public scopeByName ( $query )

scopeChildsOf() публичный метод

scopeChildsOf Return all the children of a category. If the id is empty, 'parents' or 'others' will be given.
public scopeChildsOf ( $query, $id )
$query
$id that can be either category id, empty value, 'parents' or 'mothers'

scopeFull() публичный метод

scopeFull Retrieve the total of products contained in a category.
public scopeFull ( [type] $query ) : [type]
$query [type]
Результат [type]

scopeGroup() публичный метод

public scopeGroup ( $query )

scopeInactives() публичный метод

public scopeInactives ( $query )

scopeLightSelection() публичный метод

scopeLightSelection Retrieve build the query select as scope.
public scopeLightSelection ( [object] $query )
$query [object]

scopeMothers() публичный метод

scopeMothers Retrieve the main categories.
public scopeMothers ( [type] $query ) : [type]
$query [type]
Результат [type]

scopeSearch() публичный метод

public scopeSearch ( $query, $name )

scopeStore() публичный метод

public scopeStore ( $query )

withChilds() публичный метод

public withChilds ( )

withFamilyTree() публичный метод

public withFamilyTree ( $value = true )

withParentTree() публичный метод

public withParentTree ( )

Описание свойств

$appends защищенное свойство

The attributes to append.
protected array $appends
Результат array

$family_tree защищенное свойство

Select if return the categories family tree.
protected bool $family_tree
Результат boolean

$fillable защищенное свойство

The attributes that are mass assignable.
protected array $fillable
Результат array

$table защищенное свойство

The database table used by the model.
protected string $table
Результат string