public function setDataEntry($id, $key, $value) { if (!isset($this->data[$id])) { throw new InvalidArgumentException("Missing row with ID {$id}."); } if (!$this->isDetached and $key === $this->mapper->getPrimaryKey($this->table)) { // mapper is always set when Result is not detached throw new InvalidArgumentException("ID can only be set in detached rows."); } $this->modified[$id][$key] = true; $this->data[$id][$key] = $value; }