getMonat(),0,4); $ma_id = $this->getMaId(); if ($con === null) { $con = Propel::getConnection(LohnabrechnungPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $query = "select sum($typ) from lohnabrechnung where ma_id = :p1 and monat like :p2 and monat <= :p3"; $stmt = $con->prepare($query); $stmt->bindValue(':p1', $ma_id, PDO::PARAM_INT); $stmt->bindValue(':p2', "$jahr%", PDO::PARAM_STR); $stmt->bindValue(':p3', $this->getMonat(), PDO::PARAM_STR); $succ = $stmt->execute(); if (!$succ) throw new Exception("Statement execution not succeeded"); $summe = $stmt->fetch(); return $summe[0]; } public function save(PropelPDO $con = null) { if ($this->isNew() || $this->mod >= 999999) { $this->setMod(0); } else { $this->setMod($this->mod + 1); } return parent::save($con); } } // Lohnabrechnung