51systems / doctrine-extensions-module
Doctrine2 Extensions
Installs: 321
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
pkg:composer/51systems/doctrine-extensions-module
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\TimestampableListenershould be used in place ofGedmo\Timestampable\TimestampableListenerin 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.