Documentation

Shop_Item_Model extends Core_Entity
in package

Shop_Item_Model

Tags
subpackage

Shop

version
7.x
author

Hostmake LLC

copyright

© 2005-2022 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

$absolute_price  : string
Callback property_id
$adminRest  : string
Callback property_id
$config  : mixed
ORM config
$count  : string
Callback property_id
$discounts  : int
Callback property_id
$key  : string
Callback property_id
$modifications  : int
Callback property_id
$price_absolute  : mixed
$related  : int
Callback property_id
$reviews  : int
Callback property_id
$rollback  : mixed
Backend property
$_aComments  : array<string|int, mixed>
Array of comments, [parent_id] => array(comments)
$_allowedTags  : array<string|int, mixed>
Allowed tags. If list of tags is empty, all tags will show.
$_attributes  : array<string|int, mixed>
Entity Attributes
$_belongsTo  : array<string|int, mixed>
Belongs to relations
$_cartQuantity  : mixed
Количество товара в корзине
$_changeCopiedName  : bool
Change copied name is necessary, default FALSE
$_changedColumns  : array<string|int, mixed>
List of changed columns
$_commentsActivity  : string
What comments show in XML? (active|inactive|all)
$_dataValues  : array<string|int, mixed>
data-values, e.g. dataMyValue
$_forbiddenTags  : array<string|int, mixed>
Forbidden tags. If list of tags is empty, all tags will be shown.
$_hasMany  : array<string|int, mixed>
One-to-many or many-to-many relations
$_hasOne  : array<string|int, mixed>
One-to-one relations
$_hasRevisions  : mixed
Has revisions
$_incCountByCreate  : bool
Inc items'count in group during creating item
$_marksDeleted  : mixed
Marks deleted entity
$_modelColumns  : array<string|int, mixed>
List of columns in model with values
$_modelName  : mixed
Model name
$_nameColumn  : string
Column consist item's name
$_preloadValues  : array<string|int, mixed>
List of preloaded values
$_primaryKey  : string
Primary key
$_propertyValues  : array<string|int, mixed>
Values of all properties of item
$_queryBuilder  : Core_QueryBuilder_Select
Select query builder
$_reserved  : mixed
Cache for getRest()
$_rest  : mixed
Cache for getRest()
$_Shop_Item_Controller  : Shop_Item_Controller|null
$_shortcodeTags  : array<string|int, mixed>
List of Shortcodes tags
$_showXmlAssociatedItems  : bool
Show associated items data in XML
$_showXmlBarcodes  : bool
Show barcodes in XML
$_showXmlBonuses  : bool
Show bonuses in XML
$_showXmlCommentProperties  : bool
Show siteuser properties in XML
$_showXmlComments  : bool
Show comments data in XML
$_showXmlCommentsRating  : bool
Show comments rating data in XML
$_showXmlModifications  : bool
Show modifications data in XML
$_showXmlProperties  : mixed
Show properties in XML
$_showXmlSets  : bool
Show sets in XML
$_showXmlSiteuser  : bool
Show user data in XML
$_showXmlSiteuserProperties  : bool
Show siteuser properties in XML
$_showXmlSpecialprices  : bool
Show special prices data in XML
$_showXmlTabs  : bool
Show tabs data in XML
$_showXmlTags  : bool
Show tags data in XML
$_showXmlVotes  : bool
Show votes in XML
$_showXmlWarehousesItems  : bool
Show items count data in XML
$_skipColumns  : array<string|int, mixed>
List of skipped columns from table
$_sorting  : array<string|int, mixed>
Default sorting for models <code> protected $_sorting = array( 'tablename.sorting' => 'ASC' ); </code>
$_tableColumns  : array<string|int, mixed>
List of columns in table
$_tableName  : mixed
Table name, e.g. 'books' for 'Book_Model'
$_typicalForbiddenTags  : array<string|int, mixed>
Typical forbidden tags.
$_xmlSortPropertiesValues  : mixed
Sort properties values in XML
__call()  : mixed
Triggered when invoking inaccessible methods in an object context
__construct()  : mixed
Constructor.
__get()  : mixed
Utilized for reading data from inaccessible properties
__isset()  : bool
Triggered by calling isset() or empty() on inaccessible properties
__set()  : self
Run when writing data to inaccessible properties
add()  : self
Add related object. If main object does not save, it will save.
addAllowedTag()  : self
Add tag to allowed tags list
addAttribute()  : self
Add entity attribute
addEntities()  : self
Add children entities
addEntity()  : self
Add a children entity
addForbiddenTag()  : self
Add tag to forbidden tags list
addForbiddenTags()  : self
Add tags to forbidden tags list
addXmlTag()  : self
Add external tag for entity
adminChangeAssociated()  : string
Backend callback method
adminCurrency()  : string
Get item's currency
adminCurrencyBadge()  : string
Backend badge
adminMeasure()  : string
Get item's measure
adminPrice()  : string
Backend callback method
adminPriceBadge()  : string
Backend badge
adminRest()  : float
Backend callback method
adminSetAssociated()  : string
Backend callback method
adminStatus()  : string
Backend callback method
adminUnsetAssociated()  : string
Backend callback method
applyMarksDeleted()  : self
Apply markDeleted flag if is set
applyTags()  : self
Apply tags for item
applyTagsArray()  : self
Apply array tags for item
backupRevision()  : self
Backup revision
cartQuantity()  : self
Set item quantity into cart
changeActive()  : self
Change item status
changeCopiedName()  : self
Set if change copied name is necessary
changed()  : bool
Check model has been changed.
check()  : self
Check model values. If model has incorrect value, one will correct or call exception.
checkDuplicatePath()  : self
Check and correct duplicate path
chunk()  : bool
Retrieve a small chunk and feeds each one into $callback for processing. It stops looping when $callback returns FALSE
clear()  : self
Clear object
clearCache()  : self
Clear tagged cache
clearEntities()  : self
Clear enities
clearEntitiesAfterGetXml()  : self
Clear all entities after XML generation
clearXmlTags()  : mixed
Clear external XML tags for entity.
commentsActivity()  : self
Set comments filter rule
copy()  : Core_Entity
Copy object
create()  : self
Create item
createDir()  : self
Create directory for item
currencyName()  : string
Get currency name
delete()  : self
Delete object from database
deleteAll()  : self
Delete all object
deleteDir()  : self
Delete item directory
deleteLargeImage()  : self
Delete item's large image
deleteSmallImage()  : self
Delete item's small image
discountsBadge()  : string
Backend badge
factory()  : mixed
Create and return an object of model
find()  : self
Find object in database and load one. Use clear() before find() with conditions!
findAll()  : array<string|int, mixed>
Find all objects
getBonuses()  : array<string|int, mixed>
Get Bonuses
getByGroupId()  : array<string|int, mixed>
Get item by group id
getByGroupIdAndPath()  : self|null
Get item by group id and path
getCartQuantity()  : int
Get item quantity into cart
getChangedData()  : array<string|int, mixed>
Get changed columns with values
getClassName()  : string
Get Model CallsName
getCount()  : int|false
Get count object
getDatabaseDriver()  : string
Get name of Database Driver
getDataValues()  : array<string|int, mixed>
Get dataValues
getEntities()  : array<string|int, mixed>
Get children entities
getFieldIDs()  : array<string|int, mixed>
Get visible field's IDs
getFields()  : array<string|int, mixed>
Get field's values
getFirst()  : null|Core_ORM
Get fist entity, ordered by primary key
getForbiddenTags()  : array<string|int, mixed>
Get forbidden tags list
getItemHref()  : string
Get href to the item dir
getItemPath()  : string
Get item path include CMS_FOLDER
getLargeFileHref()  : string
Get item large image href
getLargeFilePath()  : string
Get item large image path
getLast()  : null|Core_ORM
Get last entity, ordered by primary key
getMarksDeleted()  : string
Get column name for marks deleted
getModelName()  : string
Get model name, e.g. 'book' for 'Book_Model'
getName()  : string
Get entity name
getNameColumn()  : string
Get Name Column
getPath()  : string
Get item's path
getPrices()  : array<string|int, mixed>
Get Prices
getPrimaryKey()  : mixed
Get primary key value
getPrimaryKeyName()  : string
Get primary key name
getPropertyValues()  : array<string|int, mixed>
Values of all properties of item Значения всех свойств товара
getRelatedSite()  : Site_Model|null
Get Related Site
getRelations()  : array<string|int, mixed>
Get $this->_relations
getReserved()  : float
Get the quantity of reserved items
getRest()  : float
Get the quantity in the active warehouses
getSetPrice()  : decimal
Get price of set
getSiteuserGroupId()  : int
Get the ID of the user group
getSmallFileHref()  : string
Get item small image href
getSmallFilePath()  : string
Get item small image path
getStdObject()  : stdObject
Get stdObject for entity and children entities
getTableColumns()  : array<string|int, mixed>
Get tableColumns
getTableColums()  : array<string|int, mixed>
Get table columns. Fix wrong method name
getTableName()  : string
Get table name
getTrashDescription()  : string
Get entity description
getXml()  : string
Get XML for entity and children entities
getXmlTagName()  : string
Get tag name
getXmlTags()  : array<string|int, mixed>
Get external XML tags for entity.
imgBackend()  : string
Backend callback method
incCountByCreate()  : self
Inc items'count in group during creating item
index()  : self
Add item into search index
indexing()  : Search_Page
Search indexation
isActive()  : bool
Check activity of item and parent groups
isCallable()  : bool
Verify that the contents of a variable can be called as a function
isEmptyPrimaryKey()  : bool
Check is primary key NULL
loadPrice()  : mixed
makePath()  : self
Make url path
markDeleted()  : Core_Entity
Mark entity as deleted
modificationsBadge()  : string
Backend badge
move()  : Core_Entity
Move item to another group
nameBackend()  : string
Backend callback method
priceWithCurrency()  : string
Get price with currency for SEO-templates
producerName()  : string
Get producer name
propertyValue()  : string
Get property value for SEO-templates
queryBuilder()  : Core_QueryBuilder_Select
Get query builder for select
relatedBadge()  : string
Backend badge
remove()  : self
Remove related object. If main object does not save, it will save.
removeForbiddenTag()  : self
Remove tag from forbidden tags list
reservedBackend()  : mixed
reviewsBadge()  : string
Backend badge
rollbackRevision()  : self
Rollback Revision
save()  : Core_Entity
Save object.
saveLargeImageFile()  : self
Specify large image for item
saveSmallImageFile()  : self
Specify small image for item
sellerName()  : string
Get seller name
setCheck()  : self
Set _check flag
setComments()  : self
Set array of comments for getXml()
setDatabaseDriver()  : mixed
Set name of Database Driver
setLargeImageSizes()  : self
Set large image sizes
setMarksDeleted()  : self
Set column name for marks deleted
setRelations()  : self
Set $this->_relations
setShop_Item_Controller()  : self
Set $this->_Shop_Item_Controller
setSmallImageSizes()  : self
Set small image sizes
setXmlTagName()  : self
Set name of XML node
shortcut()  : Shop_Item_Model
Create shortcut and move into group $group_id
showXmlAssociatedItems()  : self
Add associated items XML to item
showXmlBarcodes()  : self
Add barcodes XML to item
showXmlBonuses()  : self
Add bonuses XML to item
showXmlCommentProperties()  : self
Show siteuser properties in XML
showXmlComments()  : self
Add comments XML to item
showXmlCommentsRating()  : self
Add Comments Rating XML to item
showXmlModifications()  : self
Add modifications XML to item
showXmlProperties()  : self
Show properties in XML
showXmlSets()  : self
Add XML of sets to item
showXmlSiteuser()  : self
Add site user information to XML
showXmlSiteuserProperties()  : self
Show siteuser properties in XML
showXmlSpecialprices()  : self
Add special prices XML to item
showXmlTabs()  : self
Add tabs XML to item
showXmlTags()  : self
Add tags XML to item
showXmlVotes()  : self
Add votes XML to item
showXmlWarehousesItems()  : self
Add warehouse information to XML
toArray()  : array<string|int, mixed>
Convert Object to Array
undelete()  : self
Turn off deleted status
unindex()  : self
Remove item from search index
update()  : self
Update object data into database
_addComments()  : self
Add comments into object XML
_getCopiedName()  : mixed
Get the name of a new copied object
_prepareData()  : self
Prepare entity and children entities
_preparePropertyValue()  : mixed
Prepare Property Value
getDatabase()  : Core_DataBase
Get Database

Properties

$absolute_price

Callback property_id

public string $absolute_price = \NULL

$adminRest

Callback property_id

public string $adminRest = \NULL

$config

ORM config

public static mixed $config = \NULL

$count

Callback property_id

public string $count = \NULL

$discounts

Callback property_id

public int $discounts = 1

$key

Callback property_id

public string $key = \NULL

$modifications

Callback property_id

public int $modifications = 1

$price_absolute

public mixed $price_absolute = \NULL

Callback property_id

public int $related = 1

$reviews

Callback property_id

public int $reviews = 1

$rollback

Backend property

public mixed $rollback = 0

$_aComments

Array of comments, [parent_id] => array(comments)

protected array<string|int, mixed> $_aComments = array()

$_allowedTags

Allowed tags. If list of tags is empty, all tags will show.

protected array<string|int, mixed> $_allowedTags = array()

$_attributes

Entity Attributes

protected array<string|int, mixed> $_attributes = array()

$_belongsTo

Belongs to relations

protected array<string|int, mixed> $_belongsTo = array('shop_measure' => array(), 'shop_tax' => array(), 'siteuser_group' => array(), 'shop_seller' => array(), 'shop_group' => array(), 'shop_currency' => array(), 'shop' => array(), 'shop_producer' => array(), 'siteuser' => array(), 'shop_item' => array('foreign_key' => 'shortcut_id'), 'modification' => array('model' => 'Shop_Item', 'foreign_key' => 'modification_id'), 'user' => array())

$_cartQuantity

Количество товара в корзине

protected mixed $_cartQuantity = 1

$_changeCopiedName

Change copied name is necessary, default FALSE

protected bool $_changeCopiedName = \FALSE

$_changedColumns

List of changed columns

protected array<string|int, mixed> $_changedColumns = array()

$_commentsActivity

What comments show in XML? (active|inactive|all)

protected string $_commentsActivity = 'active'

$_dataValues

data-values, e.g. dataMyValue

protected array<string|int, mixed> $_dataValues = array()

$_forbiddenTags

Forbidden tags. If list of tags is empty, all tags will be shown.

protected array<string|int, mixed> $_forbiddenTags = array('deleted', 'user_id', 'price', 'datetime', 'start_datetime', 'end_datetime', 'yandex_market', 'yandex_market_bid', 'yandex_market_cid', 'yandex_market_sales_notes', 'apply_purchase_discount')

$_hasMany

One-to-many or many-to-many relations

protected array<string|int, mixed> $_hasMany = array('shop_cart' => array(), 'comment' => array('through' => 'comment_shop_item'), 'shop_bonus' => array('through' => 'shop_item_bonus'), 'shop_discount' => array('through' => 'shop_item_discount'), 'shop_item_bonus' => array(), 'shop_item_discount' => array(), 'shop_item_digital' => array(), 'shop_item' => array('foreign_key' => 'shortcut_id'), 'modification' => array('model' => 'Shop_Item', 'foreign_key' => 'modification_id'), 'shop_price' => array('through' => 'shop_item_price'), 'shop_item_price' => array(), 'item_associated' => array('through' => 'shop_item_associated', 'through_table_name' => 'shop_item_associated', 'model' => 'Shop_Item', 'dependent_key' => 'shop_item_associated_id'), 'shop_item_associated' => array(), 'shop_item_associated_second' => array('model' => 'Shop_Item_Associated', 'foreign_key' => 'shop_item_associated_id'), 'shop_item_set' => array(), 'shop_item_set_second' => array('model' => 'Shop_Item_Set', 'foreign_key' => 'shop_item_set_id'), 'shop_specialprice' => array(), 'shop_item_reserved' => array(), 'tag' => array('through' => 'tag_shop_item'), 'tag_shop_item' => array(), 'shop_warehouse' => array('through' => 'shop_warehouse_item'), 'shop_warehouse_item' => array(), 'vote' => array('through' => 'vote_shop_item'), 'shop_item_delivery_option' => array(), 'shop_favorite' => array(), 'shop_item_barcode' => array(), 'shop_warehouse_entry' => array(), 'shop_warehouse_incoming_item' => array(), 'shop_warehouse_inventory_item' => array(), 'shop_warehouse_writeoff_item' => array(), 'shop_warehouse_regrade_incoming_item' => array('model' => 'Shop_Warehouse_Regrade_Item', 'foreign_key' => 'incoming_shop_item_id'), 'shop_warehouse_regrade_writeoff_item' => array('model' => 'Shop_Warehouse_Regrade_Item', 'foreign_key' => 'writeoff_shop_item_id'), 'shop_price_entry' => array(), 'shop_price_setting_item' => array(), 'shop_warehouse_cell_item' => array(), 'shop_tab' => array('through' => 'shop_tab_item'), 'shop_tab_item' => array(), 'shop_item_certificate' => array(), 'lead_shop_item' => array(), 'deal_shop_item' => array())

$_hasOne

One-to-one relations

protected array<string|int, mixed> $_hasOne = array('shop_item_certificate' => array())

$_hasRevisions

Has revisions

protected mixed $_hasRevisions = \TRUE

$_incCountByCreate

Inc items'count in group during creating item

protected bool $_incCountByCreate = \TRUE

$_marksDeleted

Marks deleted entity

protected mixed $_marksDeleted = 'deleted'

$_modelColumns

List of columns in model with values

protected array<string|int, mixed> $_modelColumns = array()

$_modelName

Model name

protected mixed $_modelName = 'shop_item'

$_nameColumn

Column consist item's name

protected string $_nameColumn = 'name'

$_preloadValues

List of preloaded values

protected array<string|int, mixed> $_preloadValues = array('shortcut_id' => 0, 'siteuser_id' => 0, 'weight' => 0, 'price' => 0, 'sorting' => 0, 'image_small_height' => 0, 'image_small_width' => 0, 'image_large_height' => 0, 'image_large_width' => 0, 'yandex_market' => 1, 'yandex_market_bid' => 0, 'yandex_market_cid' => 0, 'active' => 1, 'indexing' => 1, 'modification_id' => 0, 'shop_measure_id' => 0, 'length' => 0, 'width' => 0, 'height' => 0, 'apply_purchase_discount' => 1, 'showed' => 0)

$_primaryKey

Primary key

protected string $_primaryKey = 'id'

$_propertyValues

Values of all properties of item

protected array<string|int, mixed> $_propertyValues = \NULL

$_reserved

Cache for getRest()

protected mixed $_reserved = \NULL

$_rest

Cache for getRest()

protected mixed $_rest = \NULL

$_shortcodeTags

List of Shortcodes tags

protected array<string|int, mixed> $_shortcodeTags = array('description', 'text')

$_showXmlAssociatedItems

Show associated items data in XML

protected bool $_showXmlAssociatedItems = \FALSE

$_showXmlBarcodes

Show barcodes in XML

protected bool $_showXmlBarcodes = \FALSE

$_showXmlBonuses

Show bonuses in XML

protected bool $_showXmlBonuses = \FALSE

$_showXmlCommentProperties

Show siteuser properties in XML

protected bool $_showXmlCommentProperties = \FALSE

$_showXmlComments

Show comments data in XML

protected bool $_showXmlComments = \FALSE

$_showXmlCommentsRating

Show comments rating data in XML

protected bool $_showXmlCommentsRating = \FALSE

$_showXmlModifications

Show modifications data in XML

protected bool $_showXmlModifications = \FALSE

$_showXmlProperties

Show properties in XML

protected mixed $_showXmlProperties = \FALSE

$_showXmlSets

Show sets in XML

protected bool $_showXmlSets = \TRUE

$_showXmlSiteuser

Show user data in XML

protected bool $_showXmlSiteuser = \FALSE

$_showXmlSiteuserProperties

Show siteuser properties in XML

protected bool $_showXmlSiteuserProperties = \FALSE

$_showXmlSpecialprices

Show special prices data in XML

protected bool $_showXmlSpecialprices = \FALSE

$_showXmlTabs

Show tabs data in XML

protected bool $_showXmlTabs = \FALSE

$_showXmlTags

Show tags data in XML

protected bool $_showXmlTags = \FALSE

$_showXmlVotes

Show votes in XML

protected bool $_showXmlVotes = \FALSE

$_showXmlWarehousesItems

Show items count data in XML

protected bool $_showXmlWarehousesItems = \FALSE

$_skipColumns

List of skipped columns from table

protected array<string|int, mixed> $_skipColumns = array()

$_sorting

Default sorting for models <code> protected $_sorting = array( 'tablename.sorting' => 'ASC' ); </code>

protected array<string|int, mixed> $_sorting = array()

$_tableColumns

List of columns in table

protected array<string|int, mixed> $_tableColumns = array()

$_tableName

Table name, e.g. 'books' for 'Book_Model'

protected mixed $_tableName = \NULL

$_typicalForbiddenTags

Typical forbidden tags.

protected array<string|int, mixed> $_typicalForbiddenTags = array()

$_xmlSortPropertiesValues

Sort properties values in XML

protected mixed $_xmlSortPropertiesValues = \TRUE

Methods

__call()

Triggered when invoking inaccessible methods in an object context

public __call(string $name, array<string|int, mixed> $arguments) : mixed
Parameters
$name : string

method name

$arguments : array<string|int, mixed>

arguments

Return values
mixed

__construct()

Constructor.

public __construct([int $id = NULL ]) : mixed
Parameters
$id : int = NULL

entity ID

Return values
mixed

__get()

Utilized for reading data from inaccessible properties

public __get(string $property) : mixed
Parameters
$property : string

property name

Return values
mixed

__isset()

Triggered by calling isset() or empty() on inaccessible properties

public __isset(string $property) : bool
Parameters
$property : string

property name

Return values
bool

__set()

Run when writing data to inaccessible properties

public __set(string $property, string $value) : self
Parameters
$property : string

property name

$value : string

property value

Return values
self

add()

Add related object. If main object does not save, it will save.

public add(Core_ORM $model[, string $relation = NULL ]) : self
Parameters
$model : Core_ORM
$relation : string = NULL
Tags
hostcms-event

modelname.onBeforeAdd

hostcms-event

modelname.onAfterAdd

$object = Core_ORM::factory('Main', 1);

$child = Core_ORM::factory('Child') $child->value1 = 'some value1'; $child->value2 = 'some value2';

$object->add($child);

Return values
self

addAllowedTag()

Add tag to allowed tags list

public addAllowedTag(string $tag) : self
Parameters
$tag : string

tag

Return values
self

addAttribute()

Add entity attribute

public addAttribute(string $name, string $value) : self
Parameters
$name : string
$value : string
Return values
self

addEntities()

Add children entities

public addEntities(array<string|int, mixed> $aChildrenEntities) : self
Parameters
$aChildrenEntities : array<string|int, mixed>
Return values
self

addEntity()

Add a children entity

public addEntity(Core_Entity $oChildrenEntity) : self
Parameters
$oChildrenEntity : Core_Entity
Return values
self

addForbiddenTag()

Add tag to forbidden tags list

public addForbiddenTag(string $tag) : self
Parameters
$tag : string

tag

Return values
self

addForbiddenTags()

Add tags to forbidden tags list

public addForbiddenTags(array<string|int, mixed> $aTags) : self
Parameters
$aTags : array<string|int, mixed>

array of tags

Return values
self

addXmlTag()

Add external tag for entity

public addXmlTag(string $tagName, string $tagValue[, array<string|int, mixed> $attributes = array() ]) : self
Parameters
$tagName : string

tag name

$tagValue : string

tag value

$attributes : array<string|int, mixed> = array()

attributes

Return values
self

adminChangeAssociated()

Backend callback method

public adminChangeAssociated() : string
Return values
string

adminCurrency()

Get item's currency

public adminCurrency() : string
Return values
string

adminCurrencyBadge()

Backend badge

public adminCurrencyBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

adminMeasure()

Get item's measure

public adminMeasure() : string
Return values
string

adminPrice()

Backend callback method

public adminPrice([object $value = NULL ]) : string
Parameters
$value : object = NULL

value

Tags
hostcms-event

shop_item.onBeforeAdminPrice

hostcms-event

shop_item.onAfterAdminPrice

Return values
string

adminPriceBadge()

Backend badge

public adminPriceBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

adminRest()

Backend callback method

public adminRest([mixed $value = NULL ]) : float
Parameters
$value : mixed = NULL

value

Return values
float

adminSetAssociated()

Backend callback method

public adminSetAssociated() : string
Return values
string

adminStatus()

Backend callback method

public adminStatus(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

adminUnsetAssociated()

Backend callback method

public adminUnsetAssociated() : string
Return values
string

applyMarksDeleted()

Apply markDeleted flag if is set

public applyMarksDeleted() : self
Return values
self

applyTags()

Apply tags for item

public applyTags(string $sTags) : self
Parameters
$sTags : string

string of tags, separated by comma

Return values
self

applyTagsArray()

Apply array tags for item

public applyTagsArray(array<string|int, mixed> $aTags) : self
Parameters
$aTags : array<string|int, mixed>

array of tags

Return values
self

backupRevision()

Backup revision

public backupRevision() : self
Return values
self

cartQuantity()

Set item quantity into cart

public cartQuantity(int $cartQuantity) : self
Parameters
$cartQuantity : int

quantity of item in the cart

Return values
self

changeActive()

Change item status

public changeActive() : self
Tags
hostcms-event

shop_item.onBeforeChangeActive

hostcms-event

shop_item.onAfterChangeActive

Return values
self

changeCopiedName()

Set if change copied name is necessary

public changeCopiedName(bool $changeCopiedName) : self
Parameters
$changeCopiedName : bool

mode

Return values
self

changed()

Check model has been changed.

public changed() : bool
Return values
bool

check()

Check model values. If model has incorrect value, one will correct or call exception.

public check([bool $exception = FALSE ]) : self
$object = Core_ORM::factory('Book', 1); $object->value = 123; $object->check(TRUE)->save();
Parameters
$exception : bool = FALSE

Call exception (TRUE) or correct value (FALSE). Default FALSE.

Return values
self

checkDuplicatePath()

Check and correct duplicate path

public checkDuplicatePath() : self
Return values
self

chunk()

Retrieve a small chunk and feeds each one into $callback for processing. It stops looping when $callback returns FALSE

public chunk(int $count, callable $callback[, bool $bCache = TRUE ]) : bool
Parameters
$count : int

chunk size

$callback : callable
$bCache : bool = TRUE

use cache

Return values
bool

clear()

Clear object

public clear() : self
Return values
self

clearCache()

Clear tagged cache

public clearCache() : self
Return values
self

clearEntities()

Clear enities

public clearEntities() : self
Return values
self

clearEntitiesAfterGetXml()

Clear all entities after XML generation

public clearEntitiesAfterGetXml([bool $clear = TRUE ]) : self
Parameters
$clear : bool = TRUE

mode

Return values
self

clearXmlTags()

Clear external XML tags for entity.

public clearXmlTags() : mixed
Return values
mixed

commentsActivity()

Set comments filter rule

public commentsActivity([string $commentsActivity = 'active' ]) : self
Parameters
$commentsActivity : string = 'active'

(active|inactive|all)

Return values
self

create()

Create item

public create() : self
Return values
self

createDir()

Create directory for item

public createDir() : self
Return values
self

currencyName()

Get currency name

public currencyName() : string
Return values
string

delete()

Delete object from database

public delete([mixed $primaryKey = NULL ]) : self
Parameters
$primaryKey : mixed = NULL

primary key for deleting object

Tags
hostcms-event

shop_item.onBeforeRedeclaredDelete

Return values
self

deleteAll()

Delete all object

public deleteAll([bool $bCache = TRUE ][, int $limit = 100 ]) : self
Parameters
$bCache : bool = TRUE

use cache

$limit : int = 100

default 100 Core_ORM::factory('Book')->Comments->deleteAll();

Return values
self

deleteDir()

Delete item directory

public deleteDir() : self
Return values
self

deleteLargeImage()

Delete item's large image

public deleteLargeImage() : self
Return values
self

deleteSmallImage()

Delete item's small image

public deleteSmallImage() : self
Return values
self

discountsBadge()

Backend badge

public discountsBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

factory()

Create and return an object of model

public static factory( $modelName[,  $primaryKey = NULL ]) : mixed
Parameters
$modelName :

Model name

$primaryKey : = NULL

Primary key

Return values
mixed

find()

Find object in database and load one. Use clear() before find() with conditions!

public find([mixed $primaryKey = NULL ][, bool $bCache = TRUE ]) : self
Parameters
$primaryKey : mixed = NULL

default NULL

$bCache : bool = TRUE

use cache // Find an object and load (without lazy load) // If an object is not found, primary key sets NULL $oBook = Core_ORM::factory('Book')->find(1);

Return values
self

findAll()

Find all objects

public findAll([bool $bCache = TRUE ]) : array<string|int, mixed>
Parameters
$bCache : bool = TRUE

use cache, default TRUE // Find objects $aBooks = Core_ORM::factory('Book')->findAll(); foreach ($aBooks as $oBook) { var_dump($oBook->id); }

Tags
hostcms-event

modelname.onBeforeFindAll

hostcms-event

modelname.onAfterFindAll

Return values
array<string|int, mixed>

getBonuses()

Get Bonuses

public getBonuses(mixed $aPrices) : array<string|int, mixed>
Parameters
$aPrices : mixed
Return values
array<string|int, mixed>

getByGroupId()

Get item by group id

public getByGroupId(int $group_id) : array<string|int, mixed>
Parameters
$group_id : int

group id

Return values
array<string|int, mixed>

getByGroupIdAndPath()

Get item by group id and path

public getByGroupIdAndPath(int $group_id, string $path) : self|null
Parameters
$group_id : int

group id

$path : string

path

Return values
self|null

getCartQuantity()

Get item quantity into cart

public getCartQuantity() : int
Return values
int

getChangedData()

Get changed columns with values

public getChangedData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getClassName()

Get Model CallsName

public static getClassName( $modelName) : string
Parameters
$modelName :

Model name

Return values
string

getCount()

Get count object

public getCount([bool $bCache = TRUE ][, string $fieldName = '*' ][, bool $distinct = FALSE ]) : int|false
Parameters
$bCache : bool = TRUE

use cache, default TRUE

$fieldName : string = '*'

default '*'

$distinct : bool = FALSE

default FALSE

Return values
int|false
$iCount = Core_ORM::factory('Book')->getCount(); var_dump($iCount);

getDatabaseDriver()

Get name of Database Driver

public static getDatabaseDriver() : string
Return values
string

getDataValues()

Get dataValues

public getDataValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEntities()

Get children entities

public getEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldIDs()

Get visible field's IDs

public getFieldIDs() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFields()

Get field's values

public getFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFirst()

Get fist entity, ordered by primary key

public getFirst([bool $bCache = TRUE ]) : null|Core_ORM
Parameters
$bCache : bool = TRUE

use cache, default TRUE

Return values
null|Core_ORM
$mObject = Core_ORM::factory('Book')->getFirst(); if (!is_null($mObject)) { echo $mObject; }

getForbiddenTags()

Get forbidden tags list

public getForbiddenTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

getItemHref()

Get href to the item dir

public getItemHref() : string
Return values
string

getItemPath()

Get item path include CMS_FOLDER

public getItemPath() : string
Return values
string

getLargeFileHref()

Get item large image href

public getLargeFileHref() : string
Return values
string

getLargeFilePath()

Get item large image path

public getLargeFilePath() : string
Return values
string

getLast()

Get last entity, ordered by primary key

public getLast([bool $bCache = TRUE ]) : null|Core_ORM
Parameters
$bCache : bool = TRUE

use cache, default TRUE

Return values
null|Core_ORM
$mObject = Core_ORM::factory('Book')->getLast(); if (!is_null($mObject)) { echo $mObject; }

getMarksDeleted()

Get column name for marks deleted

public getMarksDeleted() : string
Return values
string

getModelName()

Get model name, e.g. 'book' for 'Book_Model'

public getModelName() : string
Return values
string

getName()

Get entity name

public getName() : string
Tags
hostcms-event

modelname.onBeforeGetName

Return values
string

getNameColumn()

Get Name Column

public getNameColumn() : string
Return values
string

getPath()

Get item's path

public getPath() : string
Tags
hostcms-event

shop_item.onBeforeGetPath

Return values
string

getPrices()

Get Prices

public getPrices([bool $bCache = TRUE ]) : array<string|int, mixed>
Parameters
$bCache : bool = TRUE

cache mode status

Return values
array<string|int, mixed>

getPrimaryKey()

Get primary key value

public getPrimaryKey() : mixed
Return values
mixed

getPrimaryKeyName()

Get primary key name

public getPrimaryKeyName() : string
Return values
string

getPropertyValues()

Values of all properties of item Значения всех свойств товара

public getPropertyValues([bool $bCache = TRUE ][, array<string|int, mixed> $aPropertiesId = array() ][, bool $bSorting = FALSE ]) : array<string|int, mixed>
Parameters
$bCache : bool = TRUE

cache mode status

$aPropertiesId : array<string|int, mixed> = array()

array of properties' IDs

$bSorting : bool = FALSE

sort results, default FALSE

Return values
array<string|int, mixed>

Property_Value

getRelatedSite()

Get Related Site

public getRelatedSite() : Site_Model|null
Tags
hostcms-event

shop_item.onBeforeGetRelatedSite

hostcms-event

shop_item.onAfterGetRelatedSite

Return values
Site_Model|null

getRelations()

Get $this->_relations

public getRelations() : array<string|int, mixed>
Return values
array<string|int, mixed>

getReserved()

Get the quantity of reserved items

public getReserved([bool $bCache = TRUE ]) : float
Parameters
$bCache : bool = TRUE

cache mode status

Return values
float

getRest()

Get the quantity in the active warehouses

public getRest([bool $bCache = TRUE ]) : float
Parameters
$bCache : bool = TRUE

cache mode status

Tags
hostcms-event

shop_item.onBeforeGetRest

Return values
float

getSetPrice()

Get price of set

public getSetPrice() : decimal
Tags
hostcms-event

shop_item.onAfterGetSetPrice

Return values
decimal

getSiteuserGroupId()

Get the ID of the user group

public getSiteuserGroupId() : int
Return values
int

getSmallFileHref()

Get item small image href

public getSmallFileHref() : string
Return values
string

getSmallFilePath()

Get item small image path

public getSmallFilePath() : string
Return values
string

getStdObject()

Get stdObject for entity and children entities

public getStdObject([mixed $attributePrefix = '_' ]) : stdObject
Parameters
$attributePrefix : mixed = '_'
Tags
hostcms-event

shop_item.onBeforeRedeclaredGetStdObject

Return values
stdObject

getTableColumns()

Get tableColumns

public getTableColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTableColums()

Get table columns. Fix wrong method name

public getTableColums() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTableName()

Get table name

public getTableName() : string
Return values
string

getTrashDescription()

Get entity description

public getTrashDescription() : string
Tags
hostcms-event

modelname.onBeforeGetTrashDescription

Return values
string

getXml()

Get XML for entity and children entities

public getXml() : string
Tags
hostcms-event

shop_item.onBeforeRedeclaredGetXml

Return values
string

getXmlTagName()

Get tag name

public getXmlTagName() : string
Return values
string

getXmlTags()

Get external XML tags for entity.

public getXmlTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

imgBackend()

Backend callback method

public imgBackend() : string
Return values
string

incCountByCreate()

Inc items'count in group during creating item

public incCountByCreate([bool $value = TRUE ]) : self
Parameters
$value : bool = TRUE
Return values
self

index()

Add item into search index

public index() : self
Return values
self

indexing()

Search indexation

public indexing() : Search_Page
Tags
hostcms-event

shop_item.onBeforeIndexing

hostcms-event

shop_item.onAfterIndexing

Return values
Search_Page

isActive()

Check activity of item and parent groups

public isActive() : bool
Return values
bool

isCallable()

Verify that the contents of a variable can be called as a function

public isCallable(string $methodName) : bool
Parameters
$methodName : string

method name

Return values
bool

isEmptyPrimaryKey()

Check is primary key NULL

public isEmptyPrimaryKey() : bool
Return values
bool

loadPrice()

public loadPrice(mixed $shop_price_id) : mixed
Parameters
$shop_price_id : mixed
Return values
mixed

makePath()

Make url path

public makePath() : self
Tags
hostcms-event

shop_item.onAfterMakePath

Return values
self

modificationsBadge()

Backend badge

public modificationsBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

move()

Move item to another group

public move(int $iShopGroupId) : Core_Entity
Parameters
$iShopGroupId : int

target group id

Tags
hostcms-event

shop_item.onBeforeMove

hostcms-event

shop_item.onAfterMove

Return values
Core_Entity

nameBackend()

Backend callback method

public nameBackend() : string
Return values
string

priceWithCurrency()

Get price with currency for SEO-templates

public priceWithCurrency([string $format = '%s %s' ]) : string
Parameters
$format : string = '%s %s'
Return values
string

producerName()

Get producer name

public producerName() : string
Return values
string

propertyValue()

Get property value for SEO-templates

public propertyValue(int $property_id[, strint $format = '%2$s' ][, string $separator = ', ' ]) : string
Parameters
$property_id : int

Property ID

$format : strint = '%2$s'

string format, e.g. '%s: %s'. %1$s - Property Name, %2$s - List of Values

$separator : string = ', '

separator

Return values
string

relatedBadge()

Backend badge

public relatedBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

remove()

Remove related object. If main object does not save, it will save.

public remove(Core_ORM $model[, string $relation = NULL ]) : self
Parameters
$model : Core_ORM
$relation : string = NULL
Tags
hostcms-event

modelname.onBeforeRemove

hostcms-event

modelname.onAfterRemove

Return values
self

removeForbiddenTag()

Remove tag from forbidden tags list

public removeForbiddenTag(string $tag) : self
Parameters
$tag : string

tag

Return values
self

reservedBackend()

public reservedBackend() : mixed
Return values
mixed

reviewsBadge()

Backend badge

public reviewsBadge(Admin_Form_Field $oAdmin_Form_Field, Admin_Form_Controller $oAdmin_Form_Controller) : string
Parameters
$oAdmin_Form_Field : Admin_Form_Field
$oAdmin_Form_Controller : Admin_Form_Controller
Return values
string

rollbackRevision()

Rollback Revision

public rollbackRevision(int $revision_id) : self
Parameters
$revision_id : int

Revision ID

Return values
self

saveLargeImageFile()

Specify large image for item

public saveLargeImageFile(string $fileSourcePath, string $fileName) : self
Parameters
$fileSourcePath : string

source file

$fileName : string

target file name

Return values
self

saveSmallImageFile()

Specify small image for item

public saveSmallImageFile(string $fileSourcePath, string $fileName) : self
Parameters
$fileSourcePath : string

source file

$fileName : string

target file name

Return values
self

sellerName()

Get seller name

public sellerName() : string
Return values
string

setCheck()

Set _check flag

public setCheck(bool $check) : self
Parameters
$check : bool

mode

Return values
self

setComments()

Set array of comments for getXml()

public setComments(array<string|int, mixed> $aComments) : self
Parameters
$aComments : array<string|int, mixed>
Return values
self

setDatabaseDriver()

Set name of Database Driver

public static setDatabaseDriver(string $name) : mixed
Parameters
$name : string

driver's name

Return values
mixed

setLargeImageSizes()

Set large image sizes

public setLargeImageSizes() : self
Return values
self

setMarksDeleted()

Set column name for marks deleted

public setMarksDeleted([mixed $marksDeleted = 'deleted' ]) : self
Parameters
$marksDeleted : mixed = 'deleted'
Return values
self

setRelations()

Set $this->_relations

public setRelations(array<string|int, mixed> $relations) : self
Parameters
$relations : array<string|int, mixed>

Array with new relations

Return values
self

setShop_Item_Controller()

Set $this->_Shop_Item_Controller

public setShop_Item_Controller() : self
Return values
self

setSmallImageSizes()

Set small image sizes

public setSmallImageSizes() : self
Return values
self

setXmlTagName()

Set name of XML node

public setXmlTagName(string $tagName) : self
Parameters
$tagName : string

new tag name for node

Return values
self

shortcut()

Create shortcut and move into group $group_id

public shortcut([int $group_id = NULL ]) : Shop_Item_Model
Parameters
$group_id : int = NULL

group id

Return values
Shop_Item_Model

Shortcut

showXmlAssociatedItems()

Add associated items XML to item

public showXmlAssociatedItems([bool $showXmlAssociatedItems = TRUE ]) : self
Parameters
$showXmlAssociatedItems : bool = TRUE

mode

Return values
self

showXmlBarcodes()

Add barcodes XML to item

public showXmlBarcodes([bool $showXmlBarcodes = TRUE ]) : self
Parameters
$showXmlBarcodes : bool = TRUE

mode

Return values
self

showXmlBonuses()

Add bonuses XML to item

public showXmlBonuses([bool $showXmlBonuses = TRUE ]) : self
Parameters
$showXmlBonuses : bool = TRUE

mode

Return values
self

showXmlCommentProperties()

Show siteuser properties in XML

public showXmlCommentProperties([bool $showXmlCommentProperties = TRUE ]) : self
Parameters
$showXmlCommentProperties : bool = TRUE

mode

Return values
self

showXmlComments()

Add comments XML to item

public showXmlComments([bool $showXmlComments = TRUE ]) : self
Parameters
$showXmlComments : bool = TRUE

mode

Return values
self

showXmlCommentsRating()

Add Comments Rating XML to item

public showXmlCommentsRating([mixed $showXmlCommentsRating = TRUE ]) : self
Parameters
$showXmlCommentsRating : mixed = TRUE
Return values
self

showXmlModifications()

Add modifications XML to item

public showXmlModifications([bool $showXmlModifications = TRUE ]) : self
Parameters
$showXmlModifications : bool = TRUE

mode

Return values
self

showXmlProperties()

Show properties in XML

public showXmlProperties([mixed $showXmlProperties = TRUE ][, mixed $xmlSortPropertiesValues = TRUE ]) : self
Parameters
$showXmlProperties : mixed = TRUE

array of allowed properties ID or boolean

$xmlSortPropertiesValues : mixed = TRUE
Return values
self

showXmlSets()

Add XML of sets to item

public showXmlSets([bool $showXmlSets = TRUE ]) : self
Parameters
$showXmlSets : bool = TRUE

mode

Return values
self

showXmlSiteuser()

Add site user information to XML

public showXmlSiteuser([bool $showXmlSiteuser = TRUE ]) : self
Parameters
$showXmlSiteuser : bool = TRUE

show status

Return values
self

showXmlSiteuserProperties()

Show siteuser properties in XML

public showXmlSiteuserProperties([bool $showXmlSiteuserProperties = TRUE ]) : self
Parameters
$showXmlSiteuserProperties : bool = TRUE

mode

Return values
self

showXmlSpecialprices()

Add special prices XML to item

public showXmlSpecialprices([bool $showXmlSpecialprices = TRUE ]) : self
Parameters
$showXmlSpecialprices : bool = TRUE

mode

Return values
self

showXmlTabs()

Add tabs XML to item

public showXmlTabs([bool $showXmlTabs = TRUE ]) : self
Parameters
$showXmlTabs : bool = TRUE

mode

Return values
self

showXmlTags()

Add tags XML to item

public showXmlTags([bool $showXmlTags = TRUE ]) : self
Parameters
$showXmlTags : bool = TRUE

mode

Return values
self

showXmlVotes()

Add votes XML to item

public showXmlVotes([mixed $showXmlVotes = TRUE ]) : self
Parameters
$showXmlVotes : mixed = TRUE
Return values
self

showXmlWarehousesItems()

Add warehouse information to XML

public showXmlWarehousesItems([bool $showXmlWarehousesItems = TRUE ]) : self
Parameters
$showXmlWarehousesItems : bool = TRUE

show status

Return values
self

toArray()

Convert Object to Array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

undelete()

Turn off deleted status

public undelete() : self
Tags
hostcms-event

modelname.onBeforeUndelete

hostcms-event

modelname.onAfterUndelete

Return values
self

unindex()

Remove item from search index

public unindex() : self
Return values
self

update()

Update object data into database

public update() : self
Tags
hostcms-event

modelname.onBeforeUpdate

hostcms-event

modelname.onAfterUpdate

Return values
self

_addComments()

Add comments into object XML

protected _addComments(int $parent_id, Core_Entity $parentObject) : self
Parameters
$parent_id : int

parent comment id

$parentObject : Core_Entity

object

Tags
hostcms-event

shop_item.onBeforeAddComments

hostcms-event

shop_item.onAfterAddComments

Return values
self

_getCopiedName()

Get the name of a new copied object

protected _getCopiedName() : mixed
Return values
mixed

_prepareData()

Prepare entity and children entities

protected _prepareData() : self
Tags
hostcms-event

shop_item.onBeforeShowXmlModifications

hostcms-event

shop_item.onBeforeSelectModifications

hostcms-event

shop_item.onBeforeAddModification

hostcms-event

shop_item.onBeforeSelectAssociatedItems

hostcms-event

shop_item.onBeforeAddAssociatedEntity

hostcms-event

shop_item.onBeforeSelectShopWarehouseItems

hostcms-event

shop_item.onAfterAddSetEntity

Return values
self

_preparePropertyValue()

Prepare Property Value

protected _preparePropertyValue(Property_Value_Model $oProperty_Value) : mixed
Parameters
$oProperty_Value : Property_Value_Model
Return values
mixed

Search results