This work is licensed under a
Creative Commons
Attribution-Share Alike 3.0
Unported License.

Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Discover the SensioLabs Support

Access to the SensioLabs Competency Center for an exclusive and tailor-made support on Symfony
sensiolabs.com

How to use Doctrine Extensions: Timestampable, Sluggable, Translatable, etc.

Caution: You are browsing the documentation for Symfony version 2.0 which is not maintained anymore. If some of your projects are still using this version, consider upgrading.

How to use Doctrine Extensions: Timestampable, Sluggable, Translatable, etc.

Doctrine2 is very flexible, and the community has already created a series of useful Doctrine extensions to help you with common entity-related tasks.

One library in particular - the DoctrineExtensions library - provides integration functionality for Sluggable, Translatable, Timestampable, Loggable, Tree and Sortable behaviors.

The usage for each of these extensions is explained in that repository.

However, to install/activate each extension you must register and activate an Event Listener. To do this, you have two options:

  1. Use the StofDoctrineExtensionsBundle, which integrates the above library.
  2. Implement this services directly by following the documentation for integration with Symfony2: Install Gedmo Doctrine2 extensions in Symfony2
{"cc_re__cc_re__cc_by_sa_3_0": ["ass=\"feedback\">\n    <h2 class=\"title_05\">Questions &amp; Feedback</h2>\n    <p>\n      <em>Found a typo or an error?</em><br />\n      <em>Want to improve this document?</em> <a href=\"https://github.com/symfony/symfony-docs/edit/2.0/cookbook/doctrine/common_extensions.rst\">Edit</a> it.\n    </p>\n    <p>\n      <em>Need support or have a technical question?</em><br />\n      Post to the <a href=\"http://groups.google.com/group/symfony2\">user mailing-list</a>.\n     </p>\n</div>\n    <div id=\"license\">\n    <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">\n        <img alt=\"Creative Commons License\" src=\"http://symfony.com/images/license.png\" />\n    </a>\n    <div>\n        This <span xmlns:dc=\"http://purl.org/dc/elements/1.1/\" href=\"http://purl.org/dc/dcmitype/MovingImage\" rel=\"dc:type\">work</span> is licensed under a\n        <br />\n        Creative Commons\n        <br />\n        Attribution-Share Alike 3.0\n        <br />\n        Unported <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">License</a>.\n    </div>\n</div>\n        ", "</p>\n</div>\n    <div id=\"license\">\n    <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">\n        <img alt=\"Creative Commons License\" src=\"http://symfony.com/images/license.png\" />\n    </a>\n    <div>\n        This <span xmlns:dc=\"http://purl.org/dc/elements/1.1/\" href=\"http://purl.org/dc/dcmitype/MovingImage\" rel=\"dc:type\">work</span> is licensed under a\n        <br />\n        Creative Commons\n        <br />\n        Attribution-Share Alike 3.0\n        <br />\n        Unported <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">License</a>.\n    </div>\n</div>\n                                                \n<div class=\"ads\">\n        <div class=\"box_hr\"><hr /></div>\n\n    <div id=\"ad_jobs\" data-url=\"http://jobs.sensiolabs.com/api/random\"></div>\n            <div class=\"ad\" id=\"ad_trainings_1\">\n            <h3><a href=\"http://trainings.sensiolabs.com/en/training/getting-started-with-symfony2\">Master Symfony2 fundamentals</a></h3>\n            <div>Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).</"], "copyright__copyright__copyright": ["le, Translatable, Timestampable, Loggable, Tree and Sortable behaviors.\n\nThe usage for each of these extensions is explained in", "le, Translatable, Timestampable, Loggable, Tree and Sortable behaviors.\n\nThe usage for each of these extensions is explained in that repository.\n\nHowever, to install/activate each extension you must register and activate an Event Listener. To do this, you have two options:\n\n  1. Use the StofDoctrineExtensionsBundle, which integrates the above library.\n  2. Implement this services directly by following the documentation for integration with Symfony2: Install Gedmo Doctrine2 extensions in Symfony2"]}