for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/nnx-framework/doctrine
* @author Malofeykin Andrey <[email protected]>
*/
namespace Nnx\Doctrine\EntityManager;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ReflectionClass;
* Class EntityAbstractFactory
*
* @package Nnx\Doctrine\EntityManager
class EntityAbstractFactory implements AbstractFactoryInterface
{
* @inheritdoc
* @param ServiceLocatorInterface $serviceLocator
* @param $name
* @param $requestedName
* @return boolean
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
return class_exists($requestedName);
}
* @return mixed
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
$r = new ReflectionClass($requestedName);
return $r->newInstance();