Версия: 6.x
burger close
Класс Offer
Граф наследования:Offer:
OrmObject AbstractObject AcceptBehavior AcceptBehaviorInterface

Открытые члены

 _init ()
 
 afterObjectLoad ()
 
 beforeWrite ($flag)
 
 isMain ()
 
 afterWrite ($flag)
 
 convertPropsData ($_propsdata)
 
 convertValues (array $pricedata)
 
 fillStockNum ()
 
 getStocks ()
 
 getPropertiesJson ()
 
 getStickJson ()
 
 getPhotosJson ()
 
 getMainPhotoId ()
 
 getImplodePhotos ($glue= ',')
 
 getUnit ($property=null)
 
 getProduct ($cache=true)
 
 setNextBarcode ($prefix= '')
 
 delete ()
 
- Открытые члены унаследованные от OrmObject
 __construct ($id=null, $cache=true)
 
 getPrimaryKeyProperty ()
 
 saveInCache ($id)
 
 loadFromCache ($id)
 
- Открытые члены унаследованные от AbstractObject
static __construct ()
 
 __destruct ()
 
 fillDefaults ()
 
 getClassParameter ($key=null)
 
 setClassParameter ($key, $value=null)
 
 issetClassParameter ($key=null)
 
 setLocalParameter ($key, $value=null)
 
 getLocalParameter ($key, $default=null)
 
 getParameter ($key, $default=null)
 
 setPropertyIterator (PropertyIterator $iterator)
 
 checkRights ($bool)
 
 clear ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 __set ($offset, $value)
 
 __get ($offset)
 
 offsetUnset ($offset)
 
 getShortAlias ()
 
 load ($primaryKeyValue=null)
 
 insert ($ignore=false, $on_duplicate_update_keys=[], $on_duplicate_uniq_fields=[])
 
 update ($primaryKey=null)
 
 replace ()
 
 delete ()
 
 exists ($primaryKeyValue)
 
 getFromArray (array $data, $remove_prefix=null, $mark_modify=true, $call_afterload_event=false)
 
 getValues ()
 
 isModified ($property)
 
 getPropertyIterator ()
 
 appendProperty (array $properties)
 
 _getTableArray ()
 
 getPrimaryKeyProperty ()
 
 getProperties ()
 
 getProp ($offset)
 
 save ($primaryKeyValue=null, $user_post=[], $post_var=null, $files_var=null)
 
 replaceOn ($bool)
 
 setWriteBit ($n)
 
 usePostKeys (array $keys)
 
 excludePostKeys (array $keys)
 
 checkData ($user_post=[], $post_var=null, $files_var=null, $usekeys=null, $exclude=null, $flag=self::UPDATE_FLAG)
 
 fillFromPost ($user_post=[], $post_var=null, $files_var=null, $usekeys=null, $exclude=null)
 
 validateData ($flag=self::UPDATE_FLAG)
 
 validate ()
 
 setCheckFields (array $fields)
 
 escapeFields (array $escape_fields)
 
 escapeAll ($bool)
 
 checkField ($property)
 
 addError ($string, $form=null)
 
 addErrors ($array, $form=null)
 
 getLastError ()
 
 getErrors ()
 
 getErrorsStr ()
 
 hasError ()
 
 getFormError ()
 
 getErrorsByForm ($key=null, $sep=null)
 
 getDisplayErrors ()
 
 noWriteRights ($right=DefaultModuleRights::RIGHT_UPDATE)
 
 getNonFormErrors ()
 
 clearErrors ()
 
 setTemporaryId ()
 
 setFormTemplate ($template)
 
 dbUpdate ()
 
 addIndex ($fields, $type=self::INDEX_KEY, $name=null, $using=null)
 
 getIndexes ()
 
 getForm (array $tpl_vars=null, $switch=null, $is_multiedit=false, $template=null, $tpl_maker=null, $tpl_folder=null)
 
 getPropertyView ($key, $attributes=[], $view_params=[])
 
 getHiddenKeyVal ()
 
 addHiddenFields ($keys, $value=null)
 
 addDebugActions (array $actions, $local=false)
 
 addDebugAction (\RS\Debug\Action\AbstractAction $action, $local=false)
 
 getDebugAttributes ()
 
 beforeWrite ($save_flag)
 
 afterWrite ($save_flag)
 
 afterObjectLoad ()
 
 getDebugActions ()
 
 dropTable ()
 
 exportErrors ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 __sleep ()
 
 __wakeup ()
 
 __clone ()
 
 __isset ($offset)
 
 getRightRead ()
 
 getRightCreate ()
 
 getRightUpdate ()
 
 getRightDelete ()
 
 getHtmlEncodedFields ()
 
- Открытые члены унаследованные от AcceptBehavior
 attachInstanceBehavior (BehaviorAbstract $behavior_class)
 
 detachInstanceBehavior (BehaviorAbstract $behavior_class=null)
 
 getAttachedBehaviors ()
 
 behaviorMethodExists ($method_name)
 
 __call ($method_name, $arguments)
 
- Открытые члены унаследованные от AcceptBehaviorInterface
 attachInstanceBehavior (\RS\Behavior\BehaviorAbstract $behavior_class)
 
 detachInstanceBehavior (\RS\Behavior\BehaviorAbstract $behavior_class=null)
 

Поля данных

 $first_sortn = 0
 
- Поля данных унаследованные от AbstractObject
const INSERT_FLAG = 'insert'
 
const UPDATE_FLAG = 'update'
 
const REPLACE_FLAG = 'replace'
 
const INDEX_PRIMARY = 'primary key'
 
const INDEX_UNIQUE = 'unique'
 
const INDEX_KEY = 'index'
 
const INDEX_FULLTEXT = 'fulltext'
 
- Поля данных унаследованные от AcceptBehavior
 $class_behaviors = []
 
 $cache_behavior_instances = []
 
 $instance_behaviors = []
 

Статические защищенные данные

static $table = "product_offer"
 
- Статические защищенные данные унаследованные от OrmObject
static $self_singleton_cache = []
 
- Статические защищенные данные унаследованные от AbstractObject
static $db = DB_NAME
 
static $table = null
 
static $iterator = 0
 
static $init_default_method = '_initDefaults'
 
static $local = []
 
static $default_local_parameters
 
static static $class = []
 
static $default_class_parameters
 

Дополнительные унаследованные члены

- Открытые статические члены унаследованные от OrmObject
static loadSingle ($id)
 
- Открытые статические члены унаследованные от AbstractObject
static loadByWhere ($expr, array $values=null, $prefix= 'AND', $in_prefix= 'AND')
 
static _getTable ()
 
static chkDepend ($coreobj, $value, $real_errtext, $real_chk, array $conditions, $real_params=[])
 
static destroyClass ()
 
- Открытые статические члены унаследованные от AcceptBehavior
static attachClassBehavior (BehaviorAbstract $behavior_class)
 
static detachClassBehavior (BehaviorAbstract $behavior_class=null)
 
- Открытые статические члены унаследованные от AcceptBehaviorInterface
static attachClassBehavior (\RS\Behavior\BehaviorAbstract $behavior_class)
 
static detachClassBehavior (\RS\Behavior\BehaviorAbstract $behavior_class=null)
 
- Статические открытые данные унаследованные от OrmObject
static $self_cache = []
 
- Защищенные члены унаследованные от OrmObject
 _init ()
 
- Защищенные члены унаследованные от AbstractObject
 initProperties ()
 
 _init ()
 
 _initDefaults ()
 
 afterInit ()
 
 getStorageInstance ()
 
 getTableEngine ()
 
 getPropertyHash ($is_multiedit, $switch=null)
 
- Защищенные статические члены унаследованные от OrmObject
static getIdHash ($id)
 
- Защищенные статические члены унаследованные от AbstractObject
static _tableName ($with_quotes=true)
 
static _dbName ($with_quotes=true)
 
- Защищенные данные унаследованные от AbstractObject
 $_values = []
 
 $_self_class
 
 $_local_id
 

Методы

_init ( )
afterObjectLoad ( )

Вызывается после загрузки объекта

Возвращает
void
afterWrite (   $flag)

Функция срабатывает после записи комплектации

Аргументы
string$flag- строка означающая тип действия insert или update
beforeWrite (   $flag)

Функция срабатывает перед записью

Аргументы
string$flag- строка означающая тип действия insert или update
Возвращает
void
convertPropsData (   $_propsdata)

Конвертирует формат сведений о характеристиках комплектации

Аргументы
array$_propsdata['key' => [ключ1, ключ2,...], 'value' => [значение1, значение2, ...]]
Возвращает
array ['ключ1' => 'значение1', 'ключ2' => 'значение2',...]
convertValues ( array  $pricedata)

Конвертирует валюты в комплектациях

Аргументы
array$pricedataсекция pricedata из offers
Возвращает
array возвращает тот же с массив, только с добавленной секцией value
delete ( )

Удаляет комплектацию

Возвращает
bool
fillStockNum ( )

Загружает остатки по складам для комплектации

Возвращает
float[]
getImplodePhotos (   $glue = ',')

Получает ID фото комплектации через разделитель

Аргументы
string$glue- символ склейки
Возвращает
string
getMainPhotoId ( )

Получает id главной(первой отмеченной) фотографии у товара или false

getPhotosJson ( )

Получает массив из ID фото комплектации

Возвращает
string
getProduct (   $cache = true)

Возвращает объект товара, которому принадлежит комплектация

Аргументы
bool$cacheИспользовать кэш
Возвращает
Product
getPropertiesJson ( )

Возвращает JSON с параметрами комплектаций

Возвращает
string
getStickJson ( )

Возвращает JSON с остатками на складах для данной комплектации

Возвращает
array
getStocks ( )

Возвращает остатки комплектации на складах, где в ключе - warehouseId, а в значении остаток

Возвращает
array
getUnit (   $property = null)

Возвращает объект единицы измерения, в котором измеряется данный продукт

Аргументы
string$property- имя свойства объекта Unit. Используется для быстрого обращения
Возвращает
Unit
isMain ( )

Возвращает true, если это главная комплектация

Возвращает
bool
setNextBarcode (   $prefix = '')

Возвращает следующий по порядку артикул для комплектации

Аргументы
string$prefix
Возвращает
string

Поля

$first_sortn = 0
$table = "product_offer"
staticprotected