Appends an item to the given collection

@return array
@throws Exception
351216
public function evaluate()
    {
        $context = $this->getContext();
        $pathToRender = $this->getPath();
        $context['controllerContext'] = $this->getruntime()->getControllerContext();

        if (!isset($this->settings[$pathToRender])) {
            throw new Exception('The path "Neos.Neos.Ui.' . $pathToRender . '" was not found in the settings.', 1458814468);
        }

        return $this->configurationRenderingService->computeConfiguration($this->settings[$pathToRender], $context);
    }
833403
public function toArray()
    {
        $newItem = [];

        foreach ($this->items as $key => $val) {
            if ($val instanceof ArrayInterface) {
                $newItem[$key] = $val->items;
            } else {
                $newItem[$key] = $val;
            }
        }

        return $newItem;
    }
388802
def append_item(self, item):
        """"""
        if not isinstance(item, LR0Item):
            raise TypeError
        self.itemlist.append(item)
1237043
public function put()
    {
        $arguments = func_get_args();
        if (is_array($arguments[0])) {
            $variables = $arguments[0];
        } elseif (count($arguments) == 2) {
            $variables = [$arguments[0] => $arguments[1]];
        } else {
            throw new Exception('Try JavaScript::put(["foo" => "bar"]');
        }
        // First, we have to translate the variables
        // to something JS-friendly.
        $js = $this->buildJavaScriptSyntax($variables);
        // And then we'll actually bind those
        // variables to the view.
        $this->javascriptPipeline->addJs($js);

        return $js;
    }
881842
public function even(): ArrayCollection
    {
        $items = [];
        $pos = 0;

        foreach ($this->items as $key => $value) {
            if ($pos % 2 === 0) {
                $items[$key] = $value;
            }
            $pos++;
        }

        return new static($items);
    }
1089271
protected function submitAddCollectionItem()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('collection_item');
        $this->addCollectionItem();
    }
332035
public static function add($collection, $data)
  {
    static::checkConnexion();
    $collection = self::$db->$collection;
    if (is_string($data)) {
      $data = json_decode($data, true);
      if(!$data){
        throw new \Exception('Requête JSON formulée incorrectement');
      }
    }
    $r = $collection->insert($data);
    if ($r['ok']) {
      return true;
    } else {
      return false;
    }
  }
1240916
public function keys($collection=null) {
    list($collection) = self::_wrapArgs(func_get_args(), 1);
    
    if(!is_object($collection) && !is_array($collection)) throw new Exception('Invalid object');
    
    return self::_wrap(array_keys((array) $collection));
  }
1099463
public function evaluate()
    {
        $items = parent::evaluate();
        $collection = $this->fusionValue('appendTo');

        return array_merge($collection, $items);
    }
226330
protected function addCollection()
    {
        if (!$this->isError()) {
            $id = $this->collection->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
891717
public function addAll(array $elements)
    {
        if (is_array($elements)) {
            foreach ($elements as $element) {
                $this->_items[] = $element;
            }
            $this->_iterator = null;
        } else {
            throw new CollectionException('Given array can not added to collection, because it is no array.', E_NOTICE);
        }
    }
1216228
public function add($items)
    {
        if (is_array($items)) {
            $this->collection[] = new RecordField($items);
        } elseif (is_object($items) && $items instanceof RecordField) {
            $this->collection[] = $items;
        }

        return $this;
    }
115592
public function add(RendererInterface $item, $overWrite = false)
    {
        $uid = sha1(get_class($item).'_'.sha1(json_encode($item->supportedExtensions())));

        foreach ($item->supportedExtensions() as $ext) {
            if ($this->has($ext) && ! $overWrite) {
                throw new Exception('The collection ['. 1 .'] already collects for the path ['. 1 .']');
            }
        }

        $this->items[$uid] = $item;

        foreach ($item->supportedExtensions() as $ext) {
            $this->lookupTable[$ext] = $uid;
        }
    }
364494
protected function wizardAddCollection()
    {
        $this->validatePrompt('title', $this->text('Title'), 'collection');
        $this->validateMenu('type', $this->text('Type'), 'collection', $this->collection->getTypes());
        $this->validatePrompt('store_id', $this->text('Store'), 'collection');
        $this->validatePrompt('description', $this->text('Description'), 'collection', '');
        $this->validatePrompt('status', $this->text('Status'), 'collection', 0);

        $this->validateComponent('collection');
        $this->addCollection();
    }
406592
public function add($items)
    {
        if ($items && $items instanceof \Purekid\Mongodm\Model) {
            $id = (string) $items->getId();
            $this->_items[$id] = $items;
        } elseif (is_array($items)) {
            foreach ($items as $obj) {
                if ($obj instanceof \Purekid\Mongodm\Model) {
                    $this->add($obj);
                }
            }
        } elseif ($items instanceof self) {
            $this->add($items->toArray());
        }

        return $this;

    }
1004126
public function add($items)
    {
        if (is_array($items)) {
            $this->collection[] = new Record($items);
        } elseif (is_object($items) && $items instanceof Record) {
            $this->collection[] = $items;
        }

        return $this;
    }
621022
function(){
    var ItemView;
    this.collection.each(function(item, index){
      ItemView = this.getItemView(item);
      this.addItemView(item, ItemView, index);
    }, this);
  }