@param mixed $value

@return closure

@throws MissingDataException
503169
protected function valueDeserializer()
    {
        return function($subject, array $data, $property, $defaultValue) {
            if (array_key_exists($property, $data)) {
                return $data[$property];
            }
            if (null === $defaultValue) {
                throw new MissingDataException(sprintf(
                    'Data is missing for %s::$%s, received keys: %s',
                    get_class($subject),
                    $property,
                    implode(', ', array_keys($data))
                ));
            }
            return $defaultValue;
        };
    }
701966
public function gt($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) > $value;
        };
    }
671385
protected function fetch($value)
    {
        if (empty($value)) {
            if (true === $this->null) {
                return;
            }
            throw new Exception('Value in fetch method of PrimaryKeyField cannot be empty');
        }

        return $this->fetchModel($value);
    }
46405
protected function validateType($value)
    {
        if (!$value instanceof Closure && $value !== null) {
            $exception = new InvalidTypeException(sprintf(
                'Invalid type for path "%s". Expected closure, but got %s.',
                $this->getPath(),
                gettype($value)
            ));

            if ($hint = $this->getInfo()) {
                $exception->addHint($hint);
            }

            $exception->setPath($this->getPath());

            throw $exception;
        }
    }
444950
protected function defaultValue(string $name, $value): Closure
    {
        return function (Table $table) use ($name, $value) {
            assert($table->hasColumn($name));
            $table->getColumn($name)->setDefault($value);
        };
    }
974785
public function __setter($key, $value)
    {
        if(isset($this->ignoreData[$key])){

            $this->ignoreData[$key] = $value;

        }else{

            $attrs = $this->getAttrs();

            if (isset($attrs[$key]) && isset($attrs[$key]['type']) ) {
                if (in_array($attrs[$key]['type'], array(self::DATA_TYPE_REFERENCE, self::DATA_TYPE_REFERENCES))) {
                    $value = $this->setRef($key, $value);
                } elseif (in_array($attrs[$key]['type'], array(self::DATA_TYPE_EMBED, self::DATA_TYPE_EMBEDS))) {
                    $value = $this->fillEmbed($key, $value);
                }
            }

            $value = $this->parseValue($key, $value, $this->getAttrs());

            if ( !isset($this->ignoreData[$key]) && ( !isset($this->cleanData[$key]) || $this->cleanData[$key] !== $value )) {
                $this->cleanData[$key] = $value;
                $this->dirtyData[$key] = $value;
            }

        }

    }
379662
private function normalizeValue($value)
    {
        if (is_resource($value)) {
            throw new JsonSerializerException("Can't serialize PHP resources.");
        }

        if ($value instanceof \Closure) {
            throw new JsonSerializerException("Can't serialize closures.");
        }

        if (is_object($value)) {
            return $this->normalizeObject($value);
        }

        if (is_array($value)) {
            return array_map([$this, 'normalizeValue'], $value);
        }

        return $value;
    }
47513
protected function normalizeValue($value)
    {
        $normalizedValue = $value;
        // object value
        if (is_object($value)) {
            if (get_class($value) === "DateTime") {
                $normalizedValue = $value->format("Y-m-d\TH:i:s.u\Z");
            } elseif ($value instanceof DataContainerInterface || method_exists($value, 'normalizeData')) {
                $normalizedValue = $value->normalizeData();
            } else {
                throw new PropertyValueNormalizationException(
                    "Value error: object of type [" . get_class($value) . "]
                    does not implement DataContainerInterface nor have a [normalizeData] method"
                );
            }
        } elseif (is_array($value)) {
            foreach ($value as $arrProperty => $arrValue) {
                $normalizedValue[$arrProperty] = $this->normalizeValue($arrValue);
            }
        }

        return $normalizedValue;
    }
1231001
public function prepend($value, $passedKey = null): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($value, $passedKey) {
            if ($passedKey) {
                yield $passedKey => $value;
            } else {
                yield $value;
            }

            foreach ($data as $key => $value) {
                if ($passedKey) {
                    yield $key => $value;
                } else {
                    yield $value;
                }
            }
        });
    }
50437
private function valueRetriever($value)
    {
        if ($this->useAsCallable($value)) {
            return $value;
        }

        return function ($item) use ($value) {
            if ($value === null) {
                return $item;
            }

            $item = (array)$item;
            return isset($item[$value]) ? $item[$value] : null;
        };
    }
148868
public function setValue( $value ) {
		$this->value = $this->cleanUpValue( $value );
		$this->input->setValue( $this->value );
		return $this;
	}
614282
public function delete($value)
    {
        $id = is_object($value) ? spl_object_hash($value) : $value;
        unset($this->_keys[$id]);
        unset($this->_data[$id]);
        return $this;
    }
785065
public function offsetSet($offset, $value)
    {
        if ( ! $value instanceof Closure) {
            $value = function() use ($value) {
                return $value;
            };
        }
        $this->bind($offset, $value);
    }
324862
protected function prepareData($value)
    {
        if (is_string($value)) {
            return stripslashes(trim(str_replace('\n', "\n", $value)));
        } elseif (is_array($value)) {
            return array_map('self::prepareData', $value);
        }

        return $value;
    }
34251
public function setValue($value, $data = null)
    {
        // Check Value Type:
        
        if (is_array($value)) {
            
            // Define Field Values:
            
            $this->honeypot->setValue(isset($value['value']) ? $value['value'] : null);
            $this->timestamp->setValue(isset($value['timestamp']) ? $value['timestamp'] : null);
            
            // Define Self Value:
            
            $this->value = $this->honeypot->dataValue();
            
        }
        
        // Answer Self:
        
        return $this;
    }
424237
public function setReturnEmpty($value)
    {
        if (is_bool($value)) {
            $this->_params['return-empty'] = ($value?'true':'false');
        } else if ($value != null) {
            $this->_params['return-empty'] = $value;
        } else {
            unset($this->_params['return-empty']);
        }
        return $this;
    }
768194
protected function generateValue($value)
    {
        switch (true) {
            case is_array($value):
                return $this->generateArray($value);
            case !is_object($value):
                return $value;
            case $value instanceof DateTime:
                return $value->format(Pin::TIME_FORMAT);
            case $value instanceof GeneratorInterface:
                return $value->generate();
        }

        throw new UnknownParameterException();
    }