Created
February 4, 2011 12:40
-
-
Save rande/811066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Sonata package. | |
* | |
* (c) Thomas Rabaix <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Sonata\BaseApplicationBundle\Admin; | |
abstract class EntityAdmin extends Admin | |
{ | |
/** | |
* return the entity manager | |
* | |
* @return EntityManager | |
*/ | |
public function getEntityManager() | |
{ | |
return $this->container->get('doctrine.orm.default_entity_manager'); | |
} | |
/** | |
* return the doctrine class metadata handled by the Admin instance | |
* | |
* @return ClassMetadataInfo the doctrine class metadata handled by the Admin instance | |
*/ | |
public function getClassMetaData() | |
{ | |
return $this->getEntityManager() | |
->getClassMetaData($this->getClass()); | |
} | |
/** | |
* return the FormBuilder | |
* | |
* @return FormBuilder | |
*/ | |
public function getFormBuilder() | |
{ | |
return $this->container->get('base_application.builder.orm_form'); | |
} | |
/** | |
* return the ListBuilder | |
* | |
* @return ListBuilder | |
*/ | |
public function getListBuilder() | |
{ | |
return $this->container->get('base_application.builder.orm_list'); | |
} | |
/** | |
* return the FilterBuilder | |
* | |
* @return FilterBuilder | |
*/ | |
public function getDatagridBuilder() | |
{ | |
return $this->container->get('base_application.builder.orm_datagrid'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment