Does the model use blameable fields for an event?

@param string $event One of (created|updated|deleted), or omitted for any

@return bool
495637
public function isBlameable(Model $model, $event = null)
    {
        return $event ?
            array_key_exists($event, $this->getBlameableFields($model)) :
            count($this->getBlameableFields($model)) > 0;
    }
489769
public function off(string $event)
    {
        if (false === ($key = array_search($event, $this->getSupportedEvents(), true))) {
            return null;
        }

        if (!isset($this->eventHandlers[$key]) || !($cb = $this->eventHandlers[$key])) {
            return null;
        }

        $this->eventHandlers[$key] = null;

        return $cb;
    }
1242828
public function beforeFieldRender($event)
    {
        $clientOptions = $this->getFieldClientOptions($event->getTarget());
        if (!empty($clientOptions)) {
            $this->attributes[] = $clientOptions;
        }
    }
709054
public function _toHuman($event)
    {
        foreach ($this->handle as $field => $format) {
            $this->owner->{$field} = $this->_formatForHuman($this->owner->{$field}, $format);
        }

        return true;
    }
1010904
protected function _checkEvent(Event $event) {
		$className = $this->_getAdapterClassFromConfig($event->getData('entity')['adapter']);
		$classes = $this->_adapterClasses;

		if (!empty($classes) && !in_array($className, $classes)) {
			$message = 'The listener `%s` doesn\'t allow the `%s` adapter class! Probably because it can\'t work with it.';
			throw new StorageException(sprintf(
				$message,
				get_class($this),
				$className
			));
		}

		return $event->getSubject() instanceof Table && $this->_modelFilter($event);
	}
773311
public static function off($event)
    {
        if (self::hasEvent($event)) {
            unset(self::$events[$event], self::$eventHandlers[$event]);

            return true;
        }

        return false;
    }
1326748
public function col_relatedfullnameuser($event) {
        // Add affected user.
        if (!empty($event->relateduserid) && $username = $this->get_user_fullname($event->relateduserid)) {
            if (empty($this->download)) {
                $params = array('id' => $event->relateduserid);
                if ($event->courseid) {
                    $params['course'] = $event->courseid;
                }
                $username = html_writer::link(new moodle_url('/user/view.php', $params), $username);
            }
        } else {
            $username = '-';
        }
        return $username;
    }
70123
public function has_events($event)
	{
		if (isset($this->_events[$event]) and count($this->_events[$event]) > 0)
		{
			return true;
		}
		return false;
	}
240035
public function beforeDelete($event)
    {
        $oldId = $this->owner->{$this->savedAttribute};
        if (($oldModel = FileModel::findOne($oldId)) !== null) {
            $event->isValid = $event->isValid && $oldModel->delete();
        }
    }
1342644
public function beforeSave($event) {
		if ($this->getOwner()->getIsNewRecord() && ($this->createAttribute !== null)) {
			$this->getOwner()->{$this->createAttribute} = $this->getTimestampByAttribute($this->createAttribute);
		}
		if ((!$this->getOwner()->getIsNewRecord() || $this->setUpdateOnCreate) && ($this->updateAttribute !== null)) {
			$this->getOwner()->{$this->updateAttribute} = $this->getTimestampByAttribute($this->updateAttribute);
		}
	}
504917
public static function execute(Event $event) {
    $root_package = $event->getComposer()->getPackage();
    $patched_dependencies = static::getPatchedDependencyConstraints($root_package);
    $error = [];

    /** @var \Composer\Package\Link $package */
    foreach ($patched_dependencies as $package) {
      if (static::packageIsUnpinned($package)) {
        $error[] = $package->getTarget() . ': ' . $package->getPrettyConstraint();
      }
    }
    if (!empty($error)) {
      array_unshift($error, 'The following dependencies are patched but don\'t have pinned dependency constraints:');
      $event->getIO()->writeError($error);
      return FALSE;
    }
    else {
      $event->getIO()->write('Patched dependencies have constraints that are properly pinned.');
    }
  }
828381
public function beforeUpdate($event = null)
    {
        foreach (['child', 'parent'] as $role) {
            $primaryField = $this->getPrimaryField($role);
            $this->wasPrimary[$role] = !empty($this->owner->{$primaryField});
            if (!$this->owner->isActive) {
                $this->owner->{$primaryField} = 0;
            }
        }

        return true;
    }
375404
public function evaluateAttributes($event)
    {
        if (in_array($event->name, $this->events)) {
            foreach ($this->attributes as $type => $attributes) {
                $method = 'get' . $type . 'value';
                if (method_exists($this, $method)) {
                    foreach ( (array) $attributes as $attribute) {
                        $this->owner->$attribute = $this->$method($this->owner->$attribute, $event->name);
                    }
                }
            }
        }
    }
1350401
public function isBlameable($event = null)
    {
        return $event ? array_key_exists($event, $this->getFields()) : count($this->getFields()) > 0;
    }
968818
public function handleParseDate($event)
    {
        if ($event->getResult() === null) {
            /** @var Date $dateAdapter */
            $dateAdapter = $this->framework->getAdapter(Date::class);
            $event->setResult($dateAdapter->parse($event->getFormat(), $event->getTimestamp()));
        }
    }
856448
public function afterSave($event)
    {
        if (!$this->enableAuditField) {
            parent::afterSave($event);
            return;
        }

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

        // insert
        if ($this->owner->isNewRecord) {
            foreach ($newAttributes as $name => $new) {
                if (in_array($name, $this->ignoreFields['insert'])) continue;

                // prepare the values
                $new = trim($new);
                if (!$new) continue;

                // prepare the logs
                foreach ($auditModels as $auditModel) {
                    if (isset($auditModel['ignoreFields']) && in_array($name, $auditModel['ignoreFields'])) continue;
                    $auditFields[] = array(
                        'old_value' => '',
                        'new_value' => $new,
                        'action' => 'INSERT',
                        'model_name' => $auditModel['model_name'],
                        'model_id' => $auditModel['model_id'],
                        'field' => $auditModel['prefix'] . $name,
                        'created' => $date,
                        'user_id' => $userId,
                        'audit_request_id' => $auditRequestId,
                    );
                }
            }
        }

        // update
        else {
            // compare old and new
            foreach ($newAttributes as $name => $new) {
                if (in_array($name, $this->ignoreFields['update'])) continue;

                // prepare the values
                $old = !empty($oldAttributes) ? trim($oldAttributes[$name]) : '';
                $new = trim($new);
                if (in_array($old, $this->ignoreValues)) $old = '';
                if (in_array($new, $this->ignoreValues)) $new = '';
                if ($new == $old) continue;

                // prepare the logs
                foreach ($auditModels as $auditModel) {
                    if (isset($auditModel['ignoreFields']) && in_array($name, $auditModel['ignoreFields'])) continue;
                    $auditFields[] = array(
                        'old_value' => $old,
                        'new_value' => $new,
                        'action' => 'UPDATE',
                        'model_name' => $auditModel['model_name'],
                        'model_id' => $auditModel['model_id'],
                        'field' => $auditModel['prefix'] . $name,
                        'created' => $date,
                        'user_id' => $userId,
                        'audit_request_id' => $auditRequestId,
                    );
                }
            }
        }

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

        // set the dbAttributes to the new values
        $this->_dbAttributes = $this->owner->attributes;

        parent::afterSave($event);
    }
563016
private function isSkippableEvent(Event $event)
    {
        if (!$this->firstBackgroundEnded) {
            return false;
        }

        return $event instanceof BackgroundTested || $this->isNonFailingConsequentBackgroundStep($event);
    }