public function registerEntity(CollectionableInterface $entity)
    {
        if (!is_a($entity, $this->entityCollection->getEntityClass())) {
            throw new \InvalidArgumentException(sprintf('Only "%s" object allowed into "%s" store, "%s" given.',
                $this->entityCollection->getEntityClass(),
                get_class($this),
                get_class($entity)
            ));
        }

        $this->entityCollection->set(
            $entity->getId(),
            $this->loadDelegates($entity)
        );
    }
public function registerEntity(CollectionableInterface $entity)
    {
        if (!is_a($entity, $this->entityCollection->getEntityClass())) {
            throw new \InvalidArgumentException(sprintf('Only "%s" object allowed into "%s" store, "%s" given.',
                $this->entityCollection->getEntityClass(),
                get_class($this),
                get_class($entity)
            ));
        }

        $this->entityCollection->set(
            $entity->getId(),
            $this->loadDelegates($entity)
        );
    }
public function registerEntity ( CollectionableInterface $ entity ) { if ( ! is_a ( $ entity , $ this -> entityCollection -> getEntityClass ( ) ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Only "%s" object allowed into "%s" store, "%s" given.' , $ this -> entityCollection -> getEntityClass ( ) , get_class ( $ this ) , get_class ( $ entity ) ) ) ; } $ this -> entityCollection -> set ( $ entity -> getId ( ) , $ this -> loadDelegates ( $ entity ) ) ; }
Register a new Collectionable entity into datastore.

@param CollectionableInterface $entity

@throws \InvalidArgumentException If given object is not a supported type
Register a new Collectionable entity into datastore .