dev-master
9999999-dev https://github.com/Seldaek/monologYii 2 extension wrapper to communicate with Doctrine 2.
The Requires
- php >=5.6.0
- doctrine/orm 2.5.*
by Vitaliy Skvortsov
doctrine yii
Yii 2 extension wrapper to communicate with Doctrine 2.
Yii 2 extension wrapper to communicate with Doctrine 2., (*1)
You can add this library as a local, per-project dependency to your project using Composer:, (*2)
composer require svp/yii2-doctrine
For connecting doctrine components insert in you config file
php
'components' => [
...
'doctrine' => [
'class' => 'yii\doctrine\components\DoctrineComponent',
'isDev' => true, //for development
'driver' => 'pdo_mysql', //database driver
'user' => 'user', //database user
'password' => 'password', //password
'host' => 'localhost',
'dbname' => 'dbname', //name database
'entityPath' => [ //paths with you entity
'backend/models',
'frontend/models',
'console/models',
'common/models',
]
]
]
, (*3)
For using doctrine console add to you config file, (*4)
'controllerMap' => [ .... 'doctrine' => [ 'class' => 'yii\doctrine\console\DoctrineController', ] ] ]
and call ./yii doctrine, if you need transfer option use option -o=option.
For example :
--create table from entity ./yii orm:schema-tool:create
--update table from entity ./yii orm:schema-tool:update -o=--force
--create table from entity ./yii orm:schema-tool:drop -o=--dump-sql etc., (*5)
Yii 2 extension wrapper to communicate with Doctrine 2.
doctrine yii