public function setResult($result = null) { $this->result = $result; $this->state = self::STATE_DONE; if ($this->listeners) { $this->listeners->executeAll($this->result); } }