1
- # Doctrine 2 ORM Module for Zend Framework 2
1
+ # Doctrine 2 ORM Module for Zend Framework
2
2
3
3
[ ![ Master branch build status] ( https://secure.travis-ci.org/doctrine/DoctrineORMModule.png?branch=master )] ( http://travis-ci.org/doctrine/DoctrineORMModule ) [ ![ Scrutinizer Quality Score] ( https://scrutinizer-ci.com/g/doctrine/DoctrineORMModule/badges/quality-score.png?s=1e2a047fb1bb0f66937bcbc3a61f960c8089c835 )] ( https://scrutinizer-ci.com/g/doctrine/DoctrineORMModule/ ) [ ![ Code Coverage] ( https://scrutinizer-ci.com/g/doctrine/DoctrineORMModule/badges/coverage.png?s=377656ded5ffaaf4635acfb26729caa212fb5d76 )] ( https://scrutinizer-ci.com/g/doctrine/DoctrineORMModule/ ) [ ![ Latest Stable Version] ( https://poser.pugx.org/doctrine/doctrine-orm-module/v/stable.png )] ( https://packagist.org/packages/doctrine/doctrine-orm-module ) [ ![ Total Downloads] ( https://poser.pugx.org/doctrine/doctrine-orm-module/downloads.png )] ( https://packagist.org/packages/doctrine/doctrine-orm-module )
4
4
5
- DoctrineORMModule integrates Doctrine 2 ORM with Zend Framework 2 quickly and easily.
5
+ DoctrineORMModule integrates Doctrine 2 ORM with Zend Framework quickly and easily.
6
6
7
7
- Doctrine 2 ORM support
8
8
- Multiple ORM entity managers
@@ -15,7 +15,7 @@ Installation of this module uses composer. For composer documentation, please re
15
15
[ getcomposer.org] ( http://getcomposer.org/ ) .
16
16
17
17
``` sh
18
- php composer.phar require doctrine/doctrine-orm-module
18
+ composer require doctrine/doctrine-orm-module
19
19
```
20
20
21
21
Then add ` DoctrineModule ` and ` DoctrineORMModule ` to your ` config/application.config.php ` and create directory
@@ -31,30 +31,30 @@ configuration for each of your entities namespaces:
31
31
32
32
``` php
33
33
<?php
34
- return array(
35
- 'doctrine' => array(
36
- 'driver' => array(
34
+ return [
35
+ 'doctrine' => [
36
+ 'driver' => [
37
37
// defines an annotation driver with two paths, and names it `my_annotation_driver`
38
- 'my_annotation_driver' => array(
38
+ 'my_annotation_driver' => [
39
39
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
40
40
'cache' => 'array',
41
- 'paths' => array(
41
+ 'paths' => [
42
42
'path/to/my/entities',
43
- 'another/path'
44
- ) ,
45
- ) ,
43
+ 'another/path',
44
+ ] ,
45
+ ] ,
46
46
47
47
// default metadata driver, aggregates all other drivers into a single one.
48
48
// Override `orm_default` only if you know what you're doing
49
- 'orm_default' => array(
50
- 'drivers' => array(
49
+ 'orm_default' => [
50
+ 'drivers' => [
51
51
// register `my_annotation_driver` for any entity under namespace `My\Namespace`
52
- 'My\Namespace' => 'my_annotation_driver'
53
- )
54
- )
55
- )
56
- )
57
- ) ;
52
+ 'My\Namespace' => 'my_annotation_driver',
53
+ ],
54
+ ],
55
+ ],
56
+ ],
57
+ ] ;
58
58
```
59
59
60
60
## Connection settings
@@ -63,23 +63,23 @@ Connection parameters can be defined in the application configuration:
63
63
64
64
``` php
65
65
<?php
66
- return array(
67
- 'doctrine' => array(
68
- 'connection' => array(
66
+ return [
67
+ 'doctrine' => [
68
+ 'connection' => [
69
69
// default connection name
70
- 'orm_default' => array(
70
+ 'orm_default' => [
71
71
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
72
- 'params' => array(
72
+ 'params' => [
73
73
'host' => 'localhost',
74
74
'port' => '3306',
75
75
'user' => 'username',
76
76
'password' => 'password',
77
77
'dbname' => 'database',
78
- )
79
- )
80
- )
81
- ) ,
82
- ) ;
78
+ ],
79
+ ],
80
+ ],
81
+ ] ,
82
+ ] ;
83
83
```
84
84
85
85
#### Full configuration options
0 commit comments