Gets log title

@param mixed $id
@param \Illuminate\Database\Eloquent\Model $model
@return String
8083
public static function getLogTitle($id, $model)
    {
        $key                = 'USERCONFIG_' . strtoupper($model->type) . '_PROVIDER';
        $provider           = last($model->related_data['provider']);
        $html               = app('html');
        $params             = [];
        $params['owner_id'] = $html->link(handles('antares::foundation/settings/security'), array_get($provider, 'name'));
        $params['user']     = $html->link(handles('antares::foundation/users/' . $model->user->id), '#' . $model->user->id . ' ' . $model->user->fullname);

        return trans('antares/two_factor_auth::operations.' . $key, $params);
    }
555753
public function getRecord($id) {
		if(is_numeric($id)) {
			return parent::getRecord($id);
		} else {
			return ExternalContent::getDataObjectFor($id);
		}
	}
751176
public function getOrFail($id)
    {
        if ($model = $this->get($id)) {
            return $model;
        }

        throw (new NotFoundException("No results for id $id"))->setModel(get_class($this->model));
    }
308253
protected static function selectOne($model, $tableName, $id)
    {
        $connection = Connection::connect();

        $getAll = $connection->prepare('select * from '.$tableName.' where id='.$id);
        $getAll->execute();

        $row = $getAll->fetch(PDO::FETCH_ASSOC);
        array_push($model->resultRows, $row);
        
        return $model;
    }
1338135
protected function _getSubTree(Model $model, $id = null) {
		$result = [];
		$parentField = $this->_getBehaviorConfig($model, 'parent');
		$leftField = $this->_getBehaviorConfig($model, 'left');
		if (($parentField === null) || ($leftField === null)) {
			return $result;
		}

		$conditions = [
			$model->alias . '.' . $parentField => null
		];
		if (!empty($id)) {
			$conditions[$model->alias . '.' . $parentField] = (int)$id;
		}
		if ($model->Behaviors->Tree->settings[$model->alias]['scope'] !== '1 = 1') {
			$conditions[] = $model->Behaviors->Tree->settings[$model->alias]['scope'];
		}

		$fields = [
			$model->alias . '.' . $model->primaryKey,
		];
		$order = [
			$model->alias . '.' . $leftField => 'asc'
		];
		$model->recursive = -1;
		$data = $model->find('list', compact('conditions', 'fields', 'order'));
		if (!empty($data)) {
			$result = array_keys($data);
		}

		return $result;
	}
56626
public function actionView($id)
    {
        $model = $this->findModel($id);
        $modelsI18n = $model::prepareI18nModels($model);

        if ($model->pageSize > 0) {
            $model->orderBy = $model->defaultOrderBy;
            $model->page = $model->calcPage();//echo __METHOD__.": calcPage(id={$id},pageSize={$model->pageSize})={$model->page}<br>";exit;
        }

        return $this->render('view', [
            'model' => $model,
            'modelsI18n' => $modelsI18n,
        ]);
    }
374893
public function _read($id) {
		$result = ORM::for_table($this->sessions_table)->findOne($id);
        return $result ? $result->data : '';
    }
950413
public function getColumnName($column, $model = null): string
    {
        $model = $model ?? $this->model;

        return !strpos($column, '.')
            ? $this->getTableName($model) . '.' . $column
            : $column;
    }
750187
public function getRecordById(Model $model, $id, $deepRelation = true) {
        $model->id = $id;

        $data = $model->find('first', array(
            'conditions' => array($model->alias . '.' . $model->primaryKey => $id),
            'contain' => $this->getDeepRelations($model, $deepRelation)
        ));

        if ($data) {
            $model->set($data);
        }

        return $data;
    }
282565
public static function getLogDifference(Eloquent $model, Eloquent $oldModel) {
		$attributes = $model->attributesToArray();
		$modelAttributes = $oldModel->attributesToArray();

		$diff = array();

		// Determine what values are not the same
		foreach ($attributes as $key => $value) :
			$other = $modelAttributes[$key];

			if ($value !== $other) :
				$diff[] = $key;
			endif;
		endforeach;

		return $diff;
	}
431149
protected function showDetail(Model $model)
    {
        $name = $this->manager->getClassName($model);

        $this->title("Summary of Model {$name} :");

        $summary = $this->manager->getModelSummary($name);
        $rows = [];

        foreach ($summary as $key => $value) {
            if (is_bool($value)) {
                $value = $value ? 'yes' : 'no';
            }

            $valueText = $this->paintString($value, 'brown');

            $rows[] = [$key, $valueText];
        }

        $this->table(['Key', 'Value'], $rows);

        $this->showDatabaseFields($model);
        $this->showRelatoins($model);
        $this->showModifier($model);
    }
407594
public static function getTitleById($table, $id) {

        //return "table = ".$table." and id = ".$id;

        // Special handling for users
        if ($table == "users") {
            return self::getUserForIndexListing($id);
        }

        // Special handling for posts (for post updates listing)
        if ($table == "posts") {
            return self::getPostForIndexListing($id);
        }

        $title = DB::table($table)->where('id', '=', $id)->pluck('title');

        if ($title == "") {
            return '<span class="text-danger">n/a</span>';
        }

        // ASSIGN COLOURS TO lookup_todo_priority_types
        if ($table == "lookup_todo_priority_types") {

            if (strtolower($title) == "green") {
                return '<button type="button" class="btn btn-success btn-sm">'.$title.'</button>';
            }

            if (strtolower($title) == "yellow") {
                return '<button type="button" class="btn btn-warning btn-sm">'.$title.'</button>';
            }

            if (strtolower($title) == "red") {
                return '<button type="button" class="btn btn-danger btn-sm">'.$title.'</button>';
            }

        }

        return $title;
    }
778703
public function getColumn(Model $model, $event)
    {
        if (!array_key_exists($event, $this->getBlameableFields($model))) {
            return;
        }

        $fields = $this->getBlameableFields($model);

        return $fields[$event];
    }
1251511
public static function get(Model $model)
    {
        return Mention::where('model_type', get_class($model))
            ->where('model_id', $model->getKey())
            ->get();
    }
103950
public function read($id)
    {
        $return = '';

        $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));

        if (count($rows)) {
            if ($this->_getExpirationTime($row = $rows->current()) > time()) {
                $return = $row->{$this->_dataColumn};
            } else {
                $this->destroy($id);
            }
        }

        return $return;
    }
1007003
public function getDocumentById(string $id)
    {
        $arguments = $this->getRequestArguments();

        $assignments = [];
        if ($this->settings['paging']['detailPagePaging'] && array_key_exists('underlyingQuery', $arguments)) {
            // If underlying query has been sent, fetch more data to enable paging arrows.
            $underlyingQueryInfo = $arguments['underlyingQuery'];

            $index = FrontendUtility::getIndexes($underlyingQueryInfo);

            foreach ($arguments['underlyingQuery'] as $key => $value) {
                $arguments[$key] = $value;
            }

            $this->createQueryForArguments($arguments);
            $this->query->setStart($index['previousIndex']);
            $this->query->setRows($index['nextIndex'] - $index['previousIndex'] + 1);

            $assignments = $this->getRecordsWithUnderlyingQuery($assignments, $index, $id, $arguments);
        } else {
            // Without underlying query information, just get the record specified.
            $assignments = $this->getTheRecordSpecified($id, $assignments);
        }

        return $assignments;
    }
454105
public function read($id) {
        $this->Model->id = $id;

        $result = $this->AdminToolbar->getRecordById($this->Model, $id);

        if (!$result) {
            throw new NotFoundException(__d('admin', '%s Not Found', $this->Model->singularName));
        }

        $item_id = $result['ItemReport']['foreign_key'];
        $itemModel = Admin::introspectModel($result['ItemReport']['model']);
        $itemResult = $this->AdminToolbar->getRecordById($itemModel, $item_id);

        if ($this->request->is('post')) {
            $action = $this->request->data['ItemReport']['report_action'];
            $status = ItemReport::RESOLVED;
            $messages = array();
            $title = $itemResult[$itemModel->alias][$itemModel->displayField];

            // Mark report as invalid
            if ($action === 'invalid_report') {
                $status = ItemReport::INVALID;

            // Delete the item
            } else if ($action === 'delete_item') {
                if ($this->AdminToolbar->hasAccess($itemModel, 'delete') && $itemModel->delete($item_id, true)) {
                    $messages[] = __d('admin', 'Successfully deleted %s with ID %s', array($itemModel->singularName, $item_id));
                    $this->AdminToolbar->logAction(ActionLog::DELETE, $itemModel, $item_id, __d('admin', 'Via item report #%s', $id), $title);
                }

            // Custom item callback
            } else if (method_exists($itemModel, $action)) {
                if ($itemModel->{$action}($item_id)) {
                    $messages[] = __d('admin', 'Triggered %s.%s() process', array($itemModel->alias, $action));
                    $this->AdminToolbar->logAction(ActionLog::UPDATE, $itemModel, $item_id, __d('admin', '%s.%s() via item report #%s', array($itemModel->alias, $action, $id)), $title);
                }

            } else {
                throw new BadRequestException(__d('admin', 'Invalid Report Action'));
            }

            $comment = __d('admin', 'Changed report status to %s', $this->Model->enum('status', $status));
            $messages[] = $comment;

            $this->Model->markAs($id, $status, $this->Auth->user('id'), $this->request->data['ItemReport']['log_comment']);
            $this->AdminToolbar->logAction(ActionLog::UPDATE, $this->Model, $id, $comment);

            // Set message
            $this->AdminToolbar->setFlashMessage(implode('; ', $messages));
            $this->redirect(array('action' => 'index'));

        } else {
            $this->Model->set($result);
            $this->AdminToolbar->logAction(ActionLog::READ, $this->Model, $id);
        }

        $this->set('result', $result);
        $this->set('item', $itemResult);
    }