protected function checkEntityType(Entity $entity)
    {
        $entityClass = $this->mapper->getEntityClass($this->getTable());
        if (!($entity instanceof $entityClass)) {
            throw new InvalidArgumentException(
                'Repository ' . get_called_class() . ' can only handle ' . $entityClass . ' entites. Use different repository to handle ' . get_class(
                    $entity
                ) . '.'
            );
        }
    }
protected function checkEntityType(Entity $entity)
    {
        $entityClass = $this->mapper->getEntityClass($this->getTable());
        if (!($entity instanceof $entityClass)) {
            throw new InvalidArgumentException(
                'Repository ' . get_called_class() . ' can only handle ' . $entityClass . ' entites. Use different repository to handle ' . get_class(
                    $entity
                ) . '.'
            );
        }
    }
protected function checkEntityType ( Entity $ entity ) { $ entityClass = $ this -> mapper -> getEntityClass ( $ this -> getTable ( ) ) ; if ( ! ( $ entity instanceof $ entityClass ) ) { throw new InvalidArgumentException ( 'Repository ' . get_called_class ( ) . ' can only handle ' . $ entityClass . ' entites. Use different repository to handle ' . get_class ( $ entity ) . '.' ) ; } }
Checks whether give entity is instance of required type

@param Entity $entity
@throws InvalidArgumentException
Checks whether give entity is instance of required type