code: public function sumValor()
      {
          $tableGateway = new TableGateway($this->tableName, $this->dbAdapter);
          $sql = $tableGateway->getSql();
          $select = $sql->select()->columns(array('sum' => new Expression('SUM(valor)')));
          return $tableGateway->selectWith($select)->current();
      }
docs: Encontra  somados valores de todos os pagamentos no BD