/** * Gets the initial state for a newly created entity */ public function getCreationState() { if (!isset($this->creation_state)) { $this->creation_state = WorkflowState::load($this->creation_sid); } if (!$this->creation_state) { $this->creation_state = WorkflowState::create($this->wid, '(creation)'); } return $this->creation_state; }