PHP 클래스 app\Category

상속: extends Illuminate\Database\Eloquent\Model
파일 보기 프로젝트 열기: ant-vel/antVel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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