Add item to a value (left)

@param  string $collection @param  string $collection
@param  string $key
@param  mixed $value
@return integer
768360
public function lpush($collection, $key, $value) {

        $list = $this->getKey($collection, $key, []);

        array_unshift($list, $value);

        $this->setKey($collection, $key, $list);

        return count($list);
    }
1142659
private function addResourceToRootCollectionIfNonExistant(&$collection, $resource)
    {
        $identifier = Utility::getProperty($resource, 'id');
        $exists = false;

        $copy = $collection instanceof Collection ? $collection->toArray() : $collection;

        foreach ($copy as $rootResource) {
            if ((int) Utility::getProperty($rootResource, 'id') === (int) $identifier) {
                $exists = true;
                break;
            }
        }

        if ($exists === false) {
            if (is_array($collection)) {
                $collection[] = $resource;
            } elseif ($collection instanceof Collection) {
                $collection->push($resource);
            }
        }
    }
1080582
public static function addLocaleToCollection(Collection $collection, LocaleInterface $locale)
    {
        $exist = $collection->exists(function ($key, LocaleInterface $el) use ($locale) {
            return $el->isLocale($locale->getLocale());
        });
        if (!$exist) {
            $collection->add($locale);
        }

        return $collection;
    }
552662
public boolean put(K key, V value)
    {
        C collection = this.getIfAbsentPutCollection(key);

        if (collection.add(value))
        {
            this.incrementTotalSize();
            return true;
        }
        return false;
    }
823848
public function rpush($collection, $key, $value) {

        $list = $this->getKey($collection, $key, []);

        $list[] = $value;

        $this->setKey($collection, $key, $list);

        return count($list);
    }
1042143
public function incrKey($collection, $key, $by = 1) {

        $current = $this->getKey($collection, $key, 0);
        $newone  = $current + $by;

        $this->setKey($collection, $key, $newone);

        return $newone;
    }
1346802
function(collection){
	Array.apply(this);
	if(arguments.length >= 1){
		for(var i=0,len = collection.length;i<len;i++){
			var item = collection[i];
			if(this.indexOf(item) < 0){
				this.push(item);
			}
		}
	}
 }
168173
public function load($str, Collection $collection)
	{
		$this->str = $str;
		$this->collection = $collection;

		return $this;
	}
225966
public function lset($collection, $key, $index, $value) {

        $list = $this->getKey($collection, $key, []);

        if ($index < 0) {
            $index = count($list) - abs($index);
        }

        if (isset($list[$index])){
            $list[$index] = $value;
            $this->setKey($collection, $key, $list);

            return true;
        }

        return false;
    }
1021094
public function prependSet($key, $value): ArrayCollection
    {
        $this->items = [$key => $value] + $this->items;

        return $this;
    }
384491
public function pluck(array $collection, $key)
    {
        $values = [];

        foreach ($collection as $node)
        {
            if ( ! isset($node[$key]))
            {
                continue;
            }

            $values[] = $node[$key];
        }

        return $values;
    }
207792
public function pluck($collection=null, $key=null) {
    list($collection, $key) = self::_wrapArgs(func_get_args(), 2);
    
    $collection = (array) self::_collection($collection);
        
    $return = array();
    foreach($collection as $item) {
      foreach($item as $k=>$v) {
        if($k === $key) $return[] = $v;
      }
    }
    return self::_wrap($return);
  }
837094
public function addItem($key, $value = null, $attribs = [])
    {
        if (is_array($value)) {
            $value = print_r($value, 1);
        }

        $this->addRow((array) $this->getValue($attribs, static::ROW))
            ->setRowCell(static::COL_KEY, $key, (array) $this->getValue($attribs, static::COL_KEY));

        if ($value !== false) {
            $this->setRowCell(static::COL_VALUE, $value, (array) $this->getValue($attribs, static::COL_VALUE));
        }

        return $this;
    }
749554
public function put_index($collection, $key, $size)
    {
        $this->get_index();

        // Limit size of index per client/collection
        if (isset($this->indexes[$collection])) {
            if (count($this->indexes[$collection]) >= $this->params['index_limit']) {
                $this->truncate_index($collection);
            }
        }

        $this->indexes[$collection][$key] = $size;

        $index_path = $this->get_path('index');
        return $this->write_cache($index_path, $this->indexes);
    }
555720
public function setCollection($collection)
    {
        if (!$this->loaded) {
            $this->load();
        }

        $this->collectionInfo->setCollection($collection);
        return $this;
    }
944128
public function apply(Collection $collection)
    {
        $this->collection = $collection;

        foreach ($this->filters() as $name => $value) {
            if (! method_exists($this, $name)) {
                continue;
            }

            if (is_array($value) or trim($value)) {
                $this->collection = $this->$name($value);
            } else {
                $this->collection = $this->$name();
            }
        }

        return $this->collection;
    }
1149768
public static function keysExist(array $collection, array $keys)
    {
        $collection = array_flip($collection);

        foreach ($keys as $key) {
            if (!in_array($key, $collection)) {
                return false;
            }
        }

        return true;
    }