PHP Class Elcodi\Component\Product\Entity\Product

Inheritance: extends Elcodi\Component\Core\Entity\Abstracts\AbstractEntity, implements Elcodi\Component\Product\Entity\Interfaces\ProductInterface, use trait Elcodi\Component\Product\Entity\Traits\ProductPriceTrait, use trait Elcodi\Component\Core\Entity\Traits\DateTimeTrait, use trait Elcodi\Component\Core\Entity\Traits\EnabledTrait, use trait Elcodi\Component\Core\Entity\Traits\ETaggableTrait, use trait Elcodi\Component\MetaData\Entity\Traits\MetaDataTrait, use trait Elcodi\Component\Media\Entity\Traits\ImagesContainerTrait, use trait Elcodi\Component\Media\Entity\Traits\PrincipalImageTrait
Show file Open project: elcodi/elcodi Class Usage Examples

Protected Properties

Property Type Description
$attributes Doctrine\Common\Collections\Collection Attributes associated with this product
$principalVariant Elcodi\Component\Product\Entity\Interfaces\VariantInterface Principal variant for this product
$type integer Product type
$variants Doctrine\Common\Collections\Collection Variants for this product

Public Methods

Method Description
addAttribute ( Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface $attribute ) Adds an attribute if not already in the collection.
addCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $category ) Add category.
addVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant ) Adds a Variant for this Product.
getAttributes ( ) : Doctrine\Common\Collections\Collection Returns product attributes.
getPrincipalVariant ( ) : Elcodi\Component\Product\Entity\Interfaces\VariantInterface Returns product principal variant.
getPurchasableType ( ) : string Get purchasable type.
getType ( ) : integer Get Type.
getVariants ( ) : Doctrine\Common\Collections\Collection Gets product variants.
hasVariants ( ) : boolean Tells if this product has variants.
removeAttribute ( Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface $attribute ) Removes an attribute from the collection.
removeCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $category ) Remove category.
setAttributes ( Doctrine\Common\Collections\Collection $attributes ) Sets product attributes.
setCategories ( Doctrine\Common\Collections\Collection $categories ) Set categories.
setManufacturer ( Elcodi\Component\Product\Entity\Interfaces\ManufacturerInterface $manufacturer = null ) Set product manufacturer.
setPrincipalCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $principalCategory = null ) Set the principalCategory.
setPrincipalVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $principalVariant ) Sets product principal variant.
setType ( integer $type ) Sets Type.
setVariants ( Doctrine\Common\Collections\Collection $variants ) Sets product variants.

Method Details

addAttribute() public method

Adds an attribute if not already in the collection.
public addAttribute ( Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface $attribute )
$attribute Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface Attribute

addCategory() public method

Add category.
public addCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $category )
$category Elcodi\Component\Product\Entity\Interfaces\CategoryInterface Category

addVariant() public method

Adds a Variant for this Product.
public addVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant )
$variant Elcodi\Component\Product\Entity\Interfaces\VariantInterface

getAttributes() public method

Returns product attributes.
public getAttributes ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection Attributes

getPrincipalVariant() public method

Returns product principal variant.
public getPrincipalVariant ( ) : Elcodi\Component\Product\Entity\Interfaces\VariantInterface
return Elcodi\Component\Product\Entity\Interfaces\VariantInterface

getPurchasableType() public method

Get purchasable type.
public getPurchasableType ( ) : string
return string Purchasable type

getType() public method

Get Type.
public getType ( ) : integer
return integer Type

getVariants() public method

Gets product variants.
public getVariants ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection Variants

hasVariants() public method

Tells if this product has variants.
public hasVariants ( ) : boolean
return boolean Product has variants

removeAttribute() public method

Removes an attribute from the collection.
public removeAttribute ( Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface $attribute )
$attribute Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface Attribute to be removed

removeCategory() public method

Remove category.
public removeCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $category )
$category Elcodi\Component\Product\Entity\Interfaces\CategoryInterface Category

setAttributes() public method

Sets product attributes.
public setAttributes ( Doctrine\Common\Collections\Collection $attributes )
$attributes Doctrine\Common\Collections\Collection Attributes

setCategories() public method

Set categories.
public setCategories ( Doctrine\Common\Collections\Collection $categories )
$categories Doctrine\Common\Collections\Collection Categories

setManufacturer() public method

Set product manufacturer.
public setManufacturer ( Elcodi\Component\Product\Entity\Interfaces\ManufacturerInterface $manufacturer = null )
$manufacturer Elcodi\Component\Product\Entity\Interfaces\ManufacturerInterface Manufacturer

setPrincipalCategory() public method

Set the principalCategory.
public setPrincipalCategory ( Elcodi\Component\Product\Entity\Interfaces\CategoryInterface $principalCategory = null )
$principalCategory Elcodi\Component\Product\Entity\Interfaces\CategoryInterface Principal category

setPrincipalVariant() public method

Sets product principal variant.
public setPrincipalVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $principalVariant )
$principalVariant Elcodi\Component\Product\Entity\Interfaces\VariantInterface

setType() public method

Sets Type.
public setType ( integer $type )
$type integer Type

setVariants() public method

Sets product variants.
public setVariants ( Doctrine\Common\Collections\Collection $variants )
$variants Doctrine\Common\Collections\Collection Variants

Property Details

$attributes protected property

Attributes associated with this product
protected Collection,Doctrine\Common\Collections $attributes
return Doctrine\Common\Collections\Collection

$principalVariant protected property

Principal variant for this product
protected VariantInterface,Elcodi\Component\Product\Entity\Interfaces $principalVariant
return Elcodi\Component\Product\Entity\Interfaces\VariantInterface

$type protected property

Product type
protected int $type
return integer

$variants protected property

Variants for this product
protected Collection,Doctrine\Common\Collections $variants
return Doctrine\Common\Collections\Collection