Coder Social home page Coder Social logo

yann-adreamutuelle / doctrineextensions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doctrine-extensions/doctrineextensions

0.0 1.0 0.0 5.67 MB

Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable

Home Page: http://atlantic18.github.io/DoctrineExtensions/

License: MIT License

PHP 100.00%

doctrineextensions's Introduction

Doctrine Behavioral Extensions

Build Status Latest Stable Version

This package contains extensions for Doctrine ORM and MongoDB ODM that offer new functionality or tools to use Doctrine more efficiently. These behaviors can be easily attached to the event system of Doctrine and handle the records being flushed in a behavioral way.

Extensions

ORM & MongoDB ODM

  • Blameable - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
  • Loggable - helps tracking changes and history of objects, also supports version management.
  • Sluggable - urlizes your specified fields into single unique slug
  • Timestampable - updates date fields on create, update and even property change.
  • Translatable - gives you a very handy solution for translating records into different languages. Easy to setup, easier to use.
  • Tree - automates the tree handling process and adds some tree-specific functions on repository. (closure, nested set or materialized path) (MongoDB ODM only supports materialized path)

ORM Only

  • IpTraceable - inherited from Timestampable, sets IP address instead of timestamp
  • SoftDeleteable - allows to implicitly remove records
  • Sortable - makes any document or entity sortable
  • Uploadable - provides file upload handling in entity fields

MongoDB ODM Only

All extensions support YAML, Annotation and XML mapping. Additional mapping drivers can be easily implemented using Mapping extension to handle the additional metadata mapping.

Version Compatibility

Extensions Version Compatible Doctrine ORM & Common Library
2.4 2.5+
2.3 2.2 - 2.4

If you are setting up the Entity Manager without a framework, see the the example to prevent issues like #1310

XML Mapping

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:

<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:

Running Tests

pdo-sqlite extension is necessary.

To set up and run the tests, follow these steps:

  • go to the root directory of extensions
  • download composer: wget https://getcomposer.org/composer.phar
  • install dev libraries: php composer.phar install
  • run: bin/phpunit -c tests
  • optional - run mongodb service if targeting mongo tests

Running the Example

To set up and run example, follow these steps:

  • go to the root directory of extensions
  • download composer: wget https://getcomposer.org/composer.phar
  • install dev libraries: php composer.phar install
  • 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

Thanks to everyone participating in the development of these great Doctrine extensions!

And especially ones who create and maintain new extensions:

doctrineextensions's People

Contributors

l3pp4rd avatar comfortablynumb avatar stof avatar cevou avatar ejsidisi avatar lbotsch avatar alsatian67 avatar dbu avatar mitrae avatar akenroberts avatar mnapoli avatar wesleyvanopdorp avatar everzet avatar slamdunk avatar birko avatar alterphp avatar delboy1978uk avatar khepin avatar iluuu1994 avatar vetalt avatar julesbou avatar dantudor avatar djlambert avatar tiger-seo avatar jonathaningram avatar gamesh avatar leonex-cs1 avatar zhil avatar mixegen avatar butt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.