Resolve and return the given value, for the given setter method

@param string $setterMethodName The setter method to be invoked
@param mixed $value The value to be passed to the setter method

@return mixed
542339
protected function resolveValue(string $setterMethodName, $value)
    {
        $reflection = new ReflectionClass($this);

        $method = $reflection->getMethod($setterMethodName);

        $parameter = $method->getParameters()[0];

        return $this->resolveParameter($parameter, $value);
    }
681110
public function set($value = null)
    {
        //get args
        $args = func_get_args();
        
        if (count($args) < 2) {
            return $this;
        }
        
        $value = array_pop($args);
        $last = array_pop($args);
        
        $pointer = &$this->data;
        foreach ($args as $i => $step) {
            if (!isset($pointer[$step])
                || !is_array($pointer[$step])
            ) {
                $pointer[$step] = array();
            }

            $pointer = &$pointer[$step];
        }
        
        $pointer[$last] = $value;
        
        return $this;
    }
361387
public function setValue($value)
	{
		// any preparation goes here, for example casting to int
		$errors = $this->getValidationErrors($value);
		// if specific validation existed would go here & if
		// anything goes wrong will put error message into errors
		if(!empty($errors))
			throw $this->getContext()->getModel('ValidationException', 'Form', array(($errors)));
		return $value;
	}
707965
public function get($value)
    {
        $id = is_object($value) ? spl_object_hash($value) : $value;
        if (isset($this->_data[$id])) {
            return $this->_data[$id];
        }
        throw new ORMException("No collected data associated to the key.");
    }
226915
private static function _checkAndReturnMany($method, $value) 
    {
        $cls = get_called_class();
        if (array_key_exists($cls, self::$_has_many)
            && array_key_exists($method, self::$_has_many[$cls])
        ) {
            return self::_resolveHasMany($method, $value);
        }
    }
6154
public function setSetting( $name, $value )
    {
        $old = isset( $this->settings[$name] )
            ? $this->settings[$name]
            : null;

        if ( $old instanceof self || $value instanceof self )
        {
            if ( $old instanceof self && $value instanceof self )
            {
                $old->setSettings( $value->settings );
            }
            else if ( $old instanceof self )
            {
                if ( $value instanceof Traversable )
                {
                    $value = ArrayUtils::iteratorToArray( $value );
                }

                $old->setSettings( (array) $value );
            }
            else
            {
                $this->settings[$name] = $value;
            }
        }
        else
        {
            $method = array( $this, 'update' . ucfirst( $name ) );

            if ( is_callable( $method ) &&
                 ( ( isset( $value )    && isset( $this->settings[$name] )
                                        && $value != $this->settings[$name] ) ||
                   ( isset( $value )    && ! isset( $this->settings[$name] ) ) ||
                   ( ! isset( $value )  && isset( $this->settings[$name] ) ) ) )
            {
                $value = $method( $value, $old );
            }

            if ( null === $value )
            {
                unset( $this->settings[$name] );
            }
            else
            {
                $this->settings[$name] = $value;
            }
        }

        return $this;
    }
1169413
private function sregValue($value = '')
    {
        $owner = $this->owner;
        $values = explode('|', $value);
        $count = count($values);
        foreach ($values as $key => $fieldPath) {
            if ($fieldPath == '' || $fieldPath == 'null') {
                return null;
            } elseif ($relValue = $this->sregTraverse($fieldPath)) {
                if (is_object($relValue) && method_exists($relValue, 'AbsoluteLink')) {
                    if ($link = $relValue->AbsoluteLink()) {
                        return $link;
                    } else {
                        continue;
                    }
                } else {
                    return $relValue;
                }
            } elseif ($key + 1 == $count && !$owner->hasMethod($fieldPath) ) {
                return $fieldPath;
            }
        }
    }
179881
protected function getRestoredPropertyValue($value)
    {
        if (! $value instanceof ModelIdentifier) {
            return $value;
        }

        return is_array($value->id)
                ? $this->restoreCollection($value)
                : $this->restoreModel($value);
    }
484806
protected function resolveValue($value)
    {
        do {
            if ($value instanceof \JsonSerializable) {
                $value = $value->jsonSerialize();
            } elseif ($value instanceof \Closure) {
                $value = $value();
            } else {
                break;
            }
        } while (true);

        return $value;
    }
1313322
protected function resolveBinding($key, $value)
    {
        // Explicit binding
        if (isset($this->bindings[$key])) {
            list($binder, $errorHandler) = $this->bindings[$key];

            $callable = $this->getBindingCallable($binder, $value);

            return $this->callBindingCallable($callable, $value, $errorHandler);
        }

        // Implicit binding
        foreach ($this->implicitBindings as $binding) {
            $class = $binding['namespace'] . '\\' . $binding['prefix'] . ucfirst($key) . $binding['suffix'];

            if (class_exists($class)) {
                $instance = $this->resolveClass($class);

                // If special method name is defined, use it, otherwise, use the default
                if ($method = $binding['method']) {
                    $callable = [$instance, $method];
                } else {
                    $callable = $this->getDefaultBindingResolver($instance, $value);
                }

                return $this->callBindingCallable(
                    $callable,
                    $value,
                    $binding['errorHandler']
                );
            }
        }

        // Return the value unchanged if no binding found
        return $value;
    }
1101604
public function _set($name, $value)
    {
        $setMethod = 'set' . ucfirst($name);
        if (method_exists($this, $setMethod)) {
            $this->$setMethod($value);
        } else {
            throw new \InvalidArgumentException(sprintf('Setter does not exist for "%s" property', $name));
        }
        return $this;
    }
59756
public function set($key, $value)
    {
        $value = $this->plain($value);
        $method = 'set'.$key;

        if (method_exists($this, $method)) {
            return $this->$method($value);
        }

        return $this->metas[$key] = self::cut($value, $key);
    }
633338
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->resolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $context->markAsNeedsCompleteGeneration();
        $fixtureReferenceResult = $this->resolver->resolve($value->getReference(), $fixture, $fixtureSet, $scope, $context);
        $context->unmarkAsNeedsCompleteGeneration();

        /** @var ResolvedFixtureSet $fixtureSet */
        list($instance, $fixtureSet) = [$fixtureReferenceResult->getValue(), $fixtureReferenceResult->getSet()];

        try {
            $propertyValue = $this->propertyAccessor->getValue($instance, $value->getProperty());
        } catch (SymfonyNoSuchPropertyException $exception) {
            throw NoSuchPropertyExceptionFactory::createForFixture($fixture, $value, 0, $exception);
        } catch (\Exception $exception) {
            throw UnresolvableValueExceptionFactory::create($value, 0, $exception);
        }

        return new ResolvedValueWithFixtureSet(
            $propertyValue,
            $fixtureSet
        );
    }
497312
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->resolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $quantifier = $value->getQuantifier();
        if ($quantifier instanceof ValueInterface) {
            $resolvedSet = $this->resolver->resolve($quantifier, $fixture, $fixtureSet, $scope, $context);
            list($quantifier, $fixtureSet) = [$resolvedSet->getValue(), $resolvedSet->getSet()];

            if (false === is_int($quantifier) && false === is_string($quantifier)) {
                throw UnresolvableValueExceptionFactory::createForInvalidResolvedQuantifierTypeForOptionalValue($value, $quantifier);
            }
        }

        $realValue = (mt_rand(0, 99) < $quantifier)
            ? $value->getFirstMember()
            : $value->getSecondMember()
        ;
        if ($realValue instanceof ValueInterface) {
            return $this->resolver->resolve($realValue, $fixture, $fixtureSet, $scope, $context);
        }

        return new ResolvedValueWithFixtureSet($realValue, $fixtureSet);
    }
28222
protected function getRestoredPropertyValue($value)
	{
		if (! $value instanceof ModelIdentifier) {
			return $value;
		}

		return is_array($value->id)
				? $this->restoreCollection($value)
				: (new $value->class)->newQuery()->useWritePdo()->findOrFail($value->id);
	}
527350
final public function set($name, $value)
    {
        $method = 'set'.ucfirst($name);
        if(!method_exists($this, $method) ) {
            parent::set($name, $value);
        } else {
            $this->$method($value);
        }

        return $this;
    }
248620
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        $valueForCurrent = $fixture->getValueForCurrent();

        if ($valueForCurrent instanceof FixtureInterface) {
            $valueForCurrent = new SimpleFixture(
                $valueForCurrent->getId(),
                $valueForCurrent->getClassName(),
                $valueForCurrent->getSpecs(),
                $fixtureSet->getObjects()->get($valueForCurrent)->getInstance()
            );
        } else {
            $valueForCurrent = $fixtureSet->getFixtures()->get($fixture->getId());
        }

        return new ResolvedValueWithFixtureSet(
            $valueForCurrent,
            $fixtureSet
        );
    }