2017 © Pedro Peláez
 

library doctrine-extensions-module

Doctrine2 Extensions

image

51systems/doctrine-extensions-module

Doctrine2 Extensions

  • Saturday, December 3, 2016
  • by 51systems
  • Repository
  • 1 Watchers
  • 0 Stars
  • 308 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

doctrine-extensions

Build Status, (*1)

Collection of extensions to the doctrine2 ORM, (*2)

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
  • Gedmo Extensions
    • Timestampable
    • Extends Timestampable extension to support UTCDateTime (utc_datetime). DoctrineExtensions\Gedmo\Timestampable\TimestampableListener should be used in place of Gedmo\Timestampable\TimestampableListener in config files
  • 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.

Skipper

To get The custom type working in skipper, you need to make a custom configuration file and include the following:, (*3)

<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., (*4)

Add DoctrineExtensions to Modules in application.config.php, (*5)

Config Setup

Copy doctrine-extensions.global.php.dist to your configuration directory and rename to doctrine-extensions.global.php. Modify as necessary., (*6)

Testing

Some of the unit tests depend on test classes from other modules. Use --prefer-source when installing composer to run them., (*7)

The Versions