Prepend data to container

@param array $item Created Data
5970
protected function prepend(array $item)
    {
        if (! $this->isEnabled()) {
            $this->enable();
        }

        $container  = $this->getContainer();
        $currentArr = $container->getArrayCopy();

        array_unshift($currentArr, $item);
        $container->exchangeArray($currentArr);
    }
240536
public function addItem($item) {
		if (is_object($item)) {
			$modelClass = $this->getModel();
			if (! $item instanceof $modelClass) {
				throw new Exception('Model must be an instance of "' . $modelClass . '"');
			}
			
			$item->setCollection($this);
			
			if ($this->_primary === null) {
				$this->_data[]   = &$item->getDataLinked();
				$this->_models[] = $item;
				
				end($this->_data);
				$this->_map[] = key($this->_data);
			} else {
				if (is_array($this->_primaryDefinition)) {
					$idParts = [];
					
					foreach ($this->_primaryDefinition as $primaryPart) {
						if (! isset($item->$primaryPart)) {
							throw new Exception('Primary part "' . $primaryPart . '" not found');
						}
						
						$idParts[] = $item->$primaryPart;
					}
					
					$id = $this->arrayHashFunction($idParts);
				} else {
					if (! isset($item->{$this->_primary})) {
						throw new Exception('Primary "' . $this->_primary . '" not found');
					}
					
					$id = $item->{$this->_primary};
				}
				
				$this->_map[]       = $id;
				$this->_data[$id]   = &$item->getDataLinked();
				$this->_models[$id] = $item;
			}
		} elseif (is_array($item)) {
			if ($this->_primary === null) {
				$this->_data[] = $item;
				
				end($this->_data);
				$this->_map[] = key($this->_data);
				
			} else {
				if (is_array($this->_primaryDefinition)) {
					$idParts = [];
					
					foreach ($this->_primaryDefinition as $primaryPart) {
						if (! isset($item[$primaryPart])) {
							throw new Exception('Primary part "' . $primaryPart . '" not found');
						}
						
						$idParts[] = $item->$primaryPart;
					}
					
					$id = $this->arrayHashFunction($idParts);
				} else {
					if (! isset($item[$this->_primary])) {
						throw new Exception('Primary "' . $this->_primary . '" not found');
					}
					
					$id = $item[$this->_primary];
				}
				
				$this->_map[]     = $id;
				$this->_data[$id] = $item;
			}
		} else {
			throw new Exception('Unknown type of item: "' . gettype($item) . '"');
		}
		
		return $this;
	}
135322
public function prepend(ContainerBuilder $container)
    {
        parent::prepend($container);

        // grab mongo config directly from vcap...
        $services = getenv('VCAP_SERVICES');
        if (!empty($services)) {
            $services = json_decode($services, true);
            $mongo = $services['mongodb'][0]['credentials'];

            $container->setParameter('mongodb.default.server.uri', $mongo['uri']);
            $container->setParameter('mongodb.default.server.db', $mongo['database']);
        } else {
            $container->setParameter(
                'mongodb.default.server.uri',
                $container->getParameter('graviton.mongodb.default.server.uri')
            );
            $container->setParameter(
                'mongodb.default.server.db',
                $container->getParameter('graviton.mongodb.default.server.db')
            );
        }
    }
218526
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->addLabel($this);
        }

        return $this;
    }
719430
public function push($item)
	{
		$full_class_name = $this->getFullClassName();

		if (is_array($item)) {
			array_push($this->items, new $full_class_name($item));
		}
		elseif ($item instanceof $full_class_name) {
			array_push($this->items, $item);
		}
	}
781791
public function prepend()
    {
        $script = $this->parseArgs(func_get_args());
        if ($script !== false && !in_array($script, $this->members)) array_unshift($this->members, $script);
    }
437739
public function add_item(cc_i_item &$item) {
        if (is_null($this->itemlist)) {
            $this->itemlist = array();
        }
        $this->itemlist[$item->identifier] = $item;
    }
88939
protected function buildItem($position, array $item)
    {
        $position +=1;

        list($title, $aAttr, $liAttr) = $item;

        $base = $this->baseAttr;
        $esc  = $this->escaper->attr;

        $meta = $base['meta'];
        $meta['content'] = $position;


        $liAttr   = $esc(array_merge_recursive($liAttr, $base['li']));
        $aAttr    = $esc(array_merge_recursive($aAttr, $base['a']));
        $spanAttr = $esc($base['span']);

        $title  = "<span $spanAttr>$title</span>";
        $anchor = "<a $aAttr>$title</a>";
        $meta   = $this->void('meta', $meta);

        $this->html .= $this->indent(2, "<li {$liAttr}>");
        $this->html .= $this->indent(3, $anchor);
        $this->html .= $this->indent(3, $meta);
        $this->html .= $this->indent(2, '</li>');
    }
1203192
protected function prepareItem(array $item, array $data)
    {
        $product = $this->product->getBySku($item['sku'], $item['store_id']);

        if (empty($product['status']) || $data['store_id'] != $product['store_id']) {
            return array();
        }

        $product['price'] = $this->currency->convert($product['price'], $product['currency'], $data['currency']);

        $calculated = $this->product->calculate($product);

        if ($calculated != $product['price']) {
            $item['original_price'] = $product['price'];
        }

        $item['product'] = $product;
        $item['price'] = $calculated;
        $item['total'] = $item['price'] * $item['quantity'];

        return $item;
    }
929762
def append(self, item):
    
    if self.should_flush():
      self.flush()
    self.items.append(item)
362991
public function appendItem(Node $item) {
    if ($this->getItems()->isEmpty()) {
      $this->append($item);
    }
    else {
      $this->append([
        Token::comma(),
        Token::space(),
        $item,
      ]);
    }
    return $this;
  }
1235651
public function prepare($item)
    {
        $prepared = array();

        foreach($item as $key => $value) {
            //if it's null
            if($value === null) {
                //set it and continue
                $prepared[$key] = null;
                continue;
            }

            //if is array
            if(is_array($value)) {
                //recursive
                $prepared[$key] = $this->prepare($value);
                continue;
            }

            //if it can be converted
            if(is_scalar($value)) {
                $prepared[$key] = (string) $value;
                continue;
            }

            //we tried our best ...
            $prepared[$key] = $value;
        }

        return $prepared;
    }
780960
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->addGenre($this);
        }

        return $this;
    }
269800
public function prepend($value, $key = null)
    {
        $data = ['label' => $value, 'value' => $key];

        return parent::prepend($data);
    }
998388
public function add($item)
    {
        // Disallow items outside of original boundaries
        if (!in_array($item, $this->originalList)) {
            return;
        }
        if (!in_array($item, $this->currentList)) {
            $this->currentList[] = $item;
        }
    }
256469
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setStorage($this);
        }

        return $this;
    }
340235
protected function insertBetween($item, Bucket $prev, Bucket $next): void
    {
        $bucket = new ItemBucket($item);

        $prev->setNext($bucket);
        $next->setPrev($bucket);

        $bucket->setPrev($prev);
        $bucket->setNext($next);

        $this->current = $bucket;
        $this->count++;
    }