Returns another collection with this collection items, excluding
the first $many items from this collection
@param $many : int[ 0..length ] | null
@return \browserfs\Collection
@throws \browserfs\Exception on invalid argument(s)
503785
public function skip( $many = null ) {
			
			if ( null === $many || is_int( $many ) ) {

				if ( null != $many && $many > 0 ) {

					return new static( array_splice( $this->items, $many ) );
				
				} else
				if ( $many === null || $many === 0 ) {
				
					return $this;
				
				} else {
					throw new \browserfs\Exception('Invalid argument $many: Expected int[0..length] | null');
				}

			} else {

				throw new \browserfs\Exception('Invalid argument $many: Expected int[0..length] | null' );
			
			}
		}
763445
public function get_many($keys) {
        $return = array();
        foreach ($keys as $key) {
            if ($this->persist && array_key_exists($key, $this->store)) {
                $return[$key] = $this->store[$key];
            } else {
                $return[$key] = false;
            }
        }
        return $return;
    }
630028
public function except($keys): Collection
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        return new static(Arr::except($this->items, $keys));
    }
617094
public function intersect($collection)
    {
        $intersection = new DefaultCollection();
        /** @var ModelInterface $localModel */
        foreach ($this as $localModel) {
            /** @var ModelInterface $otherModel */
            foreach ($collection as $otherModel) {
                if (($localModel->getProviderName() === $otherModel->getProviderName())
                    && ($localModel->getId() === $otherModel->getId())
                ) {
                    $intersection->push($localModel);
                }
            }
        }

        return $intersection;
    }
203787
protected function get_collection_from() {
        if ($this->collectionfrom === null) {
            $this->collectionfrom = api::search_competencies('', $this->from);
        }
        return $this->collectionfrom;
    }
943411
public function get($path)
    {
        if (! $this->has($path) && ! $this->has('*')) {
            throw new \Exception('There is no collection that collects for the path ['.$path.']');
        }

        if (! $this->has($path) && $this->has('*')) {
            return $this->items[$this->pathLookupTable['*']];
        }

        return $this->items[$this->pathLookupTable[$path]];
    }
287237
public static function fromArray(array $items) : Collection
	{
		$obj = new static($items);
		foreach ($items as $key => $item) {
			$obj->__set($key, $item);
		}
		return $obj;
	}
1042477
public function all(array $collections = [], $groupByCollection = false)
    {
        if (count($collections) === 0) {
            if ($groupByCollection === false) {
                return $this->items;
            }

            return $this->itemCollections;
        }

        $result = [];

        foreach ($collections as $collection) {
            if (isset($this->itemCollections[$collection]) === false) {
                continue;
            }

            if ($groupByCollection === false) {
                $result = array_merge($result, $this->itemCollections[$collection]);

                continue;
            }

            $result[$collection] = $this->itemCollections[$collection];
        }

        return $result;
    }
118499
public function getGridFS($name = 'fs')
    {
        // return from pool
        if ($this->collectionPoolEnabled && isset($this->collectionPool[$name])) {
            return $this->collectionPool[$name];
        }

        // no object in pool - init new
        $classDefinition = $this->getCollectionDefinition($name, array('gridfs' => true));
        $className = $classDefinition->getClass();

        // create collection class
        $collection = new $className($this, $name, $classDefinition);
        if (!$collection instanceof \Sokil\Mongo\GridFS) {
            throw new Exception('Must be instance of \Sokil\Mongo\GridFS');
        }

        // store to pool
        if ($this->collectionPoolEnabled) {
            $this->collectionPool[$name] = $collection;
        }

        // return
        return $collection;
    }
102572
public static function fromCollection($collection) {
		if (!(is_array($collection) || $collection instanceof Iterator)) {
			throw new InvalidArgumentException('$collection is neither an array nor an iterator');
		}

		return self::toCollection($collection);
	}
330301
protected function extractItems($items) : iterable
    {
        // Catch arrays and Traversable objects.
        // By extension, this also includes other Collections (via their Iterator) *and* generators.
        // Keep especially the latter in mind when overriding concrete Collections.
        if (is_iterable($items)) {
            return $items;
        }

        // Arbitrary interfaces in order of preference.
        if ($items instanceof core\interfaces\Arrayable) {
            return $items->toArray();
        }

        if ($items instanceof \JsonSerializable) {
            return $items->jsonSerialize();
        }

        if ($items instanceof core\interfaces\Jsonable) {
            return json_decode($items->toJson(), true);
        }

        // Worst case scenario - use PHP's internals to attempt to cast it to an array.
        return (array) $items;
    }
1258027
public function get($collection_name, $query) {		
        if(!is_array($query)) {
            throw new \Exception("\$query must be an associative array of 'field => value' pairs");
        }

        $collection = new Collection($collection_name, true, $this);
				
        return $collection->findOne($query);
    }
386442
public function intersect(Collection $collection)
    {
        $array1 = $this->items;
        $array2 = $collection->toArray();

        $this->items = array_uintersect($array1, $array2, function($val1, $val2) {
            return strcmp($val1['slug'], $val2['slug']);
        });

        return $this;
    }
915421
public function getCollection($collectionClass = CreateFromAttributesInterface::class)
    {
        $collection = [];
        if ($this->isSuccessful()) {
            $data = $this->getData();
            foreach ($data as $attributes) {
                /** @var AbstractModel $collectionClass */
                $collection[] = $collectionClass::createFromAttributes($attributes);
            }
        }

        return $collection;
    }
926098
public function collection($name, $options = null)
    {
        if (!isset($this->_collections[$name])) {
            $this->_collections[$name] = new Collection($name, $this->_connector, $options);
        }

        return $this->_collections[$name];
    }
42283
public function union($items): ArrayCollection
    {
        return new static(array_unique(array_merge($this->items, $this->itemsArray($items))));
    }
565590
public function get($collection)
    {
        $collection = $this->makeCollection($collection);

        $url      = UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collection]);
        $response = $this->getConnection()->get($url);

        $data = $response->getJson();

        return Collection::createFromArray($data);
    }