src/UthandoCommon/Model/AbstractCollection.php
public function add($entity)
    {
        $class = $this->entityClass;

        if (!$entity instanceof $class) {
            throw new CollectionException('class must an instance of ' . $class);
        }

        $this->entities[] = $entity;

        return $this;
    }
public function add($entity)
    {
        $class = $this->entityClass;

        if (!$entity instanceof $class) {
            throw new CollectionException('class must an instance of ' . $class);
        }

        $this->entities[] = $entity;

        return $this;
    }
public function add ( $ entity ) { $ class = $ this -> entityClass ; if ( ! $ entity instanceof $ class ) { throw new CollectionException ( 'class must an instance of ' . $ class ) ; } $ this -> entities [ ] = $ entity ; return $ this ; }
adds an entity to the collection

@param object $entity
@return $this
@throws CollectionException
adds an entity to the collection