PHP Class Eccube\Entity\Category

Inheritance: extends Eccube\Entity\AbstractEntity
Mostra file Open project: ec-cube/ec-cube Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor
__toString ( ) : string
addChild ( Category $children ) : Category Add Children
addProductCategory ( Eccube\Entity\ProductCategory $productCategories ) : Category Add ProductCategories
calcChildrenRank ( EntityManager $em, integer $rank ) : Category
countBranches ( ) : integer
getChildren ( ) : Doctrine\Common\Collections\Collection Get Children
getCreateDate ( ) : DateTime Get create_date
getCreator ( ) : Eccube\Entity\Member Get Creator
getDelFlg ( ) : integer Get del_flg
getDescendants ( )
getId ( ) : integer Get id
getLevel ( ) : integer Get level
getName ( ) : string Get name
getNameWithLevel ( )
getParent ( ) : Category Get Parent
getParents ( )
getPath ( )
getProductCategories ( ) : Doctrine\Common\Collections\Collection Get ProductCategories
getRank ( ) : integer Get rank
getSelfAndDescendants ( )
getUpdateDate ( ) : DateTime Get update_date
hasProductCategories ( ) : boolean カテゴリに紐づく商品があるかどうかを調べる.
removeChild ( Category $children ) Remove Children
removeProductCategory ( Eccube\Entity\ProductCategory $productCategories ) Remove ProductCategories
setCreateDate ( DateTime $createDate ) : Category Set create_date
setCreator ( Eccube\Entity\Member $creator = null ) : Category Set Creator
setDelFlg ( integer $delFlg ) : Category Set del_flg
setLevel ( integer $level ) : Category Set level
setName ( string $name ) : Category Set name
setParent ( Category $parent = null ) : Category Set Parent
setRank ( integer $rank ) : Category Set rank
setUpdateDate ( DateTime $updateDate ) : Category Set update_date

Method Details

__construct() public method

Constructor
public __construct ( )

__toString() public method

public __toString ( ) : string
return string

addChild() public method

Add Children
public addChild ( Category $children ) : Category
$children Category
return Category

addProductCategory() public method

Add ProductCategories
public addProductCategory ( Eccube\Entity\ProductCategory $productCategories ) : Category
$productCategories Eccube\Entity\ProductCategory
return Category

calcChildrenRank() public method

public calcChildrenRank ( EntityManager $em, integer $rank ) : Category
$em Doctrine\ORM\EntityManager
$rank integer
return Category

countBranches() public method

public countBranches ( ) : integer
return integer

getChildren() public method

Get Children
public getChildren ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection

getCreateDate() public method

Get create_date
public getCreateDate ( ) : DateTime
return DateTime

getCreator() public method

Get Creator
public getCreator ( ) : Eccube\Entity\Member
return Eccube\Entity\Member

getDelFlg() public method

Get del_flg
public getDelFlg ( ) : integer
return integer

getDescendants() public method

public getDescendants ( )

getId() public method

Get id
public getId ( ) : integer
return integer

getLevel() public method

Get level
public getLevel ( ) : integer
return integer

getName() public method

Get name
public getName ( ) : string
return string

getNameWithLevel() public method

public getNameWithLevel ( )

getParent() public method

Get Parent
public getParent ( ) : Category
return Category

getParents() public method

public getParents ( )

getPath() public method

public getPath ( )

getProductCategories() public method

Get ProductCategories
public getProductCategories ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection

getRank() public method

Get rank
public getRank ( ) : integer
return integer

getSelfAndDescendants() public method

getUpdateDate() public method

Get update_date
public getUpdateDate ( ) : DateTime
return DateTime

hasProductCategories() public method

ProductCategoriesはExtra Lazyのため, lengthやcountで評価した際にはCOUNTのSQLが発行されるが, COUNT自体が重いので, LIMIT 1で取得し存在チェックを行う.
See also: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-associations.html#filtering-collections
public hasProductCategories ( ) : boolean
return boolean

removeChild() public method

Remove Children
public removeChild ( Category $children )
$children Category

removeProductCategory() public method

Remove ProductCategories
public removeProductCategory ( Eccube\Entity\ProductCategory $productCategories )
$productCategories Eccube\Entity\ProductCategory

setCreateDate() public method

Set create_date
public setCreateDate ( DateTime $createDate ) : Category
$createDate DateTime
return Category

setCreator() public method

Set Creator
public setCreator ( Eccube\Entity\Member $creator = null ) : Category
$creator Eccube\Entity\Member
return Category

setDelFlg() public method

Set del_flg
public setDelFlg ( integer $delFlg ) : Category
$delFlg integer
return Category

setLevel() public method

Set level
public setLevel ( integer $level ) : Category
$level integer
return Category

setName() public method

Set name
public setName ( string $name ) : Category
$name string
return Category

setParent() public method

Set Parent
public setParent ( Category $parent = null ) : Category
$parent Category
return Category

setRank() public method

Set rank
public setRank ( integer $rank ) : Category
$rank integer
return Category

setUpdateDate() public method

Set update_date
public setUpdateDate ( DateTime $updateDate ) : Category
$updateDate DateTime
return Category