Bez popisu

gedi 1d435da26a [sortable] fix issue when removing sortable entity, closes #197 před 13 roky
bin 0299adeec5 updated to most recent orm and dependencies versions, adapted translation query walker před 13 roky
doc 247c0f1387 "left" instead of "lft" in the "Generate own node list" code example. před 13 roky
example f6ab2cee5a [example] show memory used před 13 roky
lib 1d435da26a [sortable] fix issue when removing sortable entity, closes #197 před 13 roky
schemas 07c3262700 [sortable] updated xml mapping před 13 roky
tests 3fb1cb3e82 [tree] do not let to persist root nodes as siblings, references #208 před 13 roky
.gitignore 90d86c6858 [vendors] removed submodules in order to avoid recursive cloning, added php script instead před 14 roky
LICENSE 4931b7d671 [docs] updating documentation in more sensible way před 13 roky
README.md 295e4a53f5 updated readme před 13 roky
composer.json 01fe57a507 Added the composer.json file před 13 roky

README.md

Doctrine2 behavioral extensions

Version 2.2-DEV

Latest updates

Note: Use 2.1.x tag in order to use extensions based on Doctrine2.1.x versions. Currently master branch is based on 2.2.x versions and may not work with 2.1.x components.

2011-12-20

  • Refactored html tree building function, see documentation
  • Added example on how to create entity manager with extensions hooked using environment without framework
  • To run this example follow the documentation on the bottom of this document

2011-10-30

  • Support for doctrine common 2.2.x with backward compatibility. Be sure to use all components from the specific version, etc.: 2.2.x or 2.1.x both are supported

2011-10-23

  • @everzet has contributed the Translator behavior, which indeed is a more explicit way of handling translations in your projects

Summary and features

This package contains extensions for Doctrine2 that hook into the facilities of Doctrine and offer new functionality or tools to use Doctrine2 more efficently. This package contains mostly used behaviors which can be easily attached to your event system of Doctrine2 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.
  • Sortable - makes any document or entity sortable
  • Translator - explicit way to handle translations

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

Note: Please note, that xml mapping needs to be in a different namespace, the declared namespace for Doctrine extensions is http://gediminasm.org/schemas/orm/doctrine-extensions-mapping So root node now looks like this:

Note: Use 2.1.x tag in order to use extensions based on Doctrine2.1.x versions. Currently master branch is based on 2.2.x versions and may not work with 2.1.x

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                 xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
...
</doctrine-mapping>

XML mapping xsd schemas are also versioned and can be used by version suffix:

ODM MongoDB support

List of extensions which support ODM

  • Translatable
  • Sluggable
  • Timestampable
  • Loggable
  • Translator

All these extensions can be nested together and mapped in traditional ways - annotations, xml or yaml

Notice: extension tutorial on doctrine blog is outdated, most recent documentation is in doc directory. 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.

Running the tests:

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

  • go to the root directory of extensions
  • run: php bin/vendors.php
  • run: phpunit -c tests
  • optional - run mongodb in background to complete all tests

Running the example:

To setup and run example follow these steps:

  • go to the root directory of extensions
  • run: php bin/vendors.php installs doctrine and required symfony libraries
  • edit example/em.php and configure your database on top of the file
  • run: ./example/bin/console or php example/bin/console for console commands
  • run: ./example/bin/console orm:schema-tool:create to create schema
  • run: php example/run.php to run example

Contributors: