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

        $this->databoxes = [];

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

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

        $this->databoxes = [];

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

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

@param  \databox[] $databoxes A databox or an array of databoxes
@return bool

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