v3labs/doctrine-extensions
Composer 安装命令:
composer require v3labs/doctrine-extensions
包简介
A set of minimalistic Doctrine 2 ORM extensions.
README 文档
README
This library aims to be a minimalistic set of Doctrine 2 ORM extensions for php >=5.4. I'm developing this library for a project in my company. I am using it in production. The API is in no way stable(yet). More extensions will be added. I will try to keep the docs updated. Any help will be appreciated.
Timestampable
First you must register the timestampable event listener:
<?php use V3labs\DoctrineExtensions\ORM\Timestampable\TimestampableListener; // ... $em->getEventManager()->addEventSubscriber(new TimestampableListener);
If you are a Symfony2 user you can add this to your config.yaml:
services: v3labs.doctrine_extensions.timestampable_listener: class: "V3labs\DoctrineExtensions\ORM\Timestampable\TimestampableListener" public: false tags: - { name: doctrine.event_subscriber }
An entity using this extension would loke like this:
<?php namespace Some\Namespace; use Doctrine\ORM\Mapping as ORM; use V3labs\DoctrineExtensions\ORM\Timestampable\Timestampable; /** * Event * * @ORM\Table() * @ORM\Entity */ class Event { use Timestampable; // Rest of your entity }
统计信息
- 总下载量: 122
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-01-04