src/RepositoryTrait.php
public function getNew()
    {
        $object = \call_user_func($this->getObjectFactory());

        if (!$this->canBeManaged($object)) {
            throw new \RuntimeException(
                \sprintf(
                    'Object factory must return an instance of %s. "%s" returned',
                    $this->getClassName(),
                    \is_object($object) ? \get_class($object) : \gettype($object)
                )
            );
        }

        return $object;
    }
public function getNew()
    {
        $object = \call_user_func($this->getObjectFactory());

        if (!$this->canBeManaged($object)) {
            throw new \RuntimeException(
                \sprintf(
                    'Object factory must return an instance of %s. "%s" returned',
                    $this->getClassName(),
                    \is_object($object) ? \get_class($object) : \gettype($object)
                )
            );
        }

        return $object;
    }
Get a new managed object instance.

@throws \RuntimeException

@return object