51systems / doctrine-extensions-module
This package is abandoned and no longer maintained.
No replacement package was suggested.
Doctrine2 Extensions
v1.3.2
2016-11-21 00:07 UTC
Requires
- php: >=5.4
- 51systems/zf2-extensions: ^1.1
- doctrine/orm: >=2.4.0
- gedmo/doctrine-extensions: >=2.3.6
- zendframework/zend-authentication: >=2.2
- zendframework/zend-modulemanager: >=2.2
Requires (Dev)
- phake/phake: ^2.2
- phpunit/phpunit: ~4
README
Collection of extensions to the doctrine2 ORM
Features:
- Controller Plugins
- EntityManagerProvider (entityManagerProvider) - Returns the orm_default entity manager
- AuthenticatedUserProvider (authenticatedUserProvider) - Gets the currently authenticated user (if any)
- InitFormPlugin (initForm) - Initializes forms that may need the entity manager. Also sets up a doctrine object hydrator.
- DataFixtures
- AddIfNotPresentTrait - Helper trait to make it easy to only add fixture entities if they aren't already present in the database
- Types
- UTCDateTime (
utc_datetime
) type as per Doctrine Cookbook. Be careful when querying from this
- UTCDateTime (
- Gedmo Extensions
- Timestampable
- Extends Timestampable extension to support UTCDateTime (
utc_datetime
).DoctrineExtensions\Gedmo\Timestampable\TimestampableListener
should be used in place ofGedmo\Timestampable\TimestampableListener
in config files
- Extends Timestampable extension to support UTCDateTime (
- Timestampable
- Hydrators
- Single Column Hydrator
- ORM
- Repositories
- SubclassRepositoryFactory that will return a repo that uses the most defined repo definition in the class hierarchy
- Traits
- UTCTimestampableEntity - Timestampable behaviour using UTCDateTime
- EntityManagerAwareTrait - Provides getters/setters for object to hold and instance of an EntityManager.
- Alias
- A smarter alias to use with the doctrine query builder. Allows building / chaining of multiple aliases for subquries.
- Repositories
Skipper
To get The custom type working in skipper, you need to make a custom configuration file and include the following:
<ormd2-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<orm-configuration name="Doctrine2">
<data-types>
<data-type name="utc_datetime"/>
</data-types>
</orm-configuration>
</ormd2-configuration>
Installation
Install Via composer.
Add DoctrineExtensions
to Modules in application.config.php
Config Setup
Copy doctrine-extensions.global.php.dist to your configuration directory and rename to doctrine-extensions.global.php. Modify as necessary.
Testing
Some of the unit tests depend on test classes from other modules. Use --prefer-source
when installing composer to run them.