Process value by registered data-type handler.
From resource to object.

@param  Attribute $definition
@param  mixed $value
@return mixed
@throws NotIterableAttribute
559464
protected function processHandlerFromResource(Attribute $definition, $value)
    {
        $type = $definition->getType();
        $handler = $this->handlers[$type];
        $parameters = $definition->getTypeParameters();

        if (! $definition->isMany()) {
            return $handler->fromResource($value, $type, $parameters);
        }

        if (! $value instanceof \Traversable && ! is_array($value)) {
            throw new NotIterableAttribute($definition, $value);
        }

        $collection = new \ArrayObject();

        foreach ($value as $item) {
            $collection[] = $handler->fromResource($item, $type, $parameters);
        }

        return $collection;
    }
459551
public function setAttribute(string $attribute, $value = []): self
    {
        $this->attributes[$attribute] = $this->wrap($value);

        return $this;
    }
1373607
public function setAttribute($attribute, $value)
    {
        switch ($attribute) {
            case 'isSlowOnly':
                // Set whether the connection must only log slow queries.
                // The slow threshold must be set on the profiler (100ms by default).
                $this->isSlowOnly = $value;
                break;
            default:
                parent::setAttribute($attribute, $value);
        }
    }
332178
public function setValueAttribute($value)
    {
        $registry = $this->getDataTypeRegistry();

        $this->attributes['type'] = $registry->getTypeForValue($value);
        $this->attributes['value'] = $registry->getHandlerForType($this->type)
            ->serializeValue($value);

        $this->cachedValue = null;
    }
949180
private function updateAttribute($attribute, $value)
    {
        if (property_exists($this, $attribute)) {
            $this->$attribute = $value;
        }

        return $this;
    }
284432
public function addAttribute($attribute, $value)
    {
        $this->attributes[$attribute] = (string) $value;
        $this->eventHandler->attributeAdded($this, $attribute, $value);
    }
267596
public function changing($attribute, $value)
    {
        $this->setToken('Attribute', $attribute);
        $this->setToken('Value', $value);

        return $this;
    }
334868
public function setAttribute($attribute, $value): Compound
    {
        if ($attribute !== 'link') {
            $this->attributes[$attribute] = $value;
        } else {
            $this->isLink = true;
            $this->link = $value;
        }

        return $this;
    }
299766
public function attr($name, $value = null)
    {
        if (func_num_args() < 2) {
            return @$this->attributes[$name];
        } else {
            if (is_null($value)) {
                unset($this->attributes[$name]);
            } else {
                $this->attributes[$name] = $value;
            }
            return $this;
        }
    }
1163461
public function attr($attribute, $value = null)
    {
        if (is_array($attribute)) return $this->attributes($attribute);
        if ($value) return $this->attributes(array($attribute => $value));
    }
754253
protected function castAttribute($attribute, $value)
    {
        if (array_key_exists($attribute, $this->filterCustomCasts())) {
            $customCastObject = $this->getCustomCastObject($attribute);

            return $customCastObject->castAttribute($value);
        }

        return parent::castAttribute($attribute, $value);
    }
1274541
public function withAttribute($attribute, $value)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        $that->attributes[$attribute] = $value;
        return $that;
    }
222797
protected function convertAttributeValue($key, $value)
    {
        return $this->store->convertAttributeValue($this->getDataType($key), $value);
    }
1366289
public function attribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            $this->attributes = array_merge($this->attributes, $attribute);
        } else {
            $this->attributes[$attribute] = (string) $value;
        }

        return $this;
    }
114709
public function fromResource(Attribute $definition, $value)
    {
        if (! $definition->hasType()) {
            return $this->processNotTypedFromResource($definition, $value);
        }

        $type = $definition->getType();

        if (isset($this->handlers[$type])) {
            return $this->processHandlerFromResource($definition, $value);
        }

        throw new UnknownDataTypeException($definition);
    }
68843
public function getDisplayableValue($attribute, $value)
    {
        if (isset($this->customValues[$attribute][$value])) {
            return $this->customValues[$attribute][$value];
        }

        $key = "validation.values.{$attribute}.{$value}";

        if (($line = $this->translator->trans($key)) !== $key) {
            return $line;
        }

        return $value;
    }
799210
public function setAttribute($attribute, $value, $scheme = null, $isComputed = false)
    {
        $this->attributes[$attribute] = $value;
        $this->scheme[$attribute] = $scheme;
        $this->is_computed[$attribute] = (true === $isComputed);

        return $this;
    }