Skip to content

Yii 2 extension wrapper to communicate with Doctrine 2.

Notifications You must be signed in to change notification settings

liketomove/yii2-doctrine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-doctrine

Yii 2 extension wrapper to communicate with Doctrine 2.x.

Installation

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

composer require liketomove/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.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%