public function restrictToCollections($collections)
    {
        if ($this->databoxes) {
            throw new \LogicException('You can not restrict on databoxes and collections simultanously');
        }

        $this->collections = [];

        foreach ($this->toIterator($collections) as $collection) {
            if (!$collection instanceof \collection) {
                throw new \InvalidArgumentException('Restrict to collections only accept collections as argument');
            }
            $this->collections[] = $collection;
        }

        return $this->collections;
    }
public function restrictToCollections($collections)
    {
        if ($this->databoxes) {
            throw new \LogicException('You can not restrict on databoxes and collections simultanously');
        }

        $this->collections = [];

        foreach ($this->toIterator($collections) as $collection) {
            if (!$collection instanceof \collection) {
                throw new \InvalidArgumentException('Restrict to collections only accept collections as argument');
            }
            $this->collections[] = $collection;
        }

        return $this->collections;
    }
public function restrictToCollections ( $ collections ) { if ( $ this -> databoxes ) { throw new \ LogicException ( 'You can not restrict on databoxes and collections simultanously' ) ; } $ this -> collections = [ ] ; foreach ( $ this -> toIterator ( $ collections ) as $ collection ) { if ( ! $ collection instanceof \ collection ) { throw new \ InvalidArgumentException ( 'Restrict to collections only accept collections as argument' ) ; } $ this -> collections [ ] = $ collection ; } return $ this -> collections ; }
Restrict the checker to a set of collections.
Warning, you can not restrict on both databoxes and collections

@param  \collection[] $collections
@return bool

@throws \LogicException           If already restricted to databoxes
@throws \InvalidArgumentException In case invalid collections are provided
Restrict the checker to a set of collections . Warning you can not restrict on both databoxes and collections