$qb = $em->createQueryBuilder()
->select('u')
->from('User', 'u')
->join('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1');
// If the collection contains identifiers, fetch the objects from database
foreach ($values as $value) {
if ($value instanceof $target) {
$collection[] = $value;
} elseif ($value !== null) {
$targetObject = $this->find($value, $target);
if ($targetObject !== null) {
$collection[] = $targetObject;
}
}
}
'doctrine' => array (
'driver' => array(
'catalog_entities' => array(
'class' =>'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/Catalog/Entity')
),
'orm_default' => array(
'drivers' => array(
'Catalog\Entity' => 'catalog_entities'
),
),
),
),
$this->getServiceLocator()->get('FormElementManager')->get('ModuleName\Form\MyForm');
$logger->info('Тест ошибки');
2014-05-16T12:40:58+04:00 INFO (6): Тест ошибки
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$this->attachEventListeners($eventManager);
$eventManager->attach('dispatch.error', function ($event) use ($e) {
$sm = $e->getApplication()->getServiceManager();
$service = $sm->get('Application\Service\ErrorHandling');
$exception = $event->getResult()->exception;
if ($exception)
$service->logException($exception);
});
set_error_handler(function($c, $m, $f, $l) use ($e) {
$sm = $e->getApplication()->getServiceManager();
$service = $sm->get('Application\Service\ErrorHandling');
$service->logException(func_get_args());
});
register_shutdown_function(function() use ($e) {
$error = error_get_last();
$sm = $e->getApplication()->getServiceManager();
if ($error && ($error['type'] == E_ERROR || $error['type'] == E_PARSE || $error['type'] == E_COMPILE_ERROR))
{
$service = $sm->get('Application\Service\ErrorHandling');
if (strpos($error['message'], 'Allowed memory size') == 0)
{
ini_set('memory_limit', (intval(ini_get('memory_limit'))+64)."M");
}
$service->logException($error);
}
});
}
....
}