LeanMapper\Repository::checkEntityType PHP Метод

checkEntityType() защищенный Метод

Checks whether give entity is instance of required type
protected checkEntityType ( Entity $entity )
$entity 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) . '.');
        }
    }