Logs pre procedure event.

@param Events\PreProcedureEvent $event
198166
public function logPreProcedureEvent(Events\PreProcedureEvent $event)
    {
        $procedure = $event->getProcedure();

        $this->logger->info(sprintf('Starting procedure "%s"...', $procedure->getName()));
    }
320590
public function log($message)
    {
        $messages = (array) $message;
        foreach ($messages as $message) {
            $this->getLogger()->info($this->prependHandle($message));
        }
    }
932707
public function recordThat(Event $event): void
    {
        $this->handleRecursively($event);
        parent::recordThat($event);
    }
1250502
public function beforePrepare(Event $event)
	{
		$command = $event['command'];
		$operation = $command->getOperation();

		if ($command->offsetGet('collection') === 'user' || $command->getClient()->getCollectionName() === 'user')
		{
			if (strstr($operation->getURI(), 'user') !== false) return;

			$operation->setURI('/user/{appKey}/{_id}');
		}
		elseif ($command->offsetGet('collection') === 'files' || $command->getClient()->getCollectionName() === 'files')
		{
			if (strstr($operation->getURI(), 'files') !== false) return;
			$operation->setURI('/blob/{appKey}/{_id}');
			$command->getRequestHeaders()->add('X-Kinvey-API-Version', 3);
		}
		elseif ($command->offsetGet('collection') === 'group' || $command->getClient()->getCollectionName() === 'group')
		{
			if (strstr($operation->getURI(), 'group') !== false) return;
			$operation->setURI('/group/{appKey}/{_id}');
		}
	}
1015274
protected function create(Event $event)
    {
        $this->dispatch(static::EVENT_CREATE_BEFORE, $event);
        if (!$event->isPropagationStopped()) {
            $this->createProcess($event);
            if (!$event->isPropagationStopped()) {
                $this->dispatch(static::EVENT_CREATE_AFTER, $event);
            }
        }
    }
1366640
public function beforeRender(Event $event)
    {
        $this->set('authUser', $this->authUser);
        $this->set('title', $this->name);

        $event = new Event('CakeAdmin.Controller.beforeRender', $this);
        EventManager::instance()->dispatch($event);
    }
537245
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('type', $this->type);
        $this->set('title', $this->type['name']);
    }
976854
public function onBefore(BeforeEvent $event)
    {
        $request = $event->getRequest();
        if ($request->getConfig()->get('auth') == 'oauth2') {
            $token = $this->getAccessToken();
            if ($token !== null) {
                $request->setHeader('Authorization', 'Bearer ' . $token->getToken());
            }
        }
    }
205117
protected function _write($event)
    {
        // $output = '<table cellspacing="10">';
        $output = '<tr>';
        $output .= '<td style="color:%color%;text-align:right;padding-right:1em">%priorityName%</td>';
        $output .= '<td style="color:%color%;text-align:right;padding-right:1em">%memory%</td>';
        $output .= '<td style="color:%color%;">%message%</td></tr>'; // (%priority%)
        $event['color'] = '#C9C9C9';
        // Count errors
        if ($event['priority'] < 7) {
            $event['color'] = 'green';
        }
        if ($event['priority'] < 6) {
            $event['color'] = '#fd9600';
        }
        if ($event['priority'] < 5) {
            $event['color'] = 'red';
            $this->_errors++;
        }

        if ($event['priority'] == ZFDebug_Controller_Plugin_Debug_Plugin_Log::ZFLOG) {
            $event['priorityName'] = $event['message']['time'];
            $event['memory'] = $event['message']['memory'];
            $event['message'] = $event['message']['message'];
        } else {
            // self::$_lastEvent = null;
            $event['message'] = $event['priorityName'] .': '. $event['message'];
            $event['priorityName'] = '&nbsp;';
            $event['memory'] = '&nbsp;';
        }
        foreach ($event as $name => $value) {
            if ('message' == $name) {
                $measure = '&nbsp;';
                if ((is_object($value) && !method_exists($value,'__toString'))) {
                    $value = gettype($value);
                } elseif (is_array($value)) {
                    $measure = $value[0];
                    $value = $value[1];
                }
            }
            $output = str_replace("%$name%", $value, $output);
        }
        $this->_messages[] = $output;
    }
638580
public function handle($event)
    {
        if ($event instanceof CExceptionEvent)
            $this->logExceptionEvent($event);
        else
            $this->logErrorEvent($event);
        parent::handle($event);
    }
151082
public function beforeAction($event)
    {
        if ($this->checkIsMutexAction($event->action->id)) {
            $mutexName = $this->composeMutexName($event->action->id);
            if (!$this->getMutex()->acquire($mutexName)) {
                echo "Execution terminated: command is already running.\n";
                $event->isValid = false;

                return false;
            }
        }
    }
10071
public function beforeRender(Event $event)
    {

        parent::beforeRender($event);

        // when a shop order was placed, the pdfs that are rendered for the order confirmation email
        // called this method and therefore called resetOriginalLoggedCustomer() => email was sent t
        // the user who placed the order for a member and not to the member
        if ($this->getResponse()->getType() != 'text/html') {
            return;
        }

        $this->resetOriginalLoggedCustomer();

        $categoriesForMenu = [];
        if (Configure::read('appDb.FCS_SHOW_PRODUCTS_FOR_GUESTS') || $this->AppAuth->user()) {
            $this->Category = TableRegistry::getTableLocator()->get('Categories');
            $allProductsCount = $this->Category->getProductsByCategoryId(Configure::read('app.categoryAllProducts'), false, '', 0, true);
            $newProductsCount = $this->Category->getProductsByCategoryId(Configure::read('app.categoryAllProducts'), true, '', 0, true);
            $categoriesForMenu = $this->Category->getForMenu();
            array_unshift($categoriesForMenu, [
                'slug' => Configure::read('app.slugHelper')->getNewProducts(),
                'name' => __('New_products') . ' <span class="additional-info"> (' . $newProductsCount . ')</span>',
                'options' => [
                    'fa-icon' => 'fa-star' . ($newProductsCount > 0 ? ' gold' : '')
                ]
            ]);
            array_unshift($categoriesForMenu, [
                'slug' => Configure::read('app.slugHelper')->getAllProducts(),
                'name' => __('All_products') . ' <span class="additional-info"> (' . $allProductsCount . ')</span>',
                'options' => [
                    'fa-icon' => 'fa-tags'
                ]
            ]);
        }
        $this->set('categoriesForMenu', $categoriesForMenu);

        $this->Manufacturer = TableRegistry::getTableLocator()->get('Manufacturers');
        $manufacturersForMenu = $this->Manufacturer->getForMenu($this->AppAuth);
        $this->set('manufacturersForMenu', $manufacturersForMenu);

        $this->Page = TableRegistry::getTableLocator()->get('Pages');
        $conditions = [];
        $conditions['Pages.active'] = APP_ON;
        $conditions[] = 'Pages.position > 0';
        if (! $this->AppAuth->user()) {
            $conditions['Pages.is_private'] = APP_OFF;
        }

        $pages = $this->Page->getThreaded($conditions);
        $pagesForHeader = [];
        $pagesForFooter = [];
        foreach ($pages as $page) {
            if ($page->menu_type == 'header') {
                $pagesForHeader[] = $page;
            }
            if ($page->menu_type == 'footer') {
                $pagesForFooter[] = $page;
            }
        }
        $this->set('pagesForHeader', $pagesForHeader);
        $this->set('pagesForFooter', $pagesForFooter);
    }
5554
public function afterDelete($event)
    {
        if (!$this->enableAuditField) {
            parent::afterDelete($event);
            return;
        }

        $date = time();
        $auditModels = $this->getAuditModels();
        $auditRequestId = $this->getAuditRequestId();
        $userId = Yii::app()->user && Yii::app()->user->id ? Yii::app()->user->id : 0;
        $auditFields = array();

        // prepare the logs
        $pk = $this->getModelPrimaryKeyString($this->auditModel);
        foreach ($auditModels as $auditModel) {
            $prefix = isset($auditModel['prefix']) ? $auditModel['prefix'] . '.' . $pk : '';
            $auditFields[] = array(
                'old_value' => '',
                'new_value' => '',
                'action' => 'DELETE',
                'model_name' => $auditModel['model_name'],
                'model_id' => $auditModel['model_id'],
                'field' => $prefix . '*',
                'created' => $date,
                'user_id' => $userId,
                'audit_request_id' => $auditRequestId,
            );
        }

        // insert the audit_field records
        $this->addAuditFields($auditFields);

        parent::afterDelete($event);
    }
122841
public function beforeFilter(Event $event)
    {
        $this->controller = $event->getSubject();
        $this->request = $this->controller->request;
        $this->action = $this->request->getParam('action');
        $this->Filters = TableRegistry::get($this->getConfig('filterTable'));

        $this->_setupSort();
        $this->_setupFilters();
        $this->_setupPagination();
    }
114756
protected function beforeSave($event)
    {
        if ($this->autoSave) {
            $this->saveFile($this->owner->{$this->uploadAttribute}, $this->name, $this->path);
        }
    }
868480
protected function update(Event $event)
    {
        $this->dispatch(static::EVENT_UPDATE_BEFORE, $event);
        if (!$event->isPropagationStopped()) {
            $this->updateProcess($event);
            if (!$event->isPropagationStopped()) {
                $this->dispatch(static::EVENT_UPDATE_AFTER, $event);
            }
        }
    }
776725
public function beforePrepare(Event $event)
	{
		$operation = $event['command']->getOperation();
		$client = $event['command']->getClient();

		if ($operation->hasParam('collection') === false) return;
		if (is_null($client->getCollectionName())) return;

		$operation->getParam('collection')->setDefault($client->getCollectionName());
		$operation->getParam('collection')->setStatic(true);

	}