src/Search/Framework/CollectionAgentAbstract.php
public function attachCollection(CollectionAbstract $collection)
    {
        $id = $collection->getId();

        if (isset($this->_collections[$id])) {
            throw new \InvalidArgumentException('Collection already attached: ' . $id);
        }

        $this->_collections[$id] = $collection;
        $this->clearSchema();

        $this->getLogger()->debug('Collection attached', array('collection' => $id));

        return $this;
    }
public function attachCollection(CollectionAbstract $collection)
    {
        $id = $collection->getId();

        if (isset($this->_collections[$id])) {
            throw new \InvalidArgumentException('Collection already attached: ' . $id);
        }

        $this->_collections[$id] = $collection;
        $this->clearSchema();

        $this->getLogger()->debug('Collection attached', array('collection' => $id));

        return $this;
    }
public function attachCollection ( CollectionAbstract $ collection ) { $ id = $ collection -> getId ( ) ; if ( isset ( $ this -> _collections [ $ id ] ) ) { throw new \ InvalidArgumentException ( 'Collection already attached: ' . $ id ) ; } $ this -> _collections [ $ id ] = $ collection ; $ this -> clearSchema ( ) ; $ this -> getLogger ( ) -> debug ( 'Collection attached' , array ( 'collection' => $ id ) ) ; return $ this ; }
Relates a collection to the object.

@param SearchCollectionAbstract $collection
The collection being related to this object.

@return CollectionAgentAbstract

@throws \InvalidArgumentException
Thrown when a collection with the same identifier is already attached.
Relates a collection to the object .