src/Model/Attribute/Accessor/State.php
public function setState(?int $state)
    {
        if (null !== $state && $this->getStates() && !in_array($state, $this->getStates(), true)) {
            throw new DomainException('State "'.$state.'" does not exist.');
        }

        $this->state = $state;

        return $this;
    }
public function setState(?int $state)
    {
        if (null !== $state && $this->getStates() && !in_array($state, $this->getStates(), true)) {
            throw new DomainException('State "'.$state.'" does not exist.');
        }

        $this->state = $state;

        return $this;
    }
Set state

@param integer $state
@return object
@throws \DomainException