EC-CUBE4 APIドキュメント

Category extends AbstractEntity

Category

Tags
ORM\Table

(name="dtb_category")

ORM\InheritanceType

("SINGLE_TABLE")

ORM\DiscriminatorColumn

(name="discriminator_type", type="string", length=255)

ORM\HasLifecycleCallbacks

()

ORM\Entity

(repositoryClass="Eccube\Repository\CategoryRepository")

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
ORM\Column

(name="id", type="integer", options={"unsigned":true})

ORM\Id
ORM\GeneratedValue

(strategy="IDENTITY")

$name

private string $name
Tags
ORM\Column

(name="category_name", type="string", length=255)

$hierarchy

private int $hierarchy
Tags
ORM\Column

(name="hierarchy", type="integer", options={"unsigned":true})

$sort_no

private int $sort_no
Tags
ORM\Column

(name="sort_no", type="integer")

$create_date

private DateTime $create_date
Tags
ORM\Column

(name="create_date", type="datetimetz")

$update_date

private DateTime $update_date
Tags
ORM\Column

(name="update_date", type="datetimetz")

$ProductCategories

private Collection $ProductCategories
Tags
ORM\OneToMany

(targetEntity="Eccube\Entity\ProductCategory", mappedBy="Category", fetch="EXTRA_LAZY")

$Children

private Collection $Children
Tags
ORM\OneToMany

(targetEntity="Eccube\Entity\Category", mappedBy="Parent")

ORM\OrderBy

({ "sort_no"="DESC" })

$Parent

private Category $Parent
Tags
ORM\ManyToOne

(targetEntity="Eccube\Entity\Category", inversedBy="Children")

ORM\JoinColumns

({ @ORM\JoinColumn(name="parent_category_id", referencedColumnName="id") })

$Creator

private Member $Creator
Tags
ORM\ManyToOne

(targetEntity="Eccube\Entity\Member")

ORM\JoinColumns

({ @ORM\JoinColumn(name="creator_id", referencedColumnName="id") })

Methods

__toString()

public __toString( ) : string
Return values
string

countBranches()

public countBranches( ) : int
Return values
int

calcChildrenSortNo()

public calcChildrenSortNo( $em : EntityManager , $sortNo : int ) : Category
Parameters
$em : EntityManager
$sortNo : int
Return values
Category

getParents()

public getParents( ) : mixed
Return values
mixed

getPath()

public getPath( ) : mixed
Return values
mixed

getNameWithLevel()

public getNameWithLevel( ) : mixed
Return values
mixed

getDescendants()

public getDescendants( ) : mixed
Return values
mixed

getSelfAndDescendants()

public getSelfAndDescendants( ) : mixed
Return values
mixed

__construct()

Constructor

public __construct( ) : mixed
Return values
mixed

getId()

Get id.

public getId( ) : int
Return values
int

getName()

Get name.

public getName( ) : string
Return values
string

setHierarchy()

Set hierarchy.

public setHierarchy( $hierarchy : int ) : Category
Parameters
$hierarchy : int
Return values
Category

getHierarchy()

Get hierarchy.

public getHierarchy( ) : int
Return values
int

getSortNo()

Get sortNo.

public getSortNo( ) : int
Return values
int

setCreateDate()

Set createDate.

public setCreateDate( $createDate : DateTime ) : Category
Parameters
$createDate : DateTime
Return values
Category

getCreateDate()

Get createDate.

public getCreateDate( ) : DateTime
Return values
DateTime

setUpdateDate()

Set updateDate.

public setUpdateDate( $updateDate : DateTime ) : Category
Parameters
$updateDate : DateTime
Return values
Category

getUpdateDate()

Get updateDate.

public getUpdateDate( ) : DateTime
Return values
DateTime

removeProductCategory()

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
Collection

removeChild()

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
Collection

offsetExists()

public offsetExists( $offset : mixed ) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

public offsetSet( $offset : mixed , $value : mixed ) : mixed
Parameters
$offset : mixed
$value : mixed
Return values
mixed

offsetGet()

public offsetGet( $offset : mixed ) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetUnset()

public offsetUnset( $offset : mixed ) : mixed
Parameters
$offset : mixed
Return values
mixed

setPropertiesFromArray()

引数の連想配列を元にプロパティを設定します.

public setPropertiesFromArray( $arrProps : array [, $excludeAttribute : string[] = [] ] [, $parentClass : ReflectionClass = null ] ) : mixed

DBから取り出した連想配列を, プロパティへ設定する際に使用します.

Parameters
$arrProps : array

プロパティの情報を格納した連想配列

$excludeAttribute : string[] = []

除外したいフィールド名の配列

$parentClass : ReflectionClass = null

親のクラス. 本メソッドの内部的に使用します.

Return values
mixed

toArray()

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
array

toNormalizedArray()

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
array

toJSON()

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
string

toXML()

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
string

copyProperties()

コピー元のオブジェクトのフィールド名を指定して、同名のフィールドに値をコピー

public copyProperties( $srcObject : object [, $excludeAttribute : string[] = [] ] ) : AbstractEntity
Parameters
$srcObject : object

コピー元のオブジェクト

$excludeAttribute : string[] = []

除外したいフィールド名の配列

Return values
AbstractEntity

getAnnotationReader()

Get AnnotationReader.

public getAnnotationReader( ) : Reader
Return values
Reader

getEntityIdentifierAsArray()

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], ...]

Search results