https://github.com/daviddlv/doctrinemanagerbundle
https://github.com/daviddlv/doctrinemanagerbundle
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/daviddlv/doctrinemanagerbundle
- Owner: daviddlv
- Created: 2014-10-13T20:48:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-09-17T13:20:48.000Z (about 9 years ago)
- Last Synced: 2025-03-17T13:28:26.263Z (9 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Usage
-----
```php
// AppBundle/Entity/Content.php
use Doctrine\Manager\Mapping\Annotation as MM;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Doctrine\Manager\Model\ORM\EntityRepository")
* @ORM\Table(name="content")
* @MM\ModelManager(class="ContentBundle\Entity\Manager\ContentManager")
*/
class Content
```
```php
// AppBundle/Controller/ContentController.php
public function indexAction(Request $request)
{
$contentManager = $this->get('manager.factory')->getManager(Content::class);
$contents = $contentManager->getRepository()->findAll();
}
```