Git Product home page Git Product logo

doctrineextensions's Introduction

Doctrine2 behavioral extensions

Version 2.4.9

Build Status

Note: Extensions 2.4.x are compatible with ORM and doctrine common library versions from 2.2.x to 2.5.x. ORM 2.5.x versions require PHP 5.4 or higher.

Note: Extensions 2.3.x are compatible with ORM and doctrine common library versions from 2.2.x to 2.4.x Note: If you are setting up entity manager without a framework, see the example to prevent issues like #1310

Latest updates

2015-05-01

2015-03-26

Support for ORM and Common library 2.5.0. A minor version bump, because of trait column changes.

2015-01-28

Fixed the issue for all mappings, which caused related class mapping failures, when a relation or class name was in the same namespace, but extensions required it to be mapped as full classname.

2015-01-21

Fixed memory leak issue with entity or document wrappers for convenient metadata retrieval.

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 efficiently. 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, nestedset or materialized path)
  • Translatable - gives you a very handy solution for translating records into different 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.
  • 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.
  • Sortable - makes any document or entity sortable
  • Translator - explicit way to handle translations
  • SoftDeleteable - allows to implicitly remove records
  • Uploadable - provides file upload handling in entity fields
  • References - supports linking Entities in Documents and vice versa
  • ReferenceIntegrity - constrains ODM MongoDB Document references
  • IpTraceable - inherited from Timestampable, sets IP address instead of timestamp

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
  • Blameable
  • Loggable
  • Translator
  • Tree (Materialized Path strategy for now)
  • References
  • ReferenceIntegrity

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

Running the tests:

pdo-sqlite extension is necessary. To setup and run 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 setup 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 Doctrine2 extensions!

And especially ones who create and maintain new extensions:

doctrineextensions's People

Contributors

alsatian67 avatar alterphp avatar birko avatar butt avatar cevou avatar comfortablynumb avatar dantudor avatar dbu avatar djlambert avatar ejsidisi avatar everzet avatar gamesh avatar jonathaningram avatar julesbou avatar khepin avatar l3pp4rd avatar lbotsch avatar leonex-cs1 avatar mitrae avatar mixegen avatar mnapoli avatar munkie avatar rubenrua avatar stof avatar tiger-seo avatar vasmozart avatar vetalt avatar wesleyvanopdorp avatar yosmanyga avatar zhil avatar

Watchers

 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.