Crud\TestSuite\Traits\CrudTestTrait::_subscribeToEvents PHP Метод

_subscribeToEvents() публичный Метод

This is the two 'final' emitted events after a CRUD life cycle, and thus will hold the final object It's stored in the $this->_subject property
public _subscribeToEvents ( Controller $controller = null ) : void
$controller Cake\Controller\Controller Controller
Результат void
    public function _subscribeToEvents(Controller $controller = null)
    {
        if ($controller === null) {
            $controller = $this->controller;
        }
        $controller->Crud->on('beforeRender', function ($event) {
            $this->_subject = $event->subject;
        });
        $controller->Crud->on('beforeRedirect', function ($event) {
            $this->_subject = $event->subject;
        });
    }