zucchi / doctrine
Zucchi Extensions for Doctrine
0.31
2016-02-09 10:24 UTC
Requires
- php: >=5.5.29
- doctrine/data-fixtures: 1.*
- doctrine/doctrine-mongo-odm-module: >=0.9
- doctrine/doctrine-orm-module: >=0.9
- gedmo/doctrine-extensions: 2.4.6
- zendframework/zend-eventmanager: 2.*
- zendframework/zend-form: 2.*
- zendframework/zend-mvc: 2.*
- zendframework/zend-servicemanager: 2.*
- zendframework/zend-stdlib: 2.*
- zucchi/zucchi: >=0.15
Requires (Dev)
- codeception/codeception: 2.1.2
README
为使用 Zucchi ZF2 模块定制的 Doctrine 2 ORM 扩展
安装
在您的 ZF2 骨架应用程序的根目录下运行
./composer.phar require zucchi/doctrine
特性
- Gedmo DoctrineExtensions 的自动注册
- 可变时间特征
- 覆盖日期/时间映射以使用 Zucchi\DateTime 扩展类
- 抽象实体类
- 抽象服务类
- 自定义 DQL 正则函数
- EntityField 视图助手,用于处理不同实体字段类型的输出
- 通过注解进行多对一表单填充
- EntityManagerAware 接口和特征
OneToMany 注解示例
此示例直接来自 ZucchiLayout 模块
/** * @var PersistantCollection * @ORM\OneToMany(targetEntity="ZucchiLayout\Entity\Schedule", mappedBy="Layout") * @Form\Type("Zend\Form\Element\Collection") * @Form\Options({ * "label" : "Schedule", * "count" : 2, * "should_create_template" : true, * "allow_add" : true, * "allow_remove" : true, * "target_element" : { * "composedObject" : "ZucchiLayout\Entity\Schedule" * } * }) */ public $Schedule;