/**
  * Overrides \Drupal\Core\Entity\Query\Sql\Query::result().
  *
  * @return array|int
  *   Returns the aggregated result, or a number if it's a count query.
  */
 protected function result()
 {
     if ($this->count) {
         return parent::result();
     }
     $return = array();
     foreach ($this->sqlQuery->execute() as $row) {
         $return[] = (array) $row;
     }
     return $return;
 }