public function setId($id) { if (empty($this->_id)) { $this->_id = $id; } else { throw new LogicException('Resource already exists. Cannot change the id.'); } }