<?php

namespace NPS\Model;

use NPS\DependencyInjection\EventDispatcher;

/**
 * Trait which enables the objects to use event dispatcher functionalities
 * @author Lukas Korinek
 */
trait TEventDomainObject
{
    
    /** @var EventDispatcher $dispatcher */
    private $dispatcher;

    /**
     * Updates the entity of this object
     */
    private function update()
    {
        $this->dispatcher->event('entity.update', $this->getEntity());
    }
}

