public function sortIds($idList, $strDirection)
    {
        $statement = $this->connection->createQueryBuilder()
            ->select('iid')
            ->from('tl_metamodel_rating')
            ->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
            ->setParameter('mid', $this->getMetaModel()->get('id'))
            ->setParameter('aid', $this->get('id'))
            ->setParameter('iids', $idList, Connection::PARAM_STR_ARRAY)
            ->orderBy('meanvalue', $strDirection)
            ->execute();

        $arrSorted = $statement->fetchAll(\PDO::FETCH_COLUMN, 'iid');

        return ($strDirection == 'DESC')
            ? \array_merge($arrSorted, \array_diff($idList, $arrSorted))
            : \array_merge(\array_diff($idList, $arrSorted), $arrSorted);
    }
public function sortIds($idList, $strDirection)
    {
        $statement = $this->connection->createQueryBuilder()
            ->select('iid')
            ->from('tl_metamodel_rating')
            ->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
            ->setParameter('mid', $this->getMetaModel()->get('id'))
            ->setParameter('aid', $this->get('id'))
            ->setParameter('iids', $idList, Connection::PARAM_STR_ARRAY)
            ->orderBy('meanvalue', $strDirection)
            ->execute();

        $arrSorted = $statement->fetchAll(\PDO::FETCH_COLUMN, 'iid');

        return ($strDirection == 'DESC')
            ? \array_merge($arrSorted, \array_diff($idList, $arrSorted))
            : \array_merge(\array_diff($idList, $arrSorted), $arrSorted);
    }
public function sortIds ( $ idList , $ strDirection ) { $ statement = $ this -> connection -> createQueryBuilder ( ) -> select ( 'iid' ) -> from ( 'tl_metamodel_rating' ) -> andWhere ( 'mid=:mid AND aid=:aid AND iid IN (:iids)' ) -> setParameter ( 'mid' , $ this -> getMetaModel ( ) -> get ( 'id' ) ) -> setParameter ( 'aid' , $ this -> get ( 'id' ) ) -> setParameter ( 'iids' , $ idList , Connection :: PARAM_STR_ARRAY ) -> orderBy ( 'meanvalue' , $ strDirection ) -> execute ( ) ; $ arrSorted = $ statement -> fetchAll ( \ PDO :: FETCH_COLUMN , 'iid' ) ; return ( $ strDirection == 'DESC' ) ? \ array_merge ( $ arrSorted , \ array_diff ( $ idList , $ arrSorted ) ) : \ array_merge ( \ array_diff ( $ idList , $ arrSorted ) , $ arrSorted ) ; }
Sorts the given array list by field value in the given direction.

@param int[]  $idList       A list of Ids from the MetaModel table.
@param string $strDirection The direction for sorting. either 'ASC' or 'DESC', as in plain SQL.

@return int[] The sorted integer array.
Sorts the given array list by field value in the given direction .