Exemple #1
0
 /**
  * @return mixed
  */
 protected function executeAggregate()
 {
     $this->sql->addTables([$this->mapper->getTable()]);
     if ($this->mapper->supportsSoftDelete()) {
         if (!$this->withSoftDeleted) {
             $this->where('deleted_at')->isNull();
         } elseif ($this->onlySoftDeleted) {
             $this->where('deleted_at')->notNull();
         }
     }
     $connection = $this->manager->getConnection();
     $compiler = $connection->getCompiler();
     return $connection->column($compiler->select($this->sql), $compiler->getParams());
 }