Example #1
0
 /**
  * @param array $elements
  */
 public function __construct($elements = array())
 {
     if (!is_array($elements)) {
         $elements = func_get_arg(1);
     }
     parent::__construct($this->getAllowedType(), $elements);
 }
Example #2
0
 /**
  * @param string $name
  */
 public function __construct($name, Cache $cache, array $elements = null)
 {
     $this->name = new NonEmptyString($name);
     $this->name = $this->name->getValue();
     $this->cache = $cache;
     if (!is_array($elements)) {
         $elements = $this->cache->get($this->name);
     }
     if (!is_array($elements)) {
         $elements = array();
     }
     parent::__construct($this->getAllowedType(), $elements);
 }
 /**
  * @param array $parameters = []
  */
 public function __construct(array $parameters = [])
 {
     parent::__construct(ParameterInterface::INTERFACE_NAME, $parameters);
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function getTotalItems()
 {
     return new PositiveInteger($this->items->count());
 }
 /**
  * @param array $errors = []
  */
 public function __construct(array $errors = [])
 {
     parent::__construct(ErrorInterface::INTERFACE_NAME, $errors);
 }