src/Attribute/TranslatedReference.php
public function sortIds($idList, $strDirection)
    {
        $langSet = sprintf(
            '\'%s\',\'%s\'',
            $this->getMetaModel()->getActiveLanguage(),
            $this->getMetaModel()->getFallbackLanguage()
        );

        $statement = $this->connection
            ->executeQuery(
                sprintf(
                    'SELECT t1.item_id
                       FROM %1$s AS t1
                       RIGHT JOIN %1$s ON (t1.id = (SELECT
                           t2.id
                           FROM %1$s AS t2
                           WHERE (t2.att_id=%2$s)
                           AND langcode IN (%3$s)
                           AND (t2.item_id=t1.item_id)
                           ORDER BY FIELD(t2.langcode,%3$s)
                           LIMIT 1
                       ))
                       WHERE t1.id IS NOT NULL
                       AND  (t1.item_id IN (?))
                       GROUP BY t1.id
                       ORDER BY t1.value %4$s',
                    // @codingStandardsIgnoreStart - we want to keep the numbers at the end of the lines below.
                    $this->getValueTable(),                    // 1
                    $this->get('id'),                          // 2
                    $langSet,                                  // 3
                    $strDirection                              // 4
                    // @codingStandardsIgnoreEnd
                ),
                [$idList],
                [Connection::PARAM_STR_ARRAY]
            );

        return $statement->fetchAll(\PDO::FETCH_COLUMN, 0);
    }
public function sortIds($idList, $strDirection)
    {
        $langSet = sprintf(
            '\'%s\',\'%s\'',
            $this->getMetaModel()->getActiveLanguage(),
            $this->getMetaModel()->getFallbackLanguage()
        );

        $statement = $this->connection
            ->executeQuery(
                sprintf(
                    'SELECT t1.item_id
                       FROM %1$s AS t1
                       RIGHT JOIN %1$s ON (t1.id = (SELECT
                           t2.id
                           FROM %1$s AS t2
                           WHERE (t2.att_id=%2$s)
                           AND langcode IN (%3$s)
                           AND (t2.item_id=t1.item_id)
                           ORDER BY FIELD(t2.langcode,%3$s)
                           LIMIT 1
                       ))
                       WHERE t1.id IS NOT NULL
                       AND  (t1.item_id IN (?))
                       GROUP BY t1.id
                       ORDER BY t1.value %4$s',
                    // @codingStandardsIgnoreStart - we want to keep the numbers at the end of the lines below.
                    $this->getValueTable(),                    // 1
                    $this->get('id'),                          // 2
                    $langSet,                                  // 3
                    $strDirection                              // 4
                    // @codingStandardsIgnoreEnd
                ),
                [$idList],
                [Connection::PARAM_STR_ARRAY]
            );

        return $statement->fetchAll(\PDO::FETCH_COLUMN, 0);
    }
public function sortIds ( $ idList , $ strDirection ) { $ langSet = sprintf ( '\'%s\',\'%s\'' , $ this -> getMetaModel ( ) -> getActiveLanguage ( ) , $ this -> getMetaModel ( ) -> getFallbackLanguage ( ) ) ; $ statement = $ this -> connection -> executeQuery ( sprintf ( 'SELECT t1.item_id
                       FROM %1$s AS t1
                       RIGHT JOIN %1$s ON (t1.id = (SELECT
                           t2.id
                           FROM %1$s AS t2
                           WHERE (t2.att_id=%2$s)
                           AND langcode IN (%3$s)
                           AND (t2.item_id=t1.item_id)
                           ORDER BY FIELD(t2.langcode,%3$s)
                           LIMIT 1
                       ))
                       WHERE t1.id IS NOT NULL
                       AND  (t1.item_id IN (?))
                       GROUP BY t1.id
                       ORDER BY t1.value %4$s' , // @codingStandardsIgnoreStart - we want to keep the numbers at the end of the lines below. $ this -> getValueTable ( ) , // 1 $ this -> get ( 'id' ) , // 2 $ langSet , // 3 $ strDirection // 4 // @codingStandardsIgnoreEnd ) , [ $ idList ] , [ Connection :: PARAM_STR_ARRAY ] ) ; return $ statement -> fetchAll ( \ PDO :: FETCH_COLUMN , 0 ) ; }
{@inheritDoc}
{