Doctrine 2
206
'Unknown Repository requested: '
.
$class
);
}
}
This factory simply does a string replace on the passed service locator key (which thanks to ZF2
is hidden within
func_get_args()
) to normalize it into the fully qualified namespace for the
requested repository, instantiates the resulting class, and returns the instantiated object.
If the factory can’t find the class for the requested repository, it throws a
RuntimeException
.
Next, we’ll make a couple entries in the service config to utilize this
RepositoryFactory
when
any of the new Doctrine-base repositories are requested:
// config/autoload/global.php
return
[
'service_config'
=>
[
'factories'
=>
[
'OrderHydrator'
=>
Do'stlaringiz bilan baham: