src/EntityRepositoryTrait.php
protected function validateEntity($entity, $method)
    {
        if (!$this->isEntity($entity)) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    '%s expects parameter 1 to be a valid entity instance, %s provided instead', $method,
                    is_object($entity) ? get_class($entity) : gettype($entity)
                )
            );
        }
    }
protected function validateEntity($entity, $method)
    {
        if (!$this->isEntity($entity)) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    '%s expects parameter 1 to be a valid entity instance, %s provided instead', $method,
                    is_object($entity) ? get_class($entity) : gettype($entity)
                )
            );
        }
    }
Indicates whether the given entity is valid.

@param mixed  $entity
@param string $method

@return void
@throws \Xloit\Bridge\Doctrine\ORM\Exception\InvalidArgumentException