@param array $value

@throws \Exception
761935
public function execute($value)
    {
        $queryBuilder = $this->getQueryBuilder();

        $queryBuilder->having($this->getIndex() . " = :{$this->getIndexClean()}")
            ->setParameter($this->getIndexClean(), $value);
    }
664075
public function offsetSet($offset, $value) {
        if ($this->__data === null) {
            throw new Exception('Cannot access to a deleted object');
        }

        if (is_null($offset)) {
            $this->__data[] = $value;
        } else {
            $this->__data[$offset] = $value;
        }
    }
933891
public function setDefinedWritableValues(array $values)
    {
        foreach ($this->_definition as $key => $value) {
            if ($this->isWritable($key)) {
                $this->setOptionalValueInArray($key, $values);

                if (!array_key_exists($key, $values)) {
                    throw new Exception ('Value is missing for "' . $key . '"');
                }


                $this->$key = $values[$key];
            }
        }

        return $this;
    }
1325558
public function _set($name, $value)
    {
        $object = $this->getObject();
		$callable = function() use ($name, $value, $object) {
			if (!property_exists($object, $name) && !method_exists($object, '__set'))
			{
				throw new \Exception('Property ' . $name . ' doesn\'t exist on object of class ' . get_class($object));
			}
			$object->$name = $value;
		};
		$this->breakScopeAndExecute($callable);
    }
199156
public function setPreSendHandler($value) {
        if ($value !== null && !is_callable($value)) {
            throw new \Exception('A function is expected, or null.');
        }

        $this->preSendHandler = $value;
    }
1355610
public function setFlushHandler($value) {
        if ($value !== null && !is_callable($value)) {
            throw new \Exception('A function is expected, or null.');
        }

        $this->flushHandler = $value;
    }
143553
public function setValue($value)
    {
        if (is_scalar($value)) {
            $this->value = new StringValue($value);
        } elseif (is_array($value)) {
            $this->value = new ArrayValue($value);
        } else {
            if (!$value instanceof ValueInterface) {
                throw new \Exception('The value must implement the ValueInterface.');
            } else {
                $this->value = $value;
            }
        }

        return $this;
    }
57885
public function set($key, $value)
    {
        if (empty($key)) {
            throw new Exception("Key must be set");
        }

        $parts = array_reverse(explode(".", $key));
        $file = array_pop($parts);

        // we'll try to load a configuration file (if exists)
        if (!isset($this->registry[$file])) {
            $this->registry[$file] = $this->discover($file);
        }

        foreach ($parts as $part) {
            $value = array($part => $value);
        }

        if (is_array($this->registry[$file]) && (is_array($value))) {
            $this->registry[$file] = array_replace_recursive($this->registry[$file], $value);
        } else {
            $this->registry[$file] = $value;
        }
    }
1147946
public function validateValue($value)
    {
        if (!$value instanceof MoneyInterface) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    'Value of type "%s" is invalid for %s; must implement "%s"',
                    is_object($value) ? get_class($value) : gettype($value),
                    get_class($this),
                    MoneyInterface::class
                )
            );
        }
    }
1166116
public function setValue($value)
    {
        $value = $this->preformatValue($value);
        $manager = $this->getManager();
        $manager->clean();
        foreach ($value as $linkModel) {
            if (
                false === ($linkModel instanceof ModelInterface) &&
                !is_a($linkModel, $this->modelClass)) {
                $linkModel = call_user_func([$this->modelClass, 'objects'])->get(['pk' => $linkModel]);
            }

            if ($linkModel instanceof ModelInterface) {
                $manager->link($linkModel);
            } else {
                throw new Exception('ManyToMany field can set only arrays of Models or existing primary keys');
            }
        }
    }
606676
public function load($value = null)
    {
        if (is_array($value)) {
            $this->loadFromArray($value);
        } elseif (is_string($value) && file_exists($value)){
            $this->loadFromFile($value);
        }
    }
1202588
public function set($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (is_array($value))
        {
            throw new Exception('Must use setArray() or setAssociativeArray() for this value.');
        }
        $this->_performOperation($key, new SetOperation($value));
    }
909052
public function setValue($value)
    {
        if (is_array($value)) {
            if (1 === count($value)) {
                $this->value = $value[0];
            } else {
                throw new \InvalidArgumentException('The argument must either be a string or an array with only one child');
            }
        } else {
            $this->value = $value;
        }
    }
1182349
public function setAttribute($key, $value)
    {

        // if the value is already set, throw an exception
        if (isset($this[$uid = $this->maskKey($key)])) {
            throw new \Exception(
                sprintf('A value with key %s has already been set in application %s', $key, $this->getName())
            );
        }

        // append the value to the application
        $this[$uid] = $value;
    }
745941
public static function inArray($value, array $array, $message = null)
    {
        if (!in_array($value, $array)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Value %s is not in array',
                Helper::valueToString($value)
            ));
        }
    }
520430
public function setAssociativeArray($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (!is_array($value))
        {
            throw new Exception('Must use set() for non-array values.');
        }
        $this->_performOperation($key, new SetOperation($value, true));
    }
1341010
public static function command($value): void
    {
        if (false === self::message($value)) {
            throw new Exception\InvalidCommand($value);
        }
    }