/**
  * @param ElementInterface $element
  * @param string|null      $key
  */
 public function add(ElementInterface $element, $key = null)
 {
     if (is_null($key)) {
         $key = $element->getId();
     }
     $this->elements->set($key, $element);
 }
Beispiel #2
0
 /**
  * @param array $attributes
  */
 public function add(array $attributes)
 {
     if (ArrayHelper::isAssoc($attributes)) {
         $this->attributes->setData($attributes);
     } else {
         foreach ($attributes as $attribute) {
             if (is_array($attribute)) {
                 $this->attributes->setData($attribute);
             } else {
                 $this->attributes->set($attribute, $attribute);
             }
         }
     }
 }
Beispiel #3
0
 /**
  * @param ElementInterface $element
  */
 protected function add(ElementInterface $element)
 {
     $this->elements->set($element->getId(), $element);
 }
Beispiel #4
0
 public function testGetStoreSetValue()
 {
     $config = new Store();
     $config->set('test', 'foo');
     $this->assertSame('foo', $config->get('test'));
 }
Beispiel #5
0
 /**
  * @param string $key
  * @param string $value
  *
  * @return Response
  */
 public function setHeader($key, $value)
 {
     $this->headers->set($key, $value);
     return $this;
 }