Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This file is part of the Kdyby (http://www.kdyby.org)
- *
- * Copyright (c) 2008, 2011 Filip Procházka ([email protected])
- *
- * @license http://www.kdyby.org/license
- */
- namespace Kdyby\Doctrine\ORM\Mapping;
- use Doctrine;
- use Doctrine\ORM\Events;
- use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
- use Kdyby;
- use Nette;
- /**
- * @author Filip Procházka
- */
- class EntityDefaultsListener extends Nette\Object implements Doctrine\Common\EventSubscriber
- {
- /**
- * @return array
- */
- public function getSubscribedEvents()
- {
- return array(
- Events::loadClassMetadata,
- );
- }
- /**
- * @param LoadClassMetadataEventArgs $args
- */
- public function loadClassMetadata(LoadClassMetadataEventArgs $args)
- {
- $meta = $args->getClassMetadata();
- if (!$meta->customRepositoryClassName) {
- $meta->customRepositoryClassName = 'Kdyby\Doctrine\ORM\EntityRepository';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment