ActiveRecord afterFind event. If the property of this plugin inside the model, the event will not be triggered.

@param \yii\base\Event $event An event that is triggered after the record is created and populated with query result.
502759
public function onFind($event)
    {
        if ($this->isAttributeWriteable($event) && $this->onBeforeFind($event)) {
            if ($this->i18n) {
                $event->sender->setAttribute($this->name, $this->i18nDecodedGetActive($this->i18nFieldDecode($event->sender->getAttribute($this->name), $this->i18nEmptyValue)));
            }
            
            $this->onAfterFind($event);
        }
    }
240035
public function beforeDelete($event)
    {
        $oldId = $this->owner->{$this->savedAttribute};
        if (($oldModel = FileModel::findOne($oldId)) !== null) {
            $event->isValid = $event->isValid && $oldModel->delete();
        }
    }
694285
public function afterSave(Event $Event) {
		if ($this->_checkEvent($Event)) {
			$table = $Event->getSubject();
			$record = $Event->getData('record');
			$Storage = StorageManager::adapter($record->adapter);
			try {
				$id = $record->{$table->primaryKey()};
				$filename = $this->stripDashes($id);
				$file = $record['file'];
				$record['path'] = $this->fsPath('images' . DS . $record['model'], $id);
				if ($this->_config['preserveFilename'] === true) {
					$path = $record['path'] . $record['filename'];
				} else {
					$path = $record['path'] . $filename . '.' . $record['extension'];
				}

				if ($this->adapterClass === 'AmazonS3' || $this->adapterClass === 'AwsS3') {
					$path = str_replace('\\', '/', $path);
					$record['path'] = str_replace('\\', '/', $record['path']);
				}

				$Storage->write($path, file_get_contents($file['tmp_name']), true);

				$data = $table->save($record, [
					'validate' => false,
					'callbacks' => false
				]);

				$operations = Configure::read('FileStorage.imageSizes.' . $record['model']);
				if (!empty($operations)) {
					$this->_createVersions($table, $record, $operations);
				}
				$table->data = $data;
			} catch (\Exception $e) {
				$this->log($e->getMessage());
			}
		}
	}
374317
public function afterFind()
    {
        if ($this->autoFetchProperties === true) {

            /** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
            $owner = $this->owner;
            $owner->ensurePropertyGroupIds();

            $models = [&$owner];
            PropertiesHelper::fillProperties($models);
        }
        return true;
    }
845532
public function onModelAfterSave(Event $event)
    {
        /** @var User|bool $user */
        $user = $event->getData('user');

        if ($user instanceof EntityInterface) {
            if ($user->isNew() && Filter::bool($user->get('notify'))) {
                $this->_getMailer($user)->sendCreateMessage();
            }
        }
    }
329188
public function collectLogs($event)
	{
		$logger=Yii::getLogger();
		$dumpLogs=isset($event->params['dumpLogs']) && $event->params['dumpLogs'];
		foreach($this->_routes as $route)
		{
			/* @var $route CLogRoute */
			if($route->enabled)
				$route->collectLogs($logger,$dumpLogs);
		}
	}
214472
public function beforePaginate(Event $event)
    {
        $method = 'contain';
        if (method_exists($event->getSubject()->query, 'getContain')) {
            $method = 'getContain';
        }
        $contained = $event->getSubject()->query->$method();

        if (!empty($contained)) {
            return;
        }

        $models = $this->models();
        if (empty($models)) {
            return;
        }

        $event->getSubject()->query->contain(array_keys($models));
    }
985079
public function afterFind()
    {
        if (\Yii::$app->has('formatter')) {
            $this->latest_match = \Yii::$app->formatter->asDatetime($this->latest_match);
        }
        return parent::afterFind();
    }
735767
protected function eventLogger($event)
    {
        switch ($event->name) {
            case 'afterInsert':
                return Log::add(1, ['tableName' => 'cms_nav_item', 'action' => 'insert', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
            case 'afterUpdate':
                return Log::add(2, ['tableName' => 'cms_nav_item', 'action' => 'update', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
            case 'afterDelete':
                return Log::add(3, ['tableName' => 'cms_nav_item', 'action' => 'delete', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
        }
    }
652677
private function postProcess(Event $event)
	{
		$skipped = false;

		foreach ($this->dispatcher->getListeners($event) as $listener)
		{
			if (!($listener instanceof TraceableListener))
			{
				// A new listener was added during dispatch.
				continue;
			}

			// Unwrap listener
			//$this->dispatcher->removeListener($listener, $event);
			//$this->dispatcher->addListener($listener->getWrappedListener(), $event);
			$priority = $this->dispatcher->getListenerPriority($listener, $event);

			$this->dispatcher->getListeners()[$event->getName()]->remove($listener);
			$this->dispatcher->getListeners()[$event->getName()]->add($listener->getWrappedListener(), $priority);

			$info = $this->getListenerInfo($listener->getWrappedListener(), $event->getName());

			$eventName = $event->getName();

			if ($listener->wasCalled())
			{
				if (null !== $this->logger)
				{
					$this->logger->debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty']));
				}

				if (!isset($this->called[$eventName]))
				{
					$this->called[$eventName] = new \SplObjectStorage();
				}

				$this->called[$eventName]->attach($listener);
			}

			if (null !== $this->logger && $skipped)
			{
				$this->logger->debug(sprintf('Listener "%s" was not called for event "%s".', $info['pretty'], $eventName));
			}

			if ($listener->stoppedPropagation())
			{
				if (null !== $this->logger)
				{
					$this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName));
				}

				$skipped = true;
			}
		}
	}
1095135
public function after(AfterEvent $event)
    {
        $pagination = $event->getPaginationView();

        if (!$pagination instanceof SlidingPagination) {
            return;
        }

        $page = $pagination->getPage();

        if (null === $page) {
            $page = 1;
        } else {
            $pageNumber = (int)$page;

            if ((string)$pageNumber !== (string)$page || $pageNumber < 0 || $pageNumber > $pagination->getPageCount()) {
                throw new PageNotFoundException();
            }
        }

        $request = $this->requestStack->getCurrentRequest();

        if (!empty($request)) {
            if ($page > 1) {
                $request->attributes->set(self::REQUEST_ATTR_PAGE_PREV, $page - 1);
            }
            if ($page < $pagination->getPageCount()) {
                $request->attributes->set(self::REQUEST_ATTR_PAGE_NEXT, $page + 1);
            }
        }
    }
1286555
public function update($event)
    {
        $formName = $event->sender->formName();
        $primaryKey = $event->sender->primaryKey;

        /** @var ActiveRecord $sender */
        $sender = $event->sender;

        /** @var MetaTags $metaTags */
        $metaTags = $sender->{$this->relationName};
        if (!$metaTags) {
            $metaTags = Yii::createObject(MetaTags::class);
            $metaTags->model = $formName;
            $metaTags->model_id = $primaryKey;
            $metaTags->language = $this->lang();
        }
        $metaTags->load(Yii::$app->request->post());

        if ($metaTags->validate()) {
            $metaTags->save();
        }
    }
1354228
protected function triggerEvent($event)
    {
        $instance = static::cyrus();

        if (method_exists($instance, $event) &&
            in_array($event, $instance->getModelEvents())
        ) {
            $instance->{$event}($instance);
        }
    }
186697
public function afterUpdate($event)
    {
        $oldCondition = [];
        $currentCondition = [];
        /** @var ActiveRecord $owner */
        $owner = $this->owner;
        foreach ((array)$this->conditionAttributes as $attribute) {
            if (!$owner->hasAttribute($attribute)) {
                continue;
            }
            $oldCondition[$attribute] = $currentCondition[$attribute] = $owner->getAttribute($attribute);
            if (array_key_exists($attribute, $event->changedAttributes)) {
                $oldCondition[$attribute] = $event->changedAttributes[$attribute];
            }
        }
        if (array_diff($currentCondition, $oldCondition) != []) {
            // condition was changed
            /** @var ActiveRecord $changedModel */
            $changedModel = Yii::createObject($owner->className());
            $changedModel->setAttributes($oldCondition, false);
            // recalculate old model range
            $changedModel->recalculateSort();
            // move model to top in new model range
            $owner->updateAttributes([
                $this->sortAttribute => $owner->find()->andWhere($this->getCondition())->count() - 1
            ]);
        }
    }
1181748
public function afterSaveEvent($event)
    {
        if ($this->onlyRestScenarios) {
            if ($event->sender->scenario == ActiveController::SCENARIO_RESTCREATE || $event->sender->scenario == ActiveController::SCENARIO_RESTUPDATE) {
                $this->setRelation($event->sender->{$this->name}, $this->refJoinTable, $this->refModelPkId, $this->refJoinPkId, $event->sender->id);
            }
        } else {
            $this->setRelation($event->sender->{$this->name}, $this->refJoinTable, $this->refModelPkId, $this->refJoinPkId, $event->sender->id);
        }
    }
326933
public function afterDelete(Event $Event) {
		if ($this->_checkEvent($Event)) {
			$record = $Event->getData('record');
			$string = $this->_buildPath($record, true, null);
			if ($this->adapterClass === 'AmazonS3' || $this->adapterClass === 'AwsS3') {
				$string = str_replace('\\', '/', $string);
			}
			try {
				$Storage = StorageManager::adapter($record['adapter']);
				if (!$Storage->has($string)) {
					$Event->stopPropagation();
					$Event->result = false;

					return false;
				}
				$Storage->delete($string);
			} catch (\Exception $e) {
				$this->log($e->getMessage());
				$Event->stopPropagation();
				$Event->result = false;

				return false;
			}
			$operations = Configure::read('FileStorage.imageSizes.' . $record['model']);
			if (!empty($operations)) {
				$Event->setData('operations', $operations);
				$this->_removeVersions($Event);
			}
			$Event->stopPropagation();
			$Event->result = true;

			return true;
		}
	}
127386
public function beforeValidate($event)
    {
        $formName = $event->sender->formName();
        $primaryKey = $event->sender->primaryKey;

        /** @var ActiveRecord $sender */
        $sender = $event->sender;

        /** @var MetaTags $metaTags */
        $metaTags = $sender->{$this->relationName};
        if (!$metaTags) {
            $metaTags = Yii::createObject(MetaTags::class);
            $metaTags->model = $formName;
            $metaTags->model_id = $primaryKey;
            $metaTags->language = $this->lang();
            $metaTags->load(Yii::$app->request->post());
        }

        $sender->populateRelation($this->relationName, $metaTags);
    }