/** * Get the name of any model * * @param \Model $model * @return string The name of the model */ private function getModelName($model) { if ($model instanceof \NamedModel) { return $model->getName(); } if ($model instanceof \AliasModel) { return $model->getAlias(); } return $model->getId(); }