/** * Retrieves name to use on addressing this node's set in datasource. * * This method is retrieving any alias declared explicitly using setAlias() * or name of data set managed by associated model. On providing connection * to datasource the retrieved name (not the alias!) is qualified BUT NOT * quoted according to qualification rules of connected datasource. * * @param bool $ignoreAlias set true to force retrieval of model's set name * @param connection $datasource connected datasource used for optionally qualifying set's name * @return string name to use on addressing this node's data set */ public function getName($ignoreAlias = false, connection $datasource = null) { if ($this->alias && !$ignoreAlias) { return $this->alias; } $set = $this->model->getSetName(); return $datasource ? $datasource->qualifyDatasetName($set, false) : $set; }
/** * Retrieves name of set associated with described model. * * The name is optionally qualified and quoted on providing data source * considered to contain data set. * * @param connection $source data source to use for quoting name * @param model_relation_model $model description of a model * @return string optionally quoted name of set associated with described model */ protected function _setNameOfModel(connection $source = null, model_relation_model $model) { $set = $model->getSetName(); return is_null($source) ? $set : $source->qualifyDatasetName($set); }