rnr1721 / le7-db-doctrine
Doctrine ORM integration for le7 PHP MVC framework
0.1.4
2024-01-28 19:57 UTC
Requires
- php: >=8.1
- doctrine/dbal: ^3.7
- doctrine/doctrine-bundle: ^2.11
- doctrine/doctrine-migrations-bundle: ^3.3
- doctrine/orm: ^2.17
- rnr1721/le7-core: ^1.1
Requires (Dev)
- phpunit/phpunit: ^10.0
- vimeo/psalm: ^5.7
Replaces
README
This package integrate Doctrine ORM into le7 PHP MVC engine.
Setup
You need to setup database connection in ./config/db_doctrine.php file
Using in controllers
You will can inject into your controllers EntityManagerInterface
<?php namespace App\Controller\Web; use Doctrine\ORM\EntityManagerInterface; use Psr\Http\Message\ResponseInterface; class IndexController { public function indexAction(EntityManagerInterface): ResponseInterface { // Use Entity Manager } }
Doctrine command line tool
You can use doctrine command-line tool this way
./cli.sh doctrine <doctrine options>