Returns the pageId of the record or 0 when no valid record was given.

@param string $table
@param integer $uid
@return mixed
190553
protected function getRecordPageId($table, $uid)
    {
        $record = BackendUtility::getRecord($table, $uid, 'pid');
        return !empty($record['pid']) ? (int)$record['pid'] : 0;
    }
220721
public function clientGetByUid($uid)
  {
    foreach($this->clientList() as $client)
    {
      if($client["client_unique_identifier"] == $uid) return $client;
    }

    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid clientID", 0x200);
  }
766680
public function clientGetByUid($uid)
  {
    foreach($this->clientList() as $client)
    {
      if($client["client_unique_identifier"] == $uid) return $client;
    }

    throw new Exception("invalid clientID", 0x200);
  }
69238
public function getGroup($uid){
        
        $groupIds = $this->getGroupIds($uid);
        
        $groups = DB::table($this->dbTablePrefix . $this->tableGroup)
                    ->where('id' , 'in' , $groupIds)
                    ->where('status' , '1')
                    ->order('sort asc')
                    ->select();
        
        return $groups;
        
    }
636877
public function generateNewId($table)
    {
        if (!isset($this->idCounterByTable[$table])) {
            $this->idCounterByTable[$table] = $this->getSQLBuilder()->select($table)->field('id')->orderDesc('id')->limit(0, 1)->fetchResult();
        }

        for ($i = 0; $i < 50; $i++) {
            $this->idCounterByTable[$table]++;

            if ($this->getCache()) {
                $key = 'grace_id_gen_' . $table . '_' . strval($this->idCounterByTable[$table]);

                $isBusy = $this->getCache()->get($key);
                if ($isBusy === null) {
                    $this->getCache()->set($key, '1', 60);
                    return $this->idCounterByTable[$table];
                }
            } else {
                return $this->idCounterByTable[$table];
            }
        }

        throw new \OutOfBoundsException('Maximum number of cycles to generate new id has reached');
    }
619595
protected function getRecordWithFieldRelevantForGarbageCollection($table, $uid):array
    {
        $garbageCollectionRelevantFields = $this->tcaService->getVisibilityAffectingFieldsByTable($table);
        $record = (array)BackendUtility::getRecord($table, $uid, $garbageCollectionRelevantFields, '', false);
        return $record;
    }
1095254
final public function fetchTableDef(string $table) {
        $tableKey = strtolower($table);

        // First check the table cache.
        if (isset($this->tables[$tableKey])) {
            $tableDef = $this->tables[$tableKey];

            if (isset($tableDef['columns'], $tableDef['indexes'])) {
                return $tableDef;
            }
        } elseif ($this->tableNames !== null && !isset($this->tableNames[$tableKey])) {
            return null;
        }

        $tableDef = $this->fetchTableDefDb($table);
        if ($tableDef !== null) {
            $this->fixIndexes($tableDef['name'], $tableDef);
            $this->tables[$tableKey] = $tableDef;
        }

        return $tableDef;
    }
1133581
public function getById($id)
    {       
        if (!is_null($this->_table) && !is_null($id)) {
            $this->_sql = "SELECT * FROM $this->_table WHERE id = $id";
            $row = $this->_select($this->_sql);
            return (isset($row[0])) ? $row[0] : null;
        }
    }
376111
public function getPageContent($uid)
    {
        // get content elements for this page
        $fields = '*';
        $table = 'tt_content';
        $where = 'pid = ' . intval($uid);
        $where .= ' AND (' . $this->whereClauseForCType . ')';

        $table = 'tt_content';
        $queryBuilder = Db::getQueryBuilder($table);

        // don't index elements which are hidden or deleted, but do index
        // those with time restrictions, the time restrictions will be
        // copied to the index
        $queryBuilder->getRestrictions()
            ->removeByType(StartTimeRestriction::class)
            ->removeByType(EndTimeRestriction::class);

        // build array with where clauses
        $where = [];
        $where[] = $queryBuilder->expr()->eq(
            'pid',
            $queryBuilder->createNamedParameter(
                $uid,
                \PDO::PARAM_INT
            )
        );
        $where[] = $this->whereClauseForCType;

        // add condition for not indexing gridelement columns with colPos = -2 (= invalid)
        if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('gridelements')) {
            $where[] = $queryBuilder->expr()->neq(
                'colPos',
                $queryBuilder->createNamedParameter(
                    -2,
                    \PDO::PARAM_INT
                )
            );
        }

        // Get access restrictions for this page
        $pageAccessRestrictions = $this->getInheritedAccessRestrictions($uid);

        $rows = $queryBuilder
            ->select($fields)
            ->from($table)
            ->where(...$where)
            ->execute()
            ->fetchAll();


        if (count($rows)) {
            foreach ($rows as $row) {

                // skip this content element if the page itself is hidden or a
                // parent page with "extendToSubpages" set is hidden
                if ($pageAccessRestrictions['hidden']) {
                    continue;
                }

                // skip this content element if the page is hidden or set to "no_search"
                if (!$this->checkIfpageShouldBeIndexed($uid, $row['sys_language_uid'])) {
                    continue;
                }


                // combine group access restrictons from page(s) and content element
                $feGroups = $this->getCombinedFeGroupsForContentElement(
                    $pageAccessRestrictions['fe_group'],
                    $row['fe_group']
                );

                // skip this content element if either the page or the content
                // element is set to "hide at login"
                // and the other one has a frontend group attached to it
                if ($feGroups == DONOTINDEX) {
                    continue;
                }

                $logMessage = 'Indexing tt_content record';
                $logMessage .= $row['header'] ? ' "' . $row['header'] .'"' : '';
                $this->pObj->logger->debug( $logMessage, [
                    'uid' => $row['uid'],
                    'pid' => $row['pid'],
                    'CType' => $row['CType']
                ]);

                // get content for this content element
                $content = '';

                // get tags from page
                $tags = $this->pageRecords[$uid]['tags'];

                // assign categories as tags (as cleartext, eg. "colorblue")
                $categories = SearchHelper::getCategories($row['uid'], $table);
                SearchHelper::makeTags($tags, $categories['title_list']);

                // assign categories as generic tags (eg. "syscat123")
                SearchHelper::makeSystemCategoryTags($tags, $row['uid'], $table);

                // index header
                // add header only if not set to "hidden"
                if ($row['header_layout'] != 100) {
                    $content .= strip_tags($row['header']) . "\n";
                }

                // index content of this content element and find attached or linked files.
                // Attached files are saved as file references, the RTE links directly to
                // a file, thus we get file objects.
                if (in_array($row['CType'], $this->fileCTypes)) {
                    $fileObjects = $this->findAttachedFiles($row);
                } else {
                    $fileObjects = $this->findLinkedFilesInRte($row);
                    $content .= $this->getContentFromContentElement($row) . "\n";
                }

                // index the files found
                $this->indexFiles($fileObjects, $row, $pageAccessRestrictions['fe_group]'], $tags);

                // Combine starttime and endtime from page, page language overlay
                // and content element.
                // TODO:
                // If current content element is a localized content
                // element, fetch startdate and enddate from original conent
                // element as the localized content element cannot have it's
                // own start- end enddate
                $starttime = $pageAccessRestrictions['starttime'];

                if ($this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['starttime'] > $starttime) {
                    $starttime = $this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['starttime'];
                }

                if ($row['starttime'] > $starttime) {
                    $starttime = $row['starttime'];
                }

                $endtime = $pageAccessRestrictions['endtime'];

                if ($endtime == 0 || ($this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['endtime']
                        && $this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['endtime'] < $endtime)) {
                    $endtime = $this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['endtime'];
                }

                if ($endtime == 0 || ($row['endtime'] && $row['endtime'] < $endtime)) {
                    $endtime = $row['endtime'];
                }

                // prepare additionalFields (to be added via hook)
                $additionalFields = array();

                // make it possible to modify the indexerConfig via hook
                $indexerConfig = $this->indexerConfig;

                // hook for custom modifications of the indexed data, e. g. the tags
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'])) {
                    foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyContentIndexEntry'] as
                             $_classRef) {
                        $_procObj = &GeneralUtility::makeInstance($_classRef);
                        $_procObj->modifyContentIndexEntry(
                            $row['header'],
                            $row,
                            $tags,
                            $row['uid'],
                            $additionalFields,
                            $indexerConfig
                        );
                    }
                }

                // compile title from page title and content element title
                // TODO: make changeable via hook
                $title = $this->cachedPageRecords[$row['sys_language_uid']][$row['pid']]['title'];
                if ($row['header'] && $row['header_layout'] != 100) {
                    $title = $title . ' - ' . $row['header'];
                }

                // save record to index
                $this->pObj->storeInIndex(
                    $indexerConfig['storagepid'],        // storage PID
                    $title,                              // page title inkl. tt_content-title
                    'content',                           // content type
                    $row['pid'] . '#c' . $row['uid'],    // target PID: where is the single view?
                    $content,                            // indexed content, includes the title (linebreak after title)
                    $tags,                               // tags
                    '',                                  // typolink params for singleview
                    '',                                  // abstract
                    $row['sys_language_uid'],            // language uid
                    $starttime,                          // starttime
                    $endtime,                            // endtime
                    $feGroups,                           // fe_group
                    false,                               // debug only?
                    $additionalFields                    // additional fields added by hooks
                );

                // count elements written to the index
                $this->counter++;
            }
        } else {
            return;
        }

        return;
    }
531301
public function getTableDefinition($table)
    {
        foreach ($this->getTableDefinitions() as $definition) {
            if ($definition->getName() === $table) {
                return $definition;
            }
        }

        return null;
    }
1281804
@Basic
    @Column(name = "UIDENT", unique = true, nullable = false, length=255)
    public String getUid()
    {
        return this.uid;
    }
1121671
public function userIdToFid($uid) {
        $value = Cache::redis()->hGet('user_id_#_fid', $uid);
        Cache::release();
        return $value;
    }
674553
public static function getById($id, $type = 0, $table = null)
    {
        if ($type instanceof ObjectDefinition)
            $od = $type;
            else $od = new ObjectDefinition($type, $table);

        return parent::getByIdType($id, $od);
    }
491867
public function countByPageUid($pageUids)
    {
        if (($pageUids === '') || ($pageUids === '0')) {
            return $this->countByWhereClause('');
        }

        return $this->countByWhereClause($this->getTableName() . '.pid IN (' . $pageUids . ')');
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }
448636
private function determinePageIdFromArguments()
    {
        if (empty($this->argumentNameOfPageId)) {
            return 0;
        }

        if (false === array_key_exists($this->argumentNameOfPageId, $this->restler->apiMethodInfo->arguments)) {
            return 0;
        }

        $index = $this->restler->apiMethodInfo->arguments[$this->argumentNameOfPageId];
        $pageId = (integer) $this->restler->apiMethodInfo->parameters[$index];
        return $pageId;
    }
250789
public function getById($iId)
    {
        $aEvents = $this->getAll([
            'where' => [
                [$this->sTableAlias . '.id', $iId],
            ],
        ]);

        if (!$aEvents) {
            return false;
        }

        return $aEvents[0];
    }