lib/CoreFilter/NativeCoreFilter.php
private function getAlwaysAvailableFilter(array $languageCodes)
    {
        $conditions = array(
            // Include always available main language translations
            new CustomField(
                self::FIELD_IS_ALWAYS_AVAILABLE,
                Operator::EQ,
                true
            ),
            // Exclude all given languages
            new LogicalNot(
                new CustomField(self::FIELD_LANGUAGES, Operator::IN, $languageCodes)
            ),
        );

        // Include only from main languages index if used
        if ($this->hasMainLanguagesEndpoint) {
            $conditions[] = new CustomField(
                self::FIELD_IS_MAIN_LANGUAGES_INDEX,
                Operator::EQ,
                true
            );
        }

        // Combine conditions
        return new LogicalAnd($conditions);
    }
private function getAlwaysAvailableFilter(array $languageCodes)
    {
        $conditions = array(
            // Include always available main language translations
            new CustomField(
                self::FIELD_IS_ALWAYS_AVAILABLE,
                Operator::EQ,
                true
            ),
            // Exclude all given languages
            new LogicalNot(
                new CustomField(self::FIELD_LANGUAGES, Operator::IN, $languageCodes)
            ),
        );

        // Include only from main languages index if used
        if ($this->hasMainLanguagesEndpoint) {
            $conditions[] = new CustomField(
                self::FIELD_IS_MAIN_LANGUAGES_INDEX,
                Operator::EQ,
                true
            );
        }

        // Combine conditions
        return new LogicalAnd($conditions);
    }
Returns criteria for always available translation fallback.

@param string[] $languageCodes

@return \eZ\Publish\API\Repository\Values\Content\Query\Criterion