Create a collection of ObjectModel objects
- Class name: CollectionCore
- Source: classes/Collection.php line 33
- This class implements: Iterator, ArrayAccess, Countable
- $alias
- $alias_iterator
- $classname
- $definition
- $fields
- $id_lang
- $is_hydrated
- $iterator
- $query
- $results
- $total
- __construct
- count
- current
- formatValue
- generateAlias
- getAll
- getFieldInfo
- getResults
- groupBy
- key
- next
- offsetExists
- offsetGet
- offsetSet
- offsetUnset
- orderBy
- parseField
- parseFields
- rewind
- sqlWhere
- valid
- where
protected mixed $alias = array()
- Visibility: protected
- Source: classes/Collection.php line 76.
protected mixed $alias_iterator
- Visibility: protected
- Source: classes/Collection.php line 77.
protected string $classname
- Visibility: protected
- Source: classes/Collection.php line 38.
protected array $definition = array()
- Visibility: protected
- Source: classes/Collection.php line 48.
protected mixed $fields = array()
- Visibility: protected
- Source: classes/Collection.php line 75.
protected integer $id_lang
- Visibility: protected
- Source: classes/Collection.php line 43.
protected boolean $is_hydrated = false
- Visibility: protected
- Source: classes/Collection.php line 63.
protected integer $iterator
- Visibility: protected
- Source: classes/Collection.php line 68.
protected \DbQuery $query
- Visibility: protected
- Source: classes/Collection.php line 53.
protected array $results = array()
- Visibility: protected
- Source: classes/Collection.php line 58.
protected integer $total
- Visibility: protected
- Source: classes/Collection.php line 73.
mixed CollectionCore::__construct(string $classname, integer $id_lang)
- Visibility: public
- Source: classes/Collection.php line 83
- $classname string
- $id_lang integer
integer CollectionCore::count()
Get total of results
- Visibility: public
- Source: classes/Collection.php line 307
\ObjectModel CollectionCore::current()
Get current result
- Visibility: public
- Source: classes/Collection.php line 264
mixed CollectionCore::formatValue(mixed $value, string $field)
Format a value with the type of the given field
- Visibility: protected
- Source: classes/Collection.php line 404
- $value mixed
- $field string - Field name
string CollectionCore::generateAlias(string $association)
Generate uniq alias from association name
- Visibility: protected
- Source: classes/Collection.php line 455
- $association string - Use empty association for alias on current table
\Collection CollectionCore::getAll(boolean $display_query)
Launch sql query to create collection of objects
- Visibility: public
- Source: classes/Collection.php line 219
- $display_query boolean - If true, query will be displayed (for debug purpose)
array CollectionCore::getFieldInfo(string $field)
Obtain some informations on a field (alias, name, type, etc.)
- Visibility: protected
- Source: classes/Collection.php line 423
- $field string - Field name
array CollectionCore::getResults()
Get results array
- Visibility: public
- Source: classes/Collection.php line 239
\Collection CollectionCore::groupBy(string $field)
Add GROUP BY restriction on query
- Visibility: public
- Source: classes/Collection.php line 207
- $field string - Field name
integer CollectionCore::key()
Get current result index
- Visibility: public
- Source: classes/Collection.php line 286
mixed CollectionCore::next()
Go to next result
- Visibility: public
- Source: classes/Collection.php line 296
boolean CollectionCore::offsetExists($offset)
Check if a result exist
- Visibility: public
- Source: classes/Collection.php line 320
- $offset mixed
\ObjectModel CollectionCore::offsetGet($offset)
Get a result by offset
- Visibility: public
- Source: classes/Collection.php line 333
- $offset mixed
mixed CollectionCore::offsetSet($offset, $value)
Add an element in the collection
- Visibility: public
- Source: classes/Collection.php line 348
- $offset mixed
- $value mixed
mixed CollectionCore::offsetUnset($offset)
Delete an element from the collection
- Visibility: public
- Source: classes/Collection.php line 366
- $offset mixed
\Collection CollectionCore::orderBy(string $field, string $order)
Add ORDER BY restriction on query
- Visibility: public
- Source: classes/Collection.php line 192
- $field string - Field name
- $order string - asc|desc
string CollectionCore::parseField(string $field)
Replace a field with its SQL version (E.g. manufacturer.name with a2.name)
- Visibility: protected
- Source: classes/Collection.php line 392
- $field string - Field name
string CollectionCore::parseFields(string $str)
Parse all fields with {field} syntax in a string
- Visibility: protected
- Source: classes/Collection.php line 378
- $str string
mixed CollectionCore::rewind()
This method is called when a foreach begin
- Visibility: public
- Source: classes/Collection.php line 250
mixed CollectionCore::sqlWhere(string $sql)
Add WHERE restriction on query using real SQL syntax
- Visibility: public
- Source: classes/Collection.php line 179
- $sql string
boolean CollectionCore::valid()
Check if there is a current result
- Visibility: public
- Source: classes/Collection.php line 275
\Collection CollectionCore::where(string $field, string $operator, mixed $value)
Add WHERE restriction on query
- Visibility: public
- Source: classes/Collection.php line 119
- $field string - Field name
- $operator string - List of operators : =, !=, , =, like, notlike, regexp, notregexp
- $value mixed