Bez popisu

Gediminas Morkevicius 15853fe20a Merged pull request #41 from jaugustin/master. před 14 roky
bin 06e3b849fc [doc] translatable doc updates, also some misc changes před 14 roky
doc 8ce1b11b2c [loggable] added annotation to mark fields as versioned. updated docs před 14 roky
lib 2293432b93 split metadataExtension by objectManager classes, this fix issue when using both ORM and ODM at the same time před 14 roky
tests dd5b83d260 [tree] changes for inheritance mapping support, allows to map tree in joined table, also made support persistAs function for managed nodes před 14 roky
vendor 979e3c8511 Changed classloader for unit tests and some recommendations on readme před 14 roky
.gitignore b37f0b2ce9 [tests] made temporary directory common for all tests před 14 roky
.gitmodules 81edcf7a9e created vendor dir, updated test running config před 14 roky
LICENSE 81472b0b3c [tree] root id support, diferent strategy support před 14 roky
README.markdown 979e3c8511 Changed classloader for unit tests and some recommendations on readme před 14 roky

README.markdown

Some Doctrine 2 Extensions

This package contains extensions for Doctrine 2 that hook into the facilities of Doctrine and offer new functionality or tools to use Doctrine 2 more efficently. This package contains mostly used behaviors which can be easily attached to your event system of Doctrine 2 and handle the records being flushed in the behavioral way. List of extensions:

  • Tree - this extension automates the tree handling process and adds some tree specific functions on repository. (closure or nestedset)
  • Translatable - gives you a very handy solution for translating records into diferent languages. Easy to setup, easier to use.
  • Sluggable - urlizes your specified fields into single unique slug
  • Timestampable - updates date fields on create, update and even property change.
  • Loggable - helps tracking changes and history of objects, also supports version managment.

Currently these extensions support Yaml and Annotation mapping. Additional mapping drivers can be easy implemented using Mapping extension to handle the additional metadata mapping.

Notice: from now on there is only one listener per extension which supports ODM and ORM adapters to deal with objects. Only one instance of listener is required, and can be attached to many different type object managers, currently supported (ORM or ODM)

Important

Recently where was a change for type hinting on object manager and other. These changes requires doctrine2 from master branch. If you do not want to update your doctrine libraries use these extensions from separate branch doctrine2.0.x or simply checkout to this branch.

Latest updates

2011-04-16

  • Translation query walker is a killer feature for translatable extension. It lets to translate any query components and filter or order by translated fields. I recommmend you to use it extensively since it is very performative also.

2011-04-11

  • Tree nestedset was improved, now all in memory nodes are synchronized and do not require $em->clear() all the time. If you have any problems with new feature, open an issue.
  • Extensions now use only one listener instance for different object managers

ODM MongoDB support

List of extensions which support ODM

  • Translatable
  • Sluggable
  • Timestampable
  • Loggable

All these extensions can be nested together. And most allready use only annotations without interface requirement to not to aggregate the entity itself and has implemented proper caching for metadata.

There is a post introducing to these extensions on doctrine project

You can test these extensions on my blog.

All tutorials for basic usage examples are on my blog also.

Recommendations

  • Use Symfony/Component/ClassLoader/UniversalClassLoader for autoloading these extensions, it will help to avoid triggering fatal error during the check of class_exists

Running the tests:

PHPUnit 3.4 or newer is required. To setup and run tests follow these steps:

  • go to the root directory of extensions
  • run: git submodule update --init
  • go to tests directory: cd tests
  • run cp phpunit.dist.xml phpunit.xml
  • run: phpunit
  • optional - run mongodb in background to complete all tests

Contributors: