function &get($key) { if ($key == '_id') { return $this->id; } if (array_key_exists($key, $this->document)) { return $this->document[$key]; } user_error(sprintf(self::E_Field, $key), E_USER_ERROR); }