PHP Class Product, yupe

User: John Kagga Date: 8/1/2015 Time: 9:46 AM
Show file Open project: yupe/yupe Class Usage Examples

Public Properties

Property Type Description
$selectedVariants array

Protected Properties

Property Type Description
$_attributesValues array
$_typeAttributes
$_variantsOptions кеш getVariantsOptions

Public Methods

Method Description
attribute ( $attribute, null $default = null ) : boolean | float | integer | null | string | array
attributeDescriptions ( ) : array
attributeFile ( $attribute ) : string
attributeLabels ( ) : array
attributes ( )
beforeDelete ( ) : boolean
beforeValidate ( ) : boolean
behaviors ( ) : array
copy ( ) : null | Product
getAttributeGroups ( ) : array
getBasePrice ( ) : float
getCategoriesId ( ) : mixed
getCategoryId ( ) : null | string
getDiscountPrice ( ) : float
getId ( ) : mixed
getImageAlt ( ) : string Get image alt tag text
getImageTitle ( ) : string Get image title tag text
getImages ( ) : ProductImage[]
getInStockList ( ) : array
getLink ( ) : mixed
getLinkedProducts ( null | string $typeCode = null ) : Product[] Список связанных с продуктом продуктов
getLinkedProductsCriteria ( null | string $typeCode = null ) : CDbCriteria
getLinkedProductsDataProvider ( null | string $typeCode = null ) : CActiveDataProvider
getMetaCanonical ( ) : string Get canonical url
getMetaDescription ( ) : string
getMetaKeywords ( ) : string
getMetaTitle ( ) : string
getName ( ) : string
getPrice ( array $variantsIds = [] ) : float | mixed
getProducerName ( ) : null | string
getResultPrice ( ) : float
getSpecial ( ) : string
getSpecialList ( ) : array
getStatusList ( ) : array
getStatusTitle ( ) : string
getTitle ( ) : string
getTypeAttributes ( ) : array
getTypesAttributesValues ( ) : array
getVariants ( ) : ProductVariant[]
getVariantsGroup ( ) : array
getVariantsOptions ( ) : array Функция для подготовки специфичных настроек элементов option в select при выводе вариантов, которые будут использоваться в js при работе с вариантами
hasDiscount ( ) : boolean
isInStock ( ) : integer
isSpecial ( ) : integer
link ( $product, null $type_id = null ) : boolean Связывает продукты
model ( string $className = __CLASS__ ) : Product Returns the static model of the specified AR class.
relations ( ) : array
rules ( ) : array
saveCategories ( array $categoriesId ) : boolean Устанавливает дополнительные категории товара
saveData ( array $attributes, array $typeAttributes, array $variants, array $categories = [] ) : boolean
saveTypeAttributes ( array $attributes ) : boolean
scopes ( ) : array
search ( ) : CActiveDataProvider Retrieves a list of models based on the current search/filter conditions.
setEmptyQuantity ( )
setTypeAttributes ( array $attributes )
tableName ( ) : string

Protected Methods

Method Description
loadAttributes ( )

Private Methods

Method Description
saveVariants ( array $variants ) : boolean

Method Details

attribute() public method

public attribute ( $attribute, null $default = null ) : boolean | float | integer | null | string | array
$attribute
$default null
return boolean | float | integer | null | string | array

attributeDescriptions() public method

public attributeDescriptions ( ) : array
return array customized attribute descriptions (name=>description)

attributeFile() public method

public attributeFile ( $attribute ) : string
$attribute
return string

attributeLabels() public method

public attributeLabels ( ) : array
return array customized attribute labels (name=>label)

attributes() public method

public attributes ( )

beforeDelete() public method

public beforeDelete ( ) : boolean
return boolean

beforeValidate() public method

public beforeValidate ( ) : boolean
return boolean

behaviors() public method

public behaviors ( ) : array
return array

copy() public method

public copy ( ) : null | Product
return null | Product

getAttributeGroups() public method

public getAttributeGroups ( ) : array
return array

getBasePrice() public method

public getBasePrice ( ) : float
return float

getCategoriesId() public method

public getCategoriesId ( ) : mixed
return mixed

getCategoryId() public method

public getCategoryId ( ) : null | string
return null | string

getDiscountPrice() public method

public getDiscountPrice ( ) : float
return float

getId() public method

public getId ( ) : mixed
return mixed id

getImageAlt() public method

Get image alt tag text
public getImageAlt ( ) : string
return string

getImageTitle() public method

Get image title tag text
public getImageTitle ( ) : string
return string

getImages() public method

public getImages ( ) : ProductImage[]
return ProductImage[]

getInStockList() public method

public getInStockList ( ) : array
return array

getLinkedProducts() public method

Список связанных с продуктом продуктов
public getLinkedProducts ( null | string $typeCode = null ) : Product[]
$typeCode null | string
return Product[]

getLinkedProductsCriteria() public method

public getLinkedProductsCriteria ( null | string $typeCode = null ) : CDbCriteria
$typeCode null | string
return CDbCriteria

getLinkedProductsDataProvider() public method

public getLinkedProductsDataProvider ( null | string $typeCode = null ) : CActiveDataProvider
$typeCode null | string
return CActiveDataProvider

getMetaCanonical() public method

Get canonical url
public getMetaCanonical ( ) : string
return string

getMetaDescription() public method

public getMetaDescription ( ) : string
return string

getMetaKeywords() public method

public getMetaKeywords ( ) : string
return string

getMetaTitle() public method

public getMetaTitle ( ) : string
return string

getName() public method

public getName ( ) : string
return string

getPrice() public method

public getPrice ( array $variantsIds = [] ) : float | mixed
$variantsIds array
return float | mixed

getProducerName() public method

public getProducerName ( ) : null | string
return null | string

getResultPrice() public method

public getResultPrice ( ) : float
return float

getSpecial() public method

public getSpecial ( ) : string
return string

getSpecialList() public method

public getSpecialList ( ) : array
return array

getStatusList() public method

public getStatusList ( ) : array
return array

getStatusTitle() public method

public getStatusTitle ( ) : string
return string

getTitle() public method

public getTitle ( ) : string
return string

getTypeAttributes() public method

public getTypeAttributes ( ) : array
return array

getTypesAttributesValues() public method

public getTypesAttributesValues ( ) : array
return array

getVariants() public method

public getVariants ( ) : ProductVariant[]
return ProductVariant[]

getVariantsGroup() public method

public getVariantsGroup ( ) : array
return array

getVariantsOptions() public method

Функция для подготовки специфичных настроек элементов option в select при выводе вариантов, которые будут использоваться в js при работе с вариантами
public getVariantsOptions ( ) : array
return array

hasDiscount() public method

public hasDiscount ( ) : boolean
return boolean

isInStock() public method

public isInStock ( ) : integer
return integer

isSpecial() public method

public isSpecial ( ) : integer
return integer

loadAttributes() protected method

protected loadAttributes ( )

model() public static method

Returns the static model of the specified AR class.
public static model ( string $className = __CLASS__ ) : Product
$className string active record class name.
return Product Static model class

relations() public method

public relations ( ) : array
return array relational rules.

rules() public method

public rules ( ) : array
return array validation rules for model attributes.

saveCategories() public method

Устанавливает дополнительные категории товара
public saveCategories ( array $categoriesId ) : boolean
$categoriesId array - список id категорий
return boolean

saveData() public method

public saveData ( array $attributes, array $typeAttributes, array $variants, array $categories = [] ) : boolean
$attributes array
$typeAttributes array
$variants array
$categories array
return boolean

saveTypeAttributes() public method

public saveTypeAttributes ( array $attributes ) : boolean
$attributes array
return boolean

scopes() public method

public scopes ( ) : array
return array

setEmptyQuantity() public method

public setEmptyQuantity ( )

setTypeAttributes() public method

public setTypeAttributes ( array $attributes )
$attributes array

tableName() public method

public tableName ( ) : string
return string the associated database table name

Property Details

$_attributesValues protected property

protected array $_attributesValues
return array

$_typeAttributes protected property

protected $_typeAttributes

$_variantsOptions protected property

кеш getVariantsOptions
protected $_variantsOptions

$selectedVariants public property

public array $selectedVariants
return array