2017 © Pedro Peláez
 

symfony-bundle dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

image

andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  • Thursday, July 19, 2018
  • by andreas-glaser
  • Repository
  • 1 Watchers
  • 2 Stars
  • 507 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

DCEventBundle - Doctrine Custom Event Bundle

This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets., (*1)

Installation

composer require andreas-glaser/dc-event-bundle ^1

Usage

1.) Attach entity event listener

<?php

namespace AppBundle\Entity;

use AndreasGlaser\DCEventBundle\EventHandler\Annotations\DCEntityEventHandler;
use Doctrine\ORM\Mapping as ORM;

/**
 * Article
 *
 * @ORM\Table(name="article")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ArticleRepository")
 * @DCEntityEventHandler(class="AppBundle\EEH\ArticleEEH")
 */
class Article
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="subject", type="string", length=255)
     */
    private $subject;

    /**
     * @var string
     *
     * @ORM\Column(name="body", type="text", nullable=true)
     */
    private $body;

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set subject
     *
     * @param string $subject
     *
     * @return Article
     */
    public function setSubject($subject)
    {
        $this->subject = $subject;

        return $this;
    }

    /**
     * Get subject
     *
     * @return string
     */
    public function getSubject()
    {
        return $this->subject;
    }

    /**
     * Set body
     *
     * @param string $body
     *
     * @return Article
     */
    public function setBody($body)
    {
        $this->body = $body;

        return $this;
    }

    /**
     * Get body
     *
     * @return string
     */
    public function getBody()
    {
        return $this->body;
    }
}

2.) Create entity event handler

<?php

namespace AppBundle\EEH;

use AndreasGlaser\DCEventBundle\EventHandler\DCEntityEventHandlerBase;
use AndreasGlaser\DCEventBundle\Helper\ChangeSetHelper;
use AppBundle\Entity as AppBundleEntity;

/**
 * Class ArticleEEH
 *
 * @package AppBundle\EEH
 */
class ArticleEEH extends DCEntityEventHandlerBase
{
    /**
     * @var AppBundleEntity\Article
     */
    protected $entity;

    /**
     * @return void
     */
    public function prePersist()
    {
        // TODO: Implement prePersist() method.
    }

    /**
     * @return void
     */
    public function postPersist()
    {
        // TODO: Implement postPersist() method.
    }

    /**
     * @param \AndreasGlaser\DCEventBundle\Helper\ChangeSetHelper $changeSet
     *
     * @return void
     */
    public function preUpdate(ChangeSetHelper $changeSet)
    {
        // TODO: Implement preUpdate() method.
    }

    /**
     * @return void
     */
    public function postUpdate()
    {
        // TODO: Implement postUpdate() method.
    }

    /**
     * @return void
     */
    public function preRemove()
    {
        // TODO: Implement preRemove() method.
    }

    /**
     * @return void
     */
    public function postRemove()
    {
        // TODO: Implement postRemove() method.
    }
}

The Versions

19/07 2018

1.1.x-dev

1.1.9999999.9999999-dev https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

19/07 2018

1.1.3

1.1.3.0 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

13/04 2018

1.1.2

1.1.2.0 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

13/04 2018

1.1.1

1.1.1.0 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

13/04 2018

dev-master

9999999-dev https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

24/08 2017

1.1.0

1.1.0.0 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

20/12 2016

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine event

20/12 2016

1.0.6

1.0.6.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine event

24/08 2016

1.0.5

1.0.5.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine event

26/07 2016

1.0.4

1.0.4.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine event

20/01 2016

1.0.3

1.0.3.0 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

20/01 2016

1.1.0-BETA1

1.1.0.0-beta1 https://github.com/andreas-glaser/dc-event-bundle

Doctrine Custom Event Bundle - This bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine symfony event

14/12 2015

1.0.2

1.0.2.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

 

The Development Requires

database doctrine event

17/11 2015

1.0.1

1.0.1.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

database doctrine event

18/10 2015

1.0

1.0.0.0 https://github.com/andreas-glaser/dc-event-bundle

This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

database doctrine event