Exemplo n.º 1
0
 /**
  * Process the Database operation to get the search result.
  *
  * @param QueryBuilder $queryBuilder Database table name
  * @param string $tableName
  * @return array
  * @see getTitleFromCurrentRow()
  * @see getEditLink()
  */
 protected function getRecordArray($queryBuilder, $tableName)
 {
     $collect = [];
     $result = $queryBuilder->execute();
     $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     while ($row = $result->fetch()) {
         $title = 'id=' . $row['uid'] . ', pid=' . $row['pid'];
         $collect[] = ['id' => $tableName . ':' . $row['uid'], 'pageId' => $tableName === 'pages' ? $row['uid'] : $row['pid'], 'typeLabel' => htmlspecialchars($this->getTitleOfCurrentRecordType($tableName)), 'iconHTML' => '<span title="' . htmlspecialchars($title) . '">' . $iconFactory->getIconForRecord($tableName, $row, Icon::SIZE_SMALL)->render() . '</span>', 'title' => htmlspecialchars(BackendUtility::getRecordTitle($tableName, $row)), 'editLink' => htmlspecialchars($this->getEditLink($tableName, $row))];
     }
     return $collect;
 }