TYPE_INT
TYPE_INT
List of field types
Webservice entity for stock movements
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
$image_format : string
None found |
None found |
None found |
$update_fields : array
None found |
$db : \Db
None found |
None found |
$tables_assoc : Array
Associations tables for attributes that require different tables than stated in ObjectModel::definition
None found |
getValidationRules(string $class = __CLASS__) : array
Returns object validation rules (fields validity)
string | $class | Child class name for static use (optional) |
Validation rules (fields validity)
None found |
__construct(integer $id = null, integer $id_lang = null, integer $id_shop = null)
Build object
integer | $id | Existing object id in order to load object (optional) |
integer | $id_lang | Required if object is multilingual (optional) |
integer | $id_shop | ID shop for objects with multishop on langs |
None found |
getFields() : array
Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval.
..)
All object fields
None found |
getFieldsShop() : array
Prepare fields for multishop Fields are not validated here, we considere they are already validated in getFields() method, this not the best solution but this is the only one possible for retro compatibility.
All object fields
since | 1.5.0 |
---|
since | 1.5.0 |
---|
formatValue(mixed $value, integer $type, $with_quotes = false, $purify = true)
Format a data
mixed | $value | |
integer | $type | |
$with_quotes | ||
$purify |
None found |
save(boolean $null_values = false, boolean $autodate = true) : boolean
Save current object to database (add or update)
boolean | $null_values | |
boolean | $autodate |
Insertion result
None found |
add(boolean $autodate = true, boolean $null_values = false) : boolean
Add current object to database
boolean | $autodate | |
boolean | $null_values |
Insertion result
None found |
duplicateObject() : \new
Duplicate current object to database
object
None found |
update(boolean $null_values = false) : boolean
Update current object to database
boolean | $null_values |
Update result
None found |
None found |
deleteSelection(array $selection) : boolean
Delete several objects from database
array | $selection |
Deletion result
None found |
toggleStatus() : boolean
Toggle object status in database
Update result
None found |
validateFields(boolean $die = true, boolean $error_return = false) : boolean|string
Check for fields validity before database interaction
boolean | $die | |
boolean | $error_return |
None found |
validateFieldsLang(boolean $die = true, boolean $error_return = false) : boolean|string
Check for multilingual fields validity before database interaction
boolean | $die | |
boolean | $error_return |
None found |
validateField(string $field, mixed $value, integer $id_lang = null, $skip = array(), $human_errors = false) : boolean|string
Validate a single field
string | $field | Field name |
mixed | $value | Field value |
integer | $id_lang | |
$skip | ||
$human_errors |
since | 1.5.0 |
---|
displayFieldName( $field, $class = __CLASS__, $htmlentities = true, \Context $context = null)
$field | ||
$class | ||
$htmlentities | ||
\Context | $context |
None found |
validateControler( $htmlentities = true)
TODO: refactor rename all calls to this to validateController
$htmlentities |
None found |
None found |
getWebserviceParameters( $ws_params_attribute_name = null)
$ws_params_attribute_name |
None found |
getWebserviceObjectList( $join, $filter, $sort, $limit, $full = false)
$join | ||
$filter | ||
$sort | ||
$limit | ||
$full |
None found |
validateFieldsRequiredDatabase( $htmlentities = true)
$htmlentities |
None found |
None found |
None found |
None found |
None found |
isAssociatedToShop(integer $id_shop = null) : boolean
Check if current object is associated to a shop
integer | $id_shop |
since | 1.5.0 |
---|
associateTo(integer|array $id_shops) : boolean
This function associate an item to its context
integer|array | $id_shops |
None found |
since | 1.5.0 |
---|
since | 1.5.0 |
---|
hasMultishopEntries() : boolean
Check if there is more than one entries in associated shop table for current entity
since | 1.5.0 |
---|
None found |
None found |
None found |
updateMultishopTable(string $classname, array $data, string $where = '', string $specific_where = '') : boolean
Update a table and splits the common datas and the shop datas
string | $classname | |
array | $data | |
string | $where | |
string | $specific_where | Only executed for common table |
since | 1.5.0 |
---|
deleteImage( $force_delete = false) : boolean
Delete images associated with the object
$force_delete |
success
None found |
existsInDatabase(integer $id_entity, string $table) : boolean
Specify if an ObjectModel is already in database
integer | $id_entity | |
string | $table |
None found |
isCurrentlyUsed(string $table = null, boolean $has_active_column = false) : boolean
This method is allow to know if a entity is currently used
string | $table | name of table linked to entity |
boolean | $has_active_column | true if the table has an active column |
since | 1.5.0.1 |
---|
hydrate(array $data, integer $id_lang = null)
Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)
array | $data | |
integer | $id_lang |
since | 1.5.0 |
---|
hydrateCollection(string $class, array $datas, integer $id_lang = null) : array
Fill (hydrate) a list of objects in order to get a collection of these objects
string | $class | Class of objects to hydrate |
array | $datas | List of data (multi-dimensional array) |
integer | $id_lang |
since | 1.5.0 |
---|
getDefinition(string $class, string $field = null) : array
Get object definition
string | $class | Name of object |
string | $field | Name of field if we want the definition of one field only |
None found |
getFieldByLang( $field_name, null $id_lang = null) : mixed
Return the field value for the specified language if the field is multilang, else the field value.
$field_name | ||
null | $id_lang |
since | 1.5 |
---|
setFieldsToUpdate(array $fields)
Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))
array | $fields |
since | 1.5.0 |
---|
None found |
None found |
formatFields(integer $type, integer $id_lang = null) : array
integer | $type | FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP |
integer | $id_lang | If this parameter is given, only take lang fields |
since | 1.5.0 |
---|
None found |
makeTranslationFields( $fields, $fields_array, $id_language)
$fields | ||
$fields_array | ||
$id_language |
None found |
setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static Remove this in 1.6 !
since | 1.5.0 |
---|