Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1980

[GH-423] DDC-1955 - @EntityListeners

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

      Url: https://github.com/doctrine/doctrine2/pull/423

      Message:

      http://www.doctrine-project.org/jira/browse/DDC-1955

      Hi.

      This path adds support for ```@EntityListeners```

      This path add another way to handle events
      allow configure the same listener for many specific entities.
      And give the EventArg in the current lifecycle callback system.

      Usage :

      ```php
      <?php
      /**

      • @EntityListeners( {"ContractListener"}

        )

      • @HasLifecycleCallbacks
      • @Entity
        */
        class Contract
        {
        /** @PostLoad */
        public function postLoadHandler(LifecycleEventArgs $event) { // do something }
        }
        class ContractListener
        {
        /** @PrePersist */
        public function prePersistHandler(Contract $contract)
        { // do something }

        /**

      • @PostPersist
      • Most of cases just the entity is needed.
      • as a second parameter LifecycleEventArgs allow access to the entity manager.
        */
        public function postPersistHandler(Contract $contract, LifecycleEventArgs $args) { // do something }

        }
        ```

        Activity

        Benjamin Eberlei created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] New Feature [ 2 ]
        Show
        Fabio B. Silva added a comment - Merged : https://github.com/doctrine/doctrine2/commit/71a68a5c6fcd49538c3ef2f86d64bcde1958251c
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.4 [ 10321 ]
        Resolution Fixed [ 1 ]
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-423] was closed:
        https://github.com/doctrine/dbal/pull/423

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-423] was closed: https://github.com/doctrine/dbal/pull/423

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1980, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: