Category extends AbstractEntity
Category
Tags
Table of Contents
$id | int | |
---|---|---|
$name | string | |
$hierarchy | int | |
$sort_no | int | |
$create_date | DateTime | |
$update_date | DateTime | |
$ProductCategories | Collection | |
$Children | Collection | |
$Parent | Category | |
$Creator | Member | |
$AnnotationReader | ||
__toString() | string | |
countBranches() | int | |
calcChildrenSortNo() | Category | |
getParents() | mixed | |
getPath() | mixed | |
getNameWithLevel() | mixed | |
getDescendants() | mixed | |
getSelfAndDescendants() | mixed | |
hasProductCategories() | カテゴリに紐づく商品があるかどうかを調べる. | bool |
__construct() | Constructor | mixed |
getId() | Get id. | int |
setName() | Set name. | Category |
getName() | Get name. | string |
setHierarchy() | Set hierarchy. | Category |
getHierarchy() | Get hierarchy. | int |
setSortNo() | Set sortNo. | Category |
getSortNo() | Get sortNo. | int |
setCreateDate() | Set createDate. | Category |
getCreateDate() | Get createDate. | DateTime |
setUpdateDate() | Set updateDate. | Category |
getUpdateDate() | Get updateDate. | DateTime |
addProductCategory() | Add productCategory. | Category |
removeProductCategory() | Remove productCategory. | bool |
getProductCategories() | Get productCategories. | Collection |
addChild() | Add child. | Category |
removeChild() | Remove child. | bool |
getChildren() | Get children. | Collection |
setParent() | Set parent. | Category |
getParent() | Get parent. | Category|null |
setCreator() | Set creator. | Category |
getCreator() | Get creator. | Member|null |
offsetExists() | mixed | |
offsetSet() | mixed | |
offsetGet() | mixed | |
offsetUnset() | mixed | |
setPropertiesFromArray() | 引数の連想配列を元にプロパティを設定します. | mixed |
toArray() | Convert to associative array. | array |
toNormalizedArray() | Convert to associative array, and normalize to association properties. | array |
toJSON() | Convert to JSON. | string |
toXML() | Convert to XML. | string |
copyProperties() | コピー元のオブジェクトのフィールド名を指定して、同名のフィールドに値をコピー | AbstractEntity |
setAnnotationReader() | Set AnnotationReader. | AbstractEntity |
getAnnotationReader() | Get AnnotationReader. | Reader |
getEntityIdentifierAsArray() | Convert to Entity of Identity value to associative array. | array |
Properties
$id
private
int
$id
Tags
$name
private
string
$name
Tags
$hierarchy
private
int
$hierarchy
Tags
$sort_no
private
int
$sort_no
Tags
$create_date
private
DateTime
$create_date
Tags
$update_date
private
DateTime
$update_date
Tags
$ProductCategories
private
Collection
$ProductCategories
Tags
$Children
private
Collection
$Children
Tags
$Parent
private
Category
$Parent
Tags
$Creator
private
Member
$Creator
Tags
$AnnotationReader
private
mixed
$AnnotationReader
Methods
__toString()
public
__toString(
)
: string
Return values
stringcountBranches()
public
countBranches(
)
: int
Return values
intcalcChildrenSortNo()
public
calcChildrenSortNo(
$em :
EntityManager
, $sortNo :
int
)
: Category
Parameters
- $em : EntityManager
- $sortNo : int
Return values
CategorygetParents()
public
getParents(
)
: mixed
Return values
mixedgetPath()
public
getPath(
)
: mixed
Return values
mixedgetNameWithLevel()
public
getNameWithLevel(
)
: mixed
Return values
mixedgetDescendants()
public
getDescendants(
)
: mixed
Return values
mixedgetSelfAndDescendants()
public
getSelfAndDescendants(
)
: mixed
Return values
mixedhasProductCategories()
カテゴリに紐づく商品があるかどうかを調べる.
public
hasProductCategories(
)
: bool
ProductCategoriesはExtra Lazyのため, lengthやcountで評価した際にはCOUNTのSQLが発行されるが, COUNT自体が重いので, LIMIT 1で取得し存在チェックを行う.
Tags
Return values
bool__construct()
Constructor
public
__construct(
)
: mixed
Return values
mixedgetId()
Get id.
public
getId(
)
: int
Return values
intsetName()
Set name.
public
setName(
$name :
string
)
: Category
Parameters
- $name : string
Return values
CategorygetName()
Get name.
public
getName(
)
: string
Return values
stringsetHierarchy()
Set hierarchy.
public
setHierarchy(
$hierarchy :
int
)
: Category
Parameters
- $hierarchy : int
Return values
CategorygetHierarchy()
Get hierarchy.
public
getHierarchy(
)
: int
Return values
intsetSortNo()
Set sortNo.
public
setSortNo(
$sortNo :
int
)
: Category
Parameters
- $sortNo : int
Return values
CategorygetSortNo()
Get sortNo.
public
getSortNo(
)
: int
Return values
intsetCreateDate()
Set createDate.
public
setCreateDate(
$createDate :
DateTime
)
: Category
Parameters
- $createDate : DateTime
Return values
CategorygetCreateDate()
Get createDate.
public
getCreateDate(
)
: DateTime
Return values
DateTimesetUpdateDate()
Set updateDate.
public
setUpdateDate(
$updateDate :
DateTime
)
: Category
Parameters
- $updateDate : DateTime
Return values
CategorygetUpdateDate()
Get updateDate.
public
getUpdateDate(
)
: DateTime
Return values
DateTimeaddProductCategory()
Add productCategory.
public
addProductCategory(
$productCategory :
ProductCategory
)
: Category
Parameters
- $productCategory : ProductCategory
Return values
CategoryremoveProductCategory()
Remove productCategory.
public
removeProductCategory(
$productCategory :
ProductCategory
)
: bool
Parameters
- $productCategory : ProductCategory
Return values
bool —TRUE if this collection contained the specified element, FALSE otherwise.
getProductCategories()
Get productCategories.
public
getProductCategories(
)
: Collection
Return values
CollectionaddChild()
Add child.
public
addChild(
$child :
Category
)
: Category
Parameters
- $child : Category
Return values
CategoryremoveChild()
Remove child.
public
removeChild(
$child :
Category
)
: bool
Parameters
- $child : Category
Return values
bool —TRUE if this collection contained the specified element, FALSE otherwise.
getChildren()
Get children.
public
getChildren(
)
: Collection
Return values
CollectionsetParent()
Set parent.
public
setParent(
[ $parent :
Category|null
= null ]
)
: Category
Parameters
- $parent : Category|null = null
Return values
CategorygetParent()
Get parent.
public
getParent(
)
: Category|null
Return values
Category|nullsetCreator()
Set creator.
public
setCreator(
[ $creator :
Member|null
= null ]
)
: Category
Parameters
- $creator : Member|null = null
Return values
CategorygetCreator()
Get creator.
public
getCreator(
)
: Member|null
Return values
Member|nulloffsetExists()
public
offsetExists(
$offset :
mixed
)
: mixed
Parameters
- $offset : mixed
Return values
mixedoffsetSet()
public
offsetSet(
$offset :
mixed
, $value :
mixed
)
: mixed
Parameters
- $offset : mixed
- $value : mixed
Return values
mixedoffsetGet()
public
offsetGet(
$offset :
mixed
)
: mixed
Parameters
- $offset : mixed
Return values
mixedoffsetUnset()
public
offsetUnset(
$offset :
mixed
)
: mixed
Parameters
- $offset : mixed
Return values
mixedsetPropertiesFromArray()
引数の連想配列を元にプロパティを設定します.
public
setPropertiesFromArray(
$arrProps :
array
[, $excludeAttribute :
string[]
= [] ]
[, $parentClass :
ReflectionClass
= null ]
)
: mixed
DBから取り出した連想配列を, プロパティへ設定する際に使用します.
Parameters
- $arrProps : array
プロパティの情報を格納した連想配列
- $excludeAttribute : string[] = []
除外したいフィールド名の配列
- $parentClass : ReflectionClass = null
親のクラス. 本メソッドの内部的に使用します.
Return values
mixedtoArray()
Convert to associative array.
public
toArray(
[ $excludeAttribute :
array
= ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader'] ]
[, $parentClass :
ReflectionClass
= null ]
)
: array
Symfony Serializer Component is expensive, and hard to implementation. Use for encoder only.
Parameters
- $excludeAttribute : array = ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader']
Array of field names to exclusion.
- $parentClass : ReflectionClass = null
parent class. Use internally of this method..
Return values
arraytoNormalizedArray()
Convert to associative array, and normalize to association properties.
public
toNormalizedArray(
[ $excludeAttribute :
array
= ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader'] ]
)
: array
The type conversion such as:
- Datetime :: W3C datetime format string
- AbstractEntity :: associative array such as [id => value]
- PersistentCollection :: associative array of [[id => value], [id => value], ...]
Parameters
- $excludeAttribute : array = ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader']
Array of field names to exclusion.
Return values
arraytoJSON()
Convert to JSON.
public
toJSON(
[ $excludeAttribute :
array
= ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader'] ]
)
: string
Parameters
- $excludeAttribute : array = ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader']
Array of field names to exclusion.
Return values
stringtoXML()
Convert to XML.
public
toXML(
[ $excludeAttribute :
array
= ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader'] ]
)
: string
Parameters
- $excludeAttribute : array = ['__initializer__', '__cloner__', '__isInitialized__', 'AnnotationReader']
Array of field names to exclusion.
Return values
stringcopyProperties()
コピー元のオブジェクトのフィールド名を指定して、同名のフィールドに値をコピー
public
copyProperties(
$srcObject :
object
[, $excludeAttribute :
string[]
= [] ]
)
: AbstractEntity
Parameters
- $srcObject : object
コピー元のオブジェクト
- $excludeAttribute : string[] = []
除外したいフィールド名の配列
Return values
AbstractEntitysetAnnotationReader()
Set AnnotationReader.
public
setAnnotationReader(
$Reader :
Reader
)
: AbstractEntity
Parameters
- $Reader : Reader
Return values
AbstractEntitygetAnnotationReader()
Get AnnotationReader.
public
getAnnotationReader(
)
: Reader
Return values
ReadergetEntityIdentifierAsArray()
Convert to Entity of Identity value to associative array.
public
getEntityIdentifierAsArray(
$Entity :
AbstractEntity
)
: array
Parameters
- $Entity : AbstractEntity
Return values
array —associative array of [[id => value], [id => value], ...]