Resolves all available localizations for given row.

@param Row $row

@return string[]
184942
private function resolveAvailableLocales(Row $row)
    {
        $locales = [];
        foreach ($row->getValues() as $key => $value) {
            if (preg_match('/^node.([a-zA-Z_]*?)Template/', $key, $matches) && '' !== $value
                && !$row->getValue(sprintf('node.%sShadow_on', $matches[1]))
            ) {
                $locales[] = $matches[1];
            }
        }

        return $locales;
    }
395387
public function languageOverlay(array $rows, $table)
    {

        // see https://github.com/teaminmedias-pluswerk/ke_search/issues/128
        $LanguageMode = $GLOBALS['TSFE']->sys_language_content;
        if (\TYPO3\CMS\Core\Utility\GeneralUtility::hideIfNotTranslated($GLOBALS['TSFE']->page['l18n_cfg'])) {
            $LanguageMode = 'hideNonTranslated';
        }
        if (is_array($rows) && count($rows)) {
            foreach ($rows as $key => $row) {
                if (is_array($row) && $GLOBALS['TSFE']->sys_language_content) {
                    $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(
                        $table,
                        $row,
                        $GLOBALS['TSFE']->sys_language_content,
                        $LanguageMode
                    );

                    if (is_array($row)) {
                        if ($table == "tx_kesearch_filters") {
                            $row['rendertype'] = $rows[$key]['rendertype'];
                        }
                        $rows[$key] = $row;
                    } else {
                        unset($rows[$key]);
                    }
                }
            }
            return $rows;
        } else {
            return array();
        }
    }
780538
protected function inferRow($row)
    {
        $rowFields = [];
        foreach ($row as $k => $v) {
            $rowFields[$k] = FieldsFactory::infer($v, (object) ['name' => $k], $this->lenient);
        }

        return $rowFields;
    }
405039
private function bindRowValues(array $row): array
    {
        $placeholders = [];
        foreach ($row as $key => $value) {
            $placeholder = $this->addBindingValue($key, $value);
            array_push($placeholders, $placeholder);
        }
        return $placeholders;
    }
273104
public function extractLanguageCodesFromData(array $rows): array
    {
        $languageMask = 0;
        foreach ($rows as $row) {
            $languageMask |= $row['lang_mask'];
        }

        return $this->languageMaskGenerator->extractLanguageCodesFromMask($languageMask);
    }
276082
public function get($col, $row)
    {
        $this->checkCoords($col, $row);

        return $this->grid{$this->toIndex($col, $row)};
    }
420621
public function decode(string $row): array
    {
        $stream = fopen('php://memory', 'r+');
        fputs($stream, $row);
        rewind($stream);
        $result = [];
        $names = fgetcsv($stream, 0, "\t");
        if (empty($names) === true) {
            throw new \RuntimeException('failed decoding names from response');
        }
        while(($row = fgetcsv($stream, 0, "\t")) !== false) {
            $result[] = array_combine($names, $row);
        }
        fclose($stream);
        return $result;
    }
1027678
public function translateRowValues($row, $key)
    {
        $row = parent::translateRowValues($row, $key);

        if (! $row) {
            return false;
        }
        
        // Default to active and can login
        if (!isset($row['gsf_active'])) {
            $row['gsf_active'] = 1;
        }        
        if (!isset($row['gul_can_login'])) {
            $row['gul_can_login'] = 1;
        }
        
        // Make sure we have an organization
        if (!isset($row['gsf_id_organization'])) {
            $row['gsf_id_organization'] = $this->_organization->getId();
        }
        
        // Use organization default userclass is not specified
        if (!isset($row['gul_user_class'])) {
            $row['gul_user_class'] = $this->loader->getUserLoader()->getOrganization($row['gsf_id_organization'])->get('gor_user_class');
        }

        return $row;
    }
949553
public function decode(string $row): array
    {
        $rows = explode(PHP_EOL, rtrim($row));
        return array_map(function($row) { return json_decode($row, true); }, $rows);
    }
401265
public function extractTagListFromRows(array $rows)
    {
        $tagList = [];
        foreach ($rows as $row) {
            $tagId = (int) $row['eztags_id'];
            if (!isset($tagList[$tagId])) {
                $tag = new Tag();
                $tag->id = (int) $row['eztags_id'];
                $tag->parentTagId = (int) $row['eztags_parent_id'];
                $tag->mainTagId = (int) $row['eztags_main_tag_id'];
                $tag->keywords = [];
                $tag->depth = (int) $row['eztags_depth'];
                $tag->pathString = $row['eztags_path_string'];
                $tag->modificationDate = (int) $row['eztags_modified'];
                $tag->remoteId = $row['eztags_remote_id'];
                $tag->alwaysAvailable = ((int) $row['eztags_language_mask'] & 1) ? true : false;
                $tag->mainLanguageCode = $this->languageHandler->load($row['eztags_main_language_id'])->languageCode;
                $tag->languageIds = $this->languageMaskGenerator->extractLanguageIdsFromMask((int) $row['eztags_language_mask']);
                $tagList[$tagId] = $tag;
            }

            if (!isset($tagList[$tagId]->keywords[$row['eztags_keyword_locale']])) {
                $tagList[$tagId]->keywords[$row['eztags_keyword_locale']] = $row['eztags_keyword_keyword'];
            }
        }

        return array_values($tagList);
    }
372475
public function map($row): array
    {
        $only   = $this->getOnly();
        $except = $this->getExcept();

        if ($row instanceof Model) {
            // If user didn't specify a custom except array, use the hidden columns.
            // User can override this by passing an empty array ->except([])
            // When user specifies with only(), ignore if the column is hidden or not.
            if (!$this->onlyIndexFields && $except === null && (!is_array($only) || count($only) === 0)) {
                $except = $row->getHidden();
            }

            // Make all attributes visible
            $row->setHidden([]);
            $row = $this->replaceFieldValuesWhenOnResource(
                $row,
                is_array($only) ? $only : array_keys($row->attributesToArray())
            );
        }

        if (is_array($only) && count($only) > 0) {
            $row = array_only($row, $only);
        }

        if (is_array($except) && count($except) > 0) {
            $row = array_except($row, $except);
        }

        return $row;
    }
43746
private function prepareColumnValues($tableName, $row)
    {
        $ret = array();
        $columnTypes = $this->tableColumnTypes[$tableName];
        foreach ($row as $colName => $colValue) {
            $colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue, $row);
            $ret[] = $this->escape($colValue, $columnTypes[$colName]);
        }

        return $ret;
    }
278683
protected function pdoResultToArray($row)
    {
        if (is_object($row)) {
            $row = (array)$row;
        }

        $data = [];

        foreach ($row as $key=>$value) {
            if (!is_numeric($key)) {
                $data[$key] = $value;
            }
        }

        return $data;
    }
108686
public function getPastRowFromCurrent(Row $row)
    {
        $pastData = $this->getPastDataTable();
        if (empty($pastData)) {
            return null;
        }

        $label = $row->getColumn('label');
        return $label ? $pastData->getRowFromLabel($label) : $pastData->getFirstRow();
    }
255230
protected function loadObjects(array $row)
    {

        $objectsInfo = [];
        foreach ($row as $alias => $value) {
            $pos = strrpos($alias, ISelector::ALIAS_SEPARATOR);
            if (!$pos) {
                throw new LoadEntityException($this->translate(
                    'Cannot load objects from data row. Field alias "{alias}" is not correct.',
                    ['alias' => $alias]
                ));
            }
            $collectionPath = substr($alias, 0, $pos);
            $fieldName = substr($alias, $pos + 1);

            if (!isset($objectsInfo[$collectionPath])) {
                $objectsInfo[$collectionPath] = [];
            }
            $objectsInfo[$collectionPath][$fieldName] = $value;
        }

        $mainObject = null;
        foreach ($objectsInfo as $collectionPath => $objectInfo) {

            if (!array_key_exists(IObject::FIELD_TYPE, $objectInfo)) {
                throw new LoadEntityException($this->translate(
                    'Cannot load object from data row. Information about object type is not found.'
                ));
            }

            if (!is_null($objectInfo[IObject::FIELD_TYPE])) {
                $object = $this->loadObject($objectInfo[IObject::FIELD_TYPE], $objectInfo);
                if (!$mainObject && !substr_count($collectionPath, ISelector::FIELD_SEPARATOR)) {
                    $mainObject = $object;
                }
            }

        }
        if (!$mainObject) {
            throw new LoadEntityException($this->translate(
                'Cannot detect main object from data row.'
            ));
        }

        return $mainObject;
    }
292769
private function getHeadersFromRow(array $row): array
    {
        $headers = [];

        if (isset($row['headers'])) {
            if (isset($row['headers']) && is_array($row['headers'])) {
                return $row['headers'];
            }

            if (class_exists(Header::class)) {
                // pecl_http versions 2.x/3.x
                $headers = Header::parse($row['headers']);
            } elseif (function_exists('\http_parse_headers')) {
                // pecl_http version 1.x
                $headers = \http_parse_headers($row['headers']);
            } elseif (0 === mb_strpos($row['headers'], 'User-Agent: ')) {
                $headers = ['user-agent' => str_replace('User-Agent: ', '', $row['headers'])];
            } else {
                return [];
            }
        }

        if (is_array($headers)) {
            return $headers;
        }

        return [];
    }
1264722
private function getValue(Row $row, $column)
	{
		if (!$this->rowCallback) {
			return $row->getValue($column->getColumn());
		}

		return call_user_func_array($this->rowCallback, [$row->getItem(), $column->getColumn()]);
	}