mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove all uses of databox_field::get_instance
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Assert\Assertion;
|
||||
|
||||
class databox_descriptionStructure implements IteratorAggregate, Countable
|
||||
{
|
||||
/** @var databox_field[] */
|
||||
@@ -17,10 +19,22 @@ class databox_descriptionStructure implements IteratorAggregate, Countable
|
||||
/**
|
||||
* Cache array for the get element by name function
|
||||
*
|
||||
* @var databox_field[]
|
||||
* @var array
|
||||
*/
|
||||
protected $cache_name_id = [];
|
||||
|
||||
/**
|
||||
* @param databox_field[] $fields
|
||||
*/
|
||||
public function __construct($fields = [])
|
||||
{
|
||||
Assertion::allIsInstanceOf($fields, databox_field::class);
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$this->add_element($field);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Iterator
|
||||
*/
|
||||
|
Reference in New Issue
Block a user