Skip to content

Yii 2 extension wrapper to communicate with Doctrine 2.

Notifications You must be signed in to change notification settings

svp1989/yii2-doctrine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-doctrine

Yii 2 extension wrapper to communicate with Doctrine 2.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require svp/yii2-doctrine

Usage

For connecting doctrine components insert in you config file

'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',
            ]
        ]
]

For using doctrine console add to you config file

'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.

About

Yii 2 extension wrapper to communicate with Doctrine 2.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages