Get the identifiers as a string that is safe to use in a url.

@param object $model

@return string string representation of the id that is safe to use in a url
965689
public function getUrlsafeIdentifier($model, AdminInterface $admin = null)
    {
        if (null === $admin) {
            $admin = $this->pool->getAdminByClass(ClassUtils::getClass($model));
        }

        return $admin->getUrlsafeIdentifier($model);
    }
270353
public function objectLink(Bill $model): string
    {
        return $model->class === 'device'
            ? Html::a($model->object, ['@server/view', 'id' => $model->object_id])
            : Html::tag('b', $model->object);
    }
667456
public function keys(Model $model)
    {
        $pk = $model->getKeyName();

        $pool = [
            [$pk],
            $model->getVisible(),
            $model->getHidden(),
            $model->getFillable(),
            $model->getGuarded(),
            $model->getDates(),
            array_keys($this->getCasts($model))
        ];

        // SoftDeletingTrait
        if (method_exists($model, 'getDeletedAtColumn')) {
            $pool[] = [$model->getDeletedAtColumn()];
        }

        $keysByKey = [];

        foreach ($pool as $i=>$keys) {
            foreach ($keys as $key) {
                if ($keys == ['*'] || $keys == '*') {
                    continue;
                }

                $keysByKey[$key] = true;
            }
        }

        return array_keys($keysByKey);
    }
535304
protected function getTableAndDatabase($model)
    {
        $table = $model->getConnection()->getTablePrefix() . $model->getTable();

        $database = null;

        if (strpos($table, '.')) {
            list($database, $table) = explode('.', $table);
        }

        return [$table, $database];
    }
759912
public static function getLinkedEntityName($entity) {
		if (elgg_instanceof($entity)) {
			return elgg_view('output/url', array(
				'text' => $entity->getDisplayName(),
				'href' => $entity->getURL(),
				'is_trusted' => true,
			));
		}
		return '';
	}
456219
public function getList(Model $model) {
        return $model->find('list', array(
            'order' => array($model->alias . '.' . $model->displayField => 'ASC'),
            'cache' => $model->alias . '::getList',
            'cacheExpires' => $this->getExpiration($model)
        ));
    }
803726
protected function parseModel($model)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) {
            throw new InvalidArgumentException('Model name contains invalid characters.');
        }

        $model = trim(str_replace('/', '\\', $model), '\\');

        $namespace =
            trim($this->laravel->getNamespace(), '\\')
            . $this->getModuleNamespace()
            . config('stubs.namespaces.model') . '\\';

        if (!Str::startsWith($model, $namespace)) {
            $model = $namespace . $model;
        }

        return $model;
    }
423059
private function getDefaultUrls($model)
    {
        $slug = getModelSlug($model);
        return [
            'details'   => lmbRoute("api.{$slug}.detail", ['id' => $model->id]),
            'fast_edit' => lmbRoute("api.{$slug}.fastEdit", ['id' => $model->id]),
            'edit'      => lmbRoute("api.{$slug}.update", ['id' => $model->id]),
            'destroy'   => lmbRoute("api.{$slug}.destroy", ['id' => $model->id]),
            'show'      => lmbRoute("admin.{$slug}.show", ['id' => $model->id])
        ];
    }
1175365
public function resolveModelClassName($model)
    {
        foreach ($this->metadataFactory->getAllMetadata() as $metadata) {
            /** @var Mapping\ClassMetadata $metadata */
            foreach ($metadata->getFieldMappings() as $mapping) {
                if (is_a($model, $mapping->getName())) {
                    return $metadata->getName();
                }
            }
        }

        return null;
    }
1157516
public static function getModelClass($model): string
    {
        if (!isset(self::$modelClassMap[$model])) {
            // try to detect
            $className = '\\Application\\' . $model . '\\Table';

            if (!class_exists($className)) {
                throw new RelationNotFoundException("Related class for model `$model` not found");
            }
            self::$modelClassMap[$model] = $className;
        }
        return self::$modelClassMap[$model];
    }
860460
protected function _getOptionsFromModel($model)
    {
        $model = TableRegistry::get($model);

        if (method_exists($model, 'postType')) {
            $result = $model->postType();
            if ($result) {
                $result['table'] = $model->table();
            }
            return $result;
        }
        if (property_exists($model, 'postType')) {
            $result = $model->postType;
            if ($result) {
                $result['table'] = $model->table();
            }
            return $result;
        }
        return [];
    }
501040
private function getGroupKeyForModel(Model $model)
    {
        $key = "";

        foreach ($this->groups as $group) {
            $key .= $model[$group] . "|";
        }

        return $key;
    }
950413
public function getColumnName($column, $model = null): string
    {
        $model = $model ?? $this->model;

        return !strpos($column, '.')
            ? $this->getTableName($model) . '.' . $column
            : $column;
    }
90496
protected function parseModel($model)
    {
        if (false === strpos($model, '\\')) {
            $path = explode('\\', static::class);
            array_pop($path);
            array_push($path, Db::parseName($model, 1));
            $model = implode('\\', $path);
        }

        return $model;
    }
447621
public function getMetaTags($model)
    {

        $lang = Yii::$app->language;
        if (Yii::$app->id === 'app-backend') {
            $lang = Yii::$app->wavecms->editedLanguage;
        }

        return $this->andWhere([
            'model' => $model,
            'language' => $lang
        ]);

    }
515695
public function getDeleteUrl($model = null)
    {
        if (!$model instanceof Mage_Core_Model_Abstract) {
            $model = $this->getCurrentRecord();
        } else {
            $expectedClass = get_class($this->getModel());
            if (!is_a($model, $expectedClass)) {
                throw new RuntimeException($this->__('Invalid model class. Expected:%1$s Passed:%2$s', $expectedClass, get_class($model)));
            }
        }

        return $this->_getUrl($this->getDeleteRoute(), [$model->getIdFieldName() => $model->getId()]);
    }
187346
protected function getForeignKeyName(Model $model)
    {
        $table = $model->getTable();

        if (array_key_exists($table, $this->foreignKeyLookup)) {
            return $this->foreignKeyLookup[$table];
        }

        return Str::singular($table).'_id';
    }