Checks if the defined attributes are unserializeable and unserializes their values

@param mixed $event
542252
public function scalableToVirtual($event = null)
    {
        if (($this->scalableAttributeName() !== null) &&
        ($this->virtualAttributesNames() !== null)) {

            $virtualAttributesConf = [];
            foreach ($this->virtualAttributesNames() as $name) {
                $virtualAttributesConf[$name] = '';
            }

            $virtualAttributesNames = ArrayHelper::merge(
                $virtualAttributesConf,
                (($a = $this->unConvert($this->owner->{$this->scalableAttributeName()})) !== null) ? $a : []
            );

            foreach ($virtualAttributesNames as $name => $value) {
                if (in_array($name, $this->virtualAttributesNames())) {
                    $this->owner->{$name} = $value;
                }
            }
        }
    }
1318203
public function onPostBind($event)
    {
        $form = $event->getForm();

        if ( ! $form->isRoot()) return;

        $clientData = $event->getForm()->getData();

        if ( ! is_object($clientData)) return;

        $this->filterService->filterEntity($clientData);

    }
586192
public function determineEventBinding(Event $event)
    {
        switch ($event->getCode()) {
            case Event::RESOURCE_DELETED:
                return 'delete';
                break;
            case Event::RESOURCE_CREATED:
                return 'create';
                break;
            case Event::RESOURCE_MODIFIED:
                return 'modify';
            break;
        }
    }
1258312
public function unserialize($data)
    {
        $vars = unserialize($data);
        foreach ($vars as $var => $value) {
            $this->{$var} = $value;
        }
    }
864188
public function unserialize($serialized)
    {
        $objectData = unserialize($serialized);

        foreach ($objectData as $propertyName => $propertyValue)
        {
            $this->{$propertyName} = $propertyValue;
        }
    }
1295982
public function unserialize($serialized)
    {
        $attributes = unserialize($serialized);

        $conn = Ioc::make(Pool::class)->getConnection();
        $db = $conn->defaultDatabase;
        $collectionObject = $conn->getRawConnection()->$db->{$attributes['collection']};

        foreach ($attributes as $key => $value) {
            $this->$key = $value;
        }

        $this->collection = $collectionObject;
    }
1242949
public function onSaving($event, $payload)
    {
        list($model) = $payload;

        if (!$this->isEncodable($model)) {
            return;
        }

        foreach ($model->getDirtyEncodableAttributes() as $attribute) {

            // If the attribute has a value, encode the attribute
            if ($model->getAttribute($attribute)) {
                $model->encodeOnSave($attribute);
            }

            // Otherwise delete encoding references
            elseif ($encoding = $model->encoding($attribute)) {
                $encoding->delete();
            }
        }
    }
793454
public static function clear(string $event = '') {
		if (empty($event)) {
			self::$events = [];
		} else {
			self::$events[$event] = [];
		}
	}
345414
protected function getSerializeValue($value, $event)
    {
        switch ($event) {
            case ActiveRecord::EVENT_BEFORE_INSERT:
            case ActiveRecord::EVENT_BEFORE_UPDATE:
                if (is_array($value)) {
                    $value = serialize($value);
                }
                break;
            case ActiveRecord::EVENT_AFTER_FIND:
                $value = @unserialize($value) ?: $value;
                break;
        }
        return $value;
    }
1005449
public function prepareConfig($event)
    {
        if (empty($this->batch_type)) {
            $this->batch_type = null;
        }
        if (isset($this->_configObject)) {
            if (!$this->configObject->validate()) {
                $this->addError('config', 'Invalid configuration');
                $event->isValid = false;
                return false;
            }
            try {
                $attributes = $this->configObject->attributes;
                unset($attributes['model']);
                $this->config = json_encode(['class' => get_class($this->configObject), 'attributes' => $attributes]);
            } catch (\Exception $e) {
                \d($this->_configObject);
                exit;
            }
        } else {
            $this->addError('config', 'Need to provide configuration for this subscription');
            $event->isValid = false;
            return false;
        }
    }
1005468
private function shouldHandle($event)
    {
        if ($event instanceof TransactionalEvent) {
            return true;
        }

        $event = is_string($event) ? $event : get_class($event);

        foreach ($this->excluded as $excluded) {
            if ($this->matches($excluded, $event)) {
                return false;
            }
        }

        foreach ($this->transactional as $transactionalEvent) {
            if ($this->matches($transactionalEvent, $event)) {
                return true;
            }
        }

        return false;
    }
119245
public function translateAttributes($event)
    {
        foreach ($this->translateAttributes as $attribute) {
            $this->owner->{$attribute} = Yii::t($this->category, $this->owner->attributes[$attribute]);
        }
    }
915185
private function serializeFields($props, $event) {
        array_map(function (ReflectionProperty $prop) use (&$fields, $event) {
            /** @var ReflectionProperty $prop */
            $prop->setAccessible(true);
            $fields[$prop->getName()] = $this->valueSerializer->serialize($prop->getValue($event));
        }, $props);

        return $fields;
    }
576518
public function onBeforeValidate($event)
    {
        foreach ($this->attributeValues as $name => $value) {

            $options = ArrayHelper::merge([
                'class' => DateValidator::className(),
                'format' => $value->localFormat[1],
            ], $this->validatorOptions);

            $validator = Yii::createObject($options);
            $validator->validateAttributes($this->owner, [$value->localAttribute]);
        }
    }
910057
public function addData(Serializing $event)
    {
        if ($event->isSerializer(ForumSerializer::class) && $event->actor->isAdmin()) {
            $event->attributes['datitisev-dashboard.data'] = [
                'postCount'       => Post::where('type', 'comment')->count(),
                'discussionCount' => Discussion::count(),
                'userCount'       => User::where('is_email_confirmed', 1)->count(),
            ];
        }
    }
531968
public function beforeUpdate($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['modifiedField']) && !$this->owner->isAttributeChanged($this->fields['modifiedField'])) {
            $this->owner->{$this->fields['modifiedField']} = $nowDate;
        }
        if (isset($this->fields['modifiedByField']) && !$this->owner->isAttributeChanged($this->fields['modifiedByField'])) {
            $this->owner->{$this->fields['modifiedByField']} = self::_getUserId();
        }
    }
1350401
public function isBlameable($event = null)
    {
        return $event ? array_key_exists($event, $this->getFields()) : count($this->getFields()) > 0;
    }