| @@ 161-174 (lines=14) @@ | ||
| 158 | * @param string $table |
|
| 159 | * @return int |
|
| 160 | */ |
|
| 161 | public static function getPidOfUid($uid, $table) |
|
| 162 | { |
|
| 163 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); |
|
| 164 | $queryBuilder->getRestrictions()->removeAll(); |
|
| 165 | ||
| 166 | $pid = $queryBuilder |
|
| 167 | ->select('pid') |
|
| 168 | ->from($table) |
|
| 169 | ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))) |
|
| 170 | ->execute() |
|
| 171 | ->fetchColumn(); |
|
| 172 | ||
| 173 | return (int)$pid; |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Gets the TCA of the table used in the current context. |
|
| @@ 7910-7922 (lines=13) @@ | ||
| 7907 | * @param int $uid Record uid |
|
| 7908 | * @return int|false PID value (unless the record did not exist in which case FALSE is returned) |
|
| 7909 | */ |
|
| 7910 | public function getPID($table, $uid) |
|
| 7911 | { |
|
| 7912 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); |
|
| 7913 | $queryBuilder->getRestrictions() |
|
| 7914 | ->removeAll(); |
|
| 7915 | $queryBuilder->select('pid') |
|
| 7916 | ->from($table) |
|
| 7917 | ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))); |
|
| 7918 | if ($row = $queryBuilder->execute()->fetch()) { |
|
| 7919 | return $row['pid']; |
|
| 7920 | } |
|
| 7921 | return false; |
|
| 7922 | } |
|
| 7923 | ||
| 7924 | /** |
|
| 7925 | * Executing dbAnalysisStore |
|