getForeignModel(); $foreignModel->setIgnoreRequest(true); $this->localKey = $foreignModel->getIdFieldName(); } if (empty($foreignKey)) { if (!isset($foreignModel)) { /** @var DataModel $foreignModel */ $foreignModel = $this->getForeignModel(); $foreignModel->setIgnoreRequest(true); } $this->foreignKey = $foreignModel->getIdFieldName(); } } /** * This is not supported by the belongsTo relation * * @throws DataModel\Relation\Exception\NewNotSupported when it's not supported */ public function getNew() { throw new DataModel\Relation\Exception\NewNotSupported("getNew() is not supported by the belongsTo relation type"); } }