protected function fetchRows($arrIds, $arrAttrOnly = array())
    {
        /** @var QueryBuilder $builder */
        $builder = $this->getConnection()->createQueryBuilder();
        $query   = $builder
            ->select('*')
            ->from($this->getTableName())
            ->where($builder->expr()->in('id', ':values'))
            ->setParameter('values', $arrIds, Connection::PARAM_STR_ARRAY)
            ->orderBy('FIELD(id, :values)')
            ->execute();

        // If we have an attribute restriction, make sure we keep the system columns. See #196.
        if ($arrAttrOnly) {
            $arrAttrOnly = array_merge($this->systemColumns, $arrAttrOnly);
        }

        $result = [];
        while ($row = $query->fetch(\PDO::FETCH_ASSOC)) {
            $data = [];
            foreach ($row as $attribute => $value) {
                if ((!$arrAttrOnly) || (in_array($attribute, $arrAttrOnly, true))) {
                    $data[$attribute] = $value;
                }
            }

            $result[$row['id']] = $data;
        }

        return $result;
    }