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