public function relationship($name) { if (!isset($this->_rels[$name])) { throw new \InvalidArgumentException("Unknown relationship {$name}"); } return $this->_rels[$name]; }