setClassKey(LohnabrechnungPeer::CLASSKEY_2); } public function getLohnsteuerSumme($jahr, PropelPDO $con = null) { // prüfe Jahresformat if (strlen($jahr) != 4) throw new Exception ("Invalid jear format. yyyy expected."); if ($con === null) { $con = Propel::getConnection(LaSozialbefreitPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $query = "select sum(lohnsteuer) from lohnabrechnung where monat like :p1__"; $stmt = $con->prepare($query); $stmt->bindValue(':p1', $jahr, PDO::PARAM_STRING); $succ = $stmt->execute(); if (!$succ) throw new Exception("Statement execution not succeeded"); $lss = $stmt->fetch(); return $lss[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); } } // LaSozialbefreit