@param array $value

@throws DomainException
@return $this
432040
public function setWebsites(array $value)
    {
        $websites = [];

        foreach ($value as $website) {
            if ($website instanceof Website) {
                $websites[] = $website->getId();
            } elseif (is_string($website)) {
                $websites[] = $website;
            } else {
                throw new DomainException('Each website must be string identifier or Website entity object');
            }
        }

        return $this->setAttribute('websites', $websites);
    }
712155
public function addValue($value)
    {
        if (!is_string($value)) {
            throw new DomainException('List value must be string identifier');
        }

        $listValues = $this->getAttribute('values') ?: [];
        $listValues[] = $value;

        return $this->setAttribute('values', $listValues);
    }
1083250
public function setOptionalPolicy($value): self
    {
        if (!in_array($value, self::optionalPolicies(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_POLICY, implode(', ', self::optionalPolicies())));
        }

        return $this->setAttribute('optionalPolicy', $value);
    }
847241
public function setDatetimeFormat($value)
    {
        if (!in_array($value, self::datetimeFormats(), true)) {
            throw new DomainException(
                sprintf(self::MSG_UNEXPECTED_DATETIME_FORMAT, implode(', ', self::datetimeFormats()))
            );
        }

        return $this->setAttribute('datetimeFormat', $value);
    }
91630
public function setParams($value)
    {
        if (!is_array($value)) {
            return $this;
        }

        foreach ($value as $identifier => $param) {
            $this->setParam($identifier, $param);
        }

        return $this;
    }
447
public function setAddress($value)
    {
        if (is_array($value)) {
            $value = new Address($value);
        }
        return $this->setParameter('address', $value);
    }
399890
public function setPlace($value)
    {
        if ($value !== null &&
           !in_array($value, self::$validPlaces, true)) {
            throw new DomainError('Invalid place');
        }
        $this->parameters['place'] = $value;
        return $this;
    }
488002
public function setRenewalPolicy($value)
    {
        if (!in_array($value, self::renewalPolicies(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_RENEWAL_POLICY, implode(', ', self::renewalPolicies())));
        }
        $this->setAttribute('renewalPolicy', $value);
    }
588501
public function setTaxCategoryId($value)
    {
        if (!in_array($value, self::allowedTaxCategories(), true)) {
            throw new DomainException(sprintf(
                self::MSG_UNEXPECTED_TAX_CATEGORY,
                implode(', ', self::allowedTaxCategories())
            ));
        }

        return $this->setAttribute('taxCategoryId', $value);
    }
896529
public function setValue($value)
    {
        switch (true) {
            case ($this instanceof Select):
                if (! is_array($value)) {
                    $value = (array) $value;
                }

                $this->value = $value;
                break;
            case ($this instanceof Textarea):
                $this->inner = $value;
                break;
            default:
                $this->attribute['value'] = $value;
                break;
        }

        return $this;
    }
401277
public function setArguments(array $array = array())
    {
        foreach ($array as $arg) {
            if (!is_scalar($arg)) {
                $type = gettype($arg);
                throw new DomainException("Arguments array should be an array of scalar, but found $type");
            }
            $this->addArgument($arg);
        }

        return $this;
    }
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;
    }
870384
public function add($value): AbstractArray
    {
        $value = $this->filterValue($value);
        if (is_null($value)) {
            return $this;
        }

        if (!in_array($value, $this->values)) {
            array_push($this->values, $value);
        }

        $this->atomics['$addToSet']['$each'][] = $value;

        return $this;
    }
997616
public function setStatus($value)
    {
        $allowedStatuses = self::allowedStatuses();

        if (!in_array($value, $allowedStatuses, true)) {
            throw new DomainException(sprintf(self::MSG_UNEXPECTED_STATUS, implode(', ', $allowedStatuses)));
        }

        return $this->setAttribute('status', $value);
    }
1025550
public function setCharacter($value)
    {
        if ($value !== self::CHARACTER_DEFAULT &&
           $value !== self::CHARACTER_KANSAI &&
           $value !== self::CHARACTER_BABY) {
            throw new DomainError('Invalid character');
        }
        $this->parameters['t'] = $value;
        return $this;
    }
116435
public function setValues(array $values)
    {
        $listValues = [];

        if (empty($values)) {
            throw new DomainException('Values cannot be empty');
        }

        foreach ($values as $value) {
            if (is_scalar($value)) {
                $listValues[] = $value;
            } else {
                throw new DomainException('Each value must be a scalar element');
            }
        }

        return $this->setAttribute('values', $listValues);
    }
1056335
public function setCorePhpthumbNooffsitelinkValidDomains($value)
    {
        $this->setFieldName('phpthumb_nooffsitelink_valid_domains');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }