public function setCode($code) { if ($this->getCode()) { throw new RuntimeException("Can't move a fixed state to a new value."); } parent::setCode($code); }
public function setCode($code) { if (!$this->canTransitTo($code)) { throw new RuntimeException("Cannot change transactional state to the given new value."); } parent::setCode($code); }