Sin descripción

gedi 0939148dc3 [documentation] document translatable usage regarding default locale hace 13 años
bin 09e5d7da8f update to most recent Doctrine2 vendors hace 13 años
doc 0939148dc3 [documentation] document translatable usage regarding default locale hace 13 años
example 8e72a15037 [example] optimized example and documentation, to share reader, referes #255 hace 13 años
lib 58418f1640 [translatable] allow to store translation in default locale hace 13 años
schemas 07c3262700 [sortable] updated xml mapping hace 13 años
tests 58418f1640 [translatable] allow to store translation in default locale hace 13 años
upgrade ab2fe669ee updated readme and added upgrade guide hace 13 años
.gitignore 90d86c6858 [vendors] removed submodules in order to avoid recursive cloning, added php script instead hace 14 años
.travis.yml 215d0c6430 Added TravisCI configuration (and build status in the README). hace 13 años
LICENSE 805847af1a update license hace 13 años
README.md 0939148dc3 [documentation] document translatable usage regarding default locale hace 13 años
composer.json 194273292b Fixed composer.json. Single quotes does not validate. hace 13 años

README.md

Doctrine2 behavioral extensions

Version 2.3-DEV

Build Status

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

Latest updates

2012-02-15

2012-01-29

  • Translatable finally has Personal Translations which can relate through a real foreign key constraint and be used as a standard doctrine collection. This allows to configure domain objects anyway you prefere and still enjoy all features Translatable provides.
  • There were BC breaks introduced in master branch of extensions which is based on doctrine2.3.x version. If you are not interested in upgrading you can safely checkout at 2.2.x or 2.1.x tag. To upgrade your source code follow the upgrade guide
  • Library now can map only MappedSuperclasses which would avoid generation of ext_ tables which might not be used. Also it provides convinient methods to hook extension metadata drivers into metadata driver chain.
  • Example demo application has a detailed configuration provided, which explains and shows how extensions can or should be used with Doctrine2 ORM. To install it follow the steps.

2012-01-23

  • Fixed an issue with inheritance mapping in case of multiple class extension. For details take a peek at tests

2012-01-22

  • Adapted extensions for recent 2.3.0-DEV version of doctrine2. Released a tag for 2.2.x component support. In general extensions are BC with versions 2.1.x, 2.2.x of doctrine2.

2012-01-09

  • My blog was recently rebuilt from scratch using symfony2. All recent documentation based on extension docs will be available there too. Also it will be a good example for symfony2 users.

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

You can test these extensions on my blog. All tutorials for basic usage examples are on my blog too. You can also fork or clone this blog from github repository

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: