src/Attribute/TranslatedTags.php
public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
    {
        if (!$this->getTagSource() && $this->getIdColumn()) {
            return [];
        }

        $return    = [];
        $idColName = $this->getIdColumn();

        // Fetch the value ids.
        $valueIds = $this->getValueIds($idList, $usedOnly, $arrCount);
        if (!\count($valueIds)) {
            return $return;
        }

        $valueColName = $this->getValueColumn();
        $aliasColName = $this->getAliasColumn();

        // Now for the retrieval, first with the real language.
        $values               = $this->getValues($valueIds, $this->getMetaModel()->getActiveLanguage());
        $arrValueIdsRetrieved = [];
        while ($row = $values->fetch(\PDO::FETCH_OBJ)) {
            $arrValueIdsRetrieved[]      = $row->$idColName;
            $return[$row->$aliasColName] = $row->$valueColName;
        }
        // Determine missing ids.
        $valueIds = array_diff($valueIds, $arrValueIdsRetrieved);
        // If there are missing ids and the fallback language is different than the current language, then fetch
        // those now.
        if ($valueIds
            && ($this->getMetaModel()->getFallbackLanguage() !== $this->getMetaModel()->getActiveLanguage())) {
            $values = $this->getValues($valueIds, $this->getMetaModel()->getFallbackLanguage());
            while ($row = $values->fetch(\PDO::FETCH_OBJ)) {
                $return[$row->$aliasColName] = $row->$valueColName;
            }
        }

        return $return;
    }
public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
    {
        if (!$this->getTagSource() && $this->getIdColumn()) {
            return [];
        }

        $return    = [];
        $idColName = $this->getIdColumn();

        // Fetch the value ids.
        $valueIds = $this->getValueIds($idList, $usedOnly, $arrCount);
        if (!\count($valueIds)) {
            return $return;
        }

        $valueColName = $this->getValueColumn();
        $aliasColName = $this->getAliasColumn();

        // Now for the retrieval, first with the real language.
        $values               = $this->getValues($valueIds, $this->getMetaModel()->getActiveLanguage());
        $arrValueIdsRetrieved = [];
        while ($row = $values->fetch(\PDO::FETCH_OBJ)) {
            $arrValueIdsRetrieved[]      = $row->$idColName;
            $return[$row->$aliasColName] = $row->$valueColName;
        }
        // Determine missing ids.
        $valueIds = array_diff($valueIds, $arrValueIdsRetrieved);
        // If there are missing ids and the fallback language is different than the current language, then fetch
        // those now.
        if ($valueIds
            && ($this->getMetaModel()->getFallbackLanguage() !== $this->getMetaModel()->getActiveLanguage())) {
            $values = $this->getValues($valueIds, $this->getMetaModel()->getFallbackLanguage());
            while ($row = $values->fetch(\PDO::FETCH_OBJ)) {
                $return[$row->$aliasColName] = $row->$valueColName;
            }
        }

        return $return;
    }
{@inheritDoc}