mergeWith($criteria); } return $query; } /** * Find object by primary key. * Propel uses the instance pool to skip the database if the object exists. * Go fast if the query is untouched. * * * $obj = $c->findPk(12, $con); * * * @param mixed $key Primary key to use for the query * @param PropelPDO $con an optional connection object * * @return Mitarbeiter|Mitarbeiter[]|mixed the result, formatted by the current formatter */ public function findPk($key, $con = null) { if ($key === null) { return null; } if ((null !== ($obj = MitarbeiterPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { // the object is already in the instance pool return $obj; } if ($con === null) { $con = Propel::getConnection(MitarbeiterPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $this->basePreSelect($con); if ($this->formatter || $this->modelAlias || $this->with || $this->select || $this->selectColumns || $this->asColumns || $this->selectModifiers || $this->map || $this->having || $this->joins) { return $this->findPkComplex($key, $con); } else { return $this->findPkSimple($key, $con); } } /** * Alias of findPk to use instance pooling * * @param mixed $key Primary key to use for the query * @param PropelPDO $con A connection object * * @return Mitarbeiter A model object, or null if the key is not found * @throws PropelException */ public function findOneById($key, $con = null) { return $this->findPk($key, $con); } /** * Find object by primary key using raw SQL to go fast. * Bypass doSelect() and the object formatter by using generated code. * * @param mixed $key Primary key to use for the query * @param PropelPDO $con A connection object * * @return Mitarbeiter A model object, or null if the key is not found * @throws PropelException */ protected function findPkSimple($key, $con) { $sql = 'SELECT `id`, `mod`, `nachname`, `vorname`, `anrede`, `strasse`, `plz`, `ort`, `iban`, `bank`, `email`, `basis_betrag`, `steuermerkmal`, `aktiv`, `lp_id` FROM `mitarbeiter` WHERE `id` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->execute(); } catch (Exception $e) { Propel::log($e->getMessage(), Propel::LOG_ERR); throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e); } $obj = null; if ($row = $stmt->fetch(PDO::FETCH_NUM)) { $obj = new Mitarbeiter(); $obj->hydrate($row); MitarbeiterPeer::addInstanceToPool($obj, (string) $key); } $stmt->closeCursor(); return $obj; } /** * Find object by primary key. * * @param mixed $key Primary key to use for the query * @param PropelPDO $con A connection object * * @return Mitarbeiter|Mitarbeiter[]|mixed the result, formatted by the current formatter */ protected function findPkComplex($key, $con) { // As the query uses a PK condition, no limit(1) is necessary. $criteria = $this->isKeepQuery() ? clone $this : $this; $stmt = $criteria ->filterByPrimaryKey($key) ->doSelect($con); return $criteria->getFormatter()->init($criteria)->formatOne($stmt); } /** * Find objects by primary key * * $objs = $c->findPks(array(12, 56, 832), $con); * * @param array $keys Primary keys to use for the query * @param PropelPDO $con an optional connection object * * @return PropelObjectCollection|Mitarbeiter[]|mixed the list of results, formatted by the current formatter */ public function findPks($keys, $con = null) { if ($con === null) { $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ); } $this->basePreSelect($con); $criteria = $this->isKeepQuery() ? clone $this : $this; $stmt = $criteria ->filterByPrimaryKeys($keys) ->doSelect($con); return $criteria->getFormatter()->init($criteria)->format($stmt); } /** * Filter the query by primary key * * @param mixed $key Primary key to use for the query * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByPrimaryKey($key) { return $this->addUsingAlias(MitarbeiterPeer::ID, $key, Criteria::EQUAL); } /** * Filter the query by a list of primary keys * * @param array $keys The list of primary key to use for the query * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByPrimaryKeys($keys) { return $this->addUsingAlias(MitarbeiterPeer::ID, $keys, Criteria::IN); } /** * Filter the query on the id column * * Example usage: * * $query->filterById(1234); // WHERE id = 1234 * $query->filterById(array(12, 34)); // WHERE id IN (12, 34) * $query->filterById(array('min' => 12)); // WHERE id >= 12 * $query->filterById(array('max' => 12)); // WHERE id <= 12 * * * @param mixed $id The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterById($id = null, $comparison = null) { if (is_array($id)) { $useMinMax = false; if (isset($id['min'])) { $this->addUsingAlias(MitarbeiterPeer::ID, $id['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($id['max'])) { $this->addUsingAlias(MitarbeiterPeer::ID, $id['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MitarbeiterPeer::ID, $id, $comparison); } /** * Filter the query on the mod column * * Example usage: * * $query->filterByMod(1234); // WHERE mod = 1234 * $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34) * $query->filterByMod(array('min' => 12)); // WHERE mod >= 12 * $query->filterByMod(array('max' => 12)); // WHERE mod <= 12 * * * @param mixed $mod The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByMod($mod = null, $comparison = null) { if (is_array($mod)) { $useMinMax = false; if (isset($mod['min'])) { $this->addUsingAlias(MitarbeiterPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($mod['max'])) { $this->addUsingAlias(MitarbeiterPeer::MOD, $mod['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MitarbeiterPeer::MOD, $mod, $comparison); } /** * Filter the query on the nachname column * * Example usage: * * $query->filterByNachname('fooValue'); // WHERE nachname = 'fooValue' * $query->filterByNachname('%fooValue%'); // WHERE nachname LIKE '%fooValue%' * * * @param string $nachname The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByNachname($nachname = null, $comparison = null) { if (null === $comparison) { if (is_array($nachname)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $nachname)) { $nachname = str_replace('*', '%', $nachname); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::NACHNAME, $nachname, $comparison); } /** * Filter the query on the vorname column * * Example usage: * * $query->filterByVorname('fooValue'); // WHERE vorname = 'fooValue' * $query->filterByVorname('%fooValue%'); // WHERE vorname LIKE '%fooValue%' * * * @param string $vorname The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByVorname($vorname = null, $comparison = null) { if (null === $comparison) { if (is_array($vorname)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $vorname)) { $vorname = str_replace('*', '%', $vorname); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::VORNAME, $vorname, $comparison); } /** * Filter the query on the anrede column * * Example usage: * * $query->filterByAnrede('fooValue'); // WHERE anrede = 'fooValue' * $query->filterByAnrede('%fooValue%'); // WHERE anrede LIKE '%fooValue%' * * * @param string $anrede The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByAnrede($anrede = null, $comparison = null) { if (null === $comparison) { if (is_array($anrede)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $anrede)) { $anrede = str_replace('*', '%', $anrede); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::ANREDE, $anrede, $comparison); } /** * Filter the query on the strasse column * * Example usage: * * $query->filterByStrasse('fooValue'); // WHERE strasse = 'fooValue' * $query->filterByStrasse('%fooValue%'); // WHERE strasse LIKE '%fooValue%' * * * @param string $strasse The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByStrasse($strasse = null, $comparison = null) { if (null === $comparison) { if (is_array($strasse)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $strasse)) { $strasse = str_replace('*', '%', $strasse); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::STRASSE, $strasse, $comparison); } /** * Filter the query on the plz column * * Example usage: * * $query->filterByPlz('fooValue'); // WHERE plz = 'fooValue' * $query->filterByPlz('%fooValue%'); // WHERE plz LIKE '%fooValue%' * * * @param string $plz The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByPlz($plz = null, $comparison = null) { if (null === $comparison) { if (is_array($plz)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $plz)) { $plz = str_replace('*', '%', $plz); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::PLZ, $plz, $comparison); } /** * Filter the query on the ort column * * Example usage: * * $query->filterByOrt('fooValue'); // WHERE ort = 'fooValue' * $query->filterByOrt('%fooValue%'); // WHERE ort LIKE '%fooValue%' * * * @param string $ort The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByOrt($ort = null, $comparison = null) { if (null === $comparison) { if (is_array($ort)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $ort)) { $ort = str_replace('*', '%', $ort); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::ORT, $ort, $comparison); } /** * Filter the query on the iban column * * Example usage: * * $query->filterByIban('fooValue'); // WHERE iban = 'fooValue' * $query->filterByIban('%fooValue%'); // WHERE iban LIKE '%fooValue%' * * * @param string $iban The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByIban($iban = null, $comparison = null) { if (null === $comparison) { if (is_array($iban)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $iban)) { $iban = str_replace('*', '%', $iban); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::IBAN, $iban, $comparison); } /** * Filter the query on the bank column * * Example usage: * * $query->filterByBank('fooValue'); // WHERE bank = 'fooValue' * $query->filterByBank('%fooValue%'); // WHERE bank LIKE '%fooValue%' * * * @param string $bank The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByBank($bank = null, $comparison = null) { if (null === $comparison) { if (is_array($bank)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $bank)) { $bank = str_replace('*', '%', $bank); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::BANK, $bank, $comparison); } /** * Filter the query on the email column * * Example usage: * * $query->filterByEmail('fooValue'); // WHERE email = 'fooValue' * $query->filterByEmail('%fooValue%'); // WHERE email LIKE '%fooValue%' * * * @param string $email The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByEmail($email = null, $comparison = null) { if (null === $comparison) { if (is_array($email)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $email)) { $email = str_replace('*', '%', $email); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::EMAIL, $email, $comparison); } /** * Filter the query on the basis_betrag column * * Example usage: * * $query->filterByBasisBetrag(1234); // WHERE basis_betrag = 1234 * $query->filterByBasisBetrag(array(12, 34)); // WHERE basis_betrag IN (12, 34) * $query->filterByBasisBetrag(array('min' => 12)); // WHERE basis_betrag >= 12 * $query->filterByBasisBetrag(array('max' => 12)); // WHERE basis_betrag <= 12 * * * @param mixed $basisBetrag The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByBasisBetrag($basisBetrag = null, $comparison = null) { if (is_array($basisBetrag)) { $useMinMax = false; if (isset($basisBetrag['min'])) { $this->addUsingAlias(MitarbeiterPeer::BASIS_BETRAG, $basisBetrag['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($basisBetrag['max'])) { $this->addUsingAlias(MitarbeiterPeer::BASIS_BETRAG, $basisBetrag['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MitarbeiterPeer::BASIS_BETRAG, $basisBetrag, $comparison); } /** * Filter the query on the steuermerkmal column * * Example usage: * * $query->filterBySteuermerkmal('fooValue'); // WHERE steuermerkmal = 'fooValue' * $query->filterBySteuermerkmal('%fooValue%'); // WHERE steuermerkmal LIKE '%fooValue%' * * * @param string $steuermerkmal The value to use as filter. * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterBySteuermerkmal($steuermerkmal = null, $comparison = null) { if (null === $comparison) { if (is_array($steuermerkmal)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $steuermerkmal)) { $steuermerkmal = str_replace('*', '%', $steuermerkmal); $comparison = Criteria::LIKE; } } return $this->addUsingAlias(MitarbeiterPeer::STEUERMERKMAL, $steuermerkmal, $comparison); } /** * Filter the query on the aktiv column * * Example usage: * * $query->filterByAktiv(true); // WHERE aktiv = true * $query->filterByAktiv('yes'); // WHERE aktiv = true * * * @param boolean|string $aktiv The value to use as filter. * Non-boolean arguments are converted using the following rules: * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true * * 0, '0', 'false', 'off', and 'no' are converted to boolean false * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByAktiv($aktiv = null, $comparison = null) { if (is_string($aktiv)) { $aktiv = in_array(strtolower($aktiv), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; } return $this->addUsingAlias(MitarbeiterPeer::AKTIV, $aktiv, $comparison); } /** * Filter the query on the lp_id column * * Example usage: * * $query->filterByLpId(1234); // WHERE lp_id = 1234 * $query->filterByLpId(array(12, 34)); // WHERE lp_id IN (12, 34) * $query->filterByLpId(array('min' => 12)); // WHERE lp_id >= 12 * $query->filterByLpId(array('max' => 12)); // WHERE lp_id <= 12 * * * @see filterByLohnprofil() * * @param mixed $lpId The value to use as filter. * Use scalar values for equality. * Use array values for in_array() equivalent. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface */ public function filterByLpId($lpId = null, $comparison = null) { if (is_array($lpId)) { $useMinMax = false; if (isset($lpId['min'])) { $this->addUsingAlias(MitarbeiterPeer::LP_ID, $lpId['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($lpId['max'])) { $this->addUsingAlias(MitarbeiterPeer::LP_ID, $lpId['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MitarbeiterPeer::LP_ID, $lpId, $comparison); } /** * Filter the query by a related Lohnprofil object * * @param Lohnprofil|PropelObjectCollection $lohnprofil The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLohnprofil($lohnprofil, $comparison = null) { if ($lohnprofil instanceof Lohnprofil) { return $this ->addUsingAlias(MitarbeiterPeer::LP_ID, $lohnprofil->getId(), $comparison); } elseif ($lohnprofil instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(MitarbeiterPeer::LP_ID, $lohnprofil->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByLohnprofil() only accepts arguments of type Lohnprofil or PropelCollection'); } } /** * Adds a JOIN clause to the query using the Lohnprofil relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return MitarbeiterQuery The current query, for fluid interface */ public function joinLohnprofil($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('Lohnprofil'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'Lohnprofil'); } return $this; } /** * Use the Lohnprofil relation Lohnprofil object * * @see useQuery() * * @param string $relationAlias optional alias for the relation, * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return LohnprofilQuery A secondary query class using the current class as primary query */ public function useLohnprofilQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinLohnprofil($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'Lohnprofil', 'LohnprofilQuery'); } /** * Filter the query by a related Lohnabrechnung object * * @param Lohnabrechnung|PropelObjectCollection $lohnabrechnung the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return MitarbeiterQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByLA($lohnabrechnung, $comparison = null) { if ($lohnabrechnung instanceof Lohnabrechnung) { return $this ->addUsingAlias(MitarbeiterPeer::ID, $lohnabrechnung->getMaId(), $comparison); } elseif ($lohnabrechnung instanceof PropelObjectCollection) { return $this ->useLAQuery() ->filterByPrimaryKeys($lohnabrechnung->getPrimaryKeys()) ->endUse(); } else { throw new PropelException('filterByLA() only accepts arguments of type Lohnabrechnung or PropelCollection'); } } /** * Adds a JOIN clause to the query using the LA relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return MitarbeiterQuery The current query, for fluid interface */ public function joinLA($relationAlias = null, $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); $relationMap = $tableMap->getRelation('LA'); // create a ModelJoin object for this join $join = new ModelJoin(); $join->setJoinType($joinType); $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); if ($previousJoin = $this->getPreviousJoin()) { $join->setPreviousJoin($previousJoin); } // add the ModelJoin to the current object if ($relationAlias) { $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { $this->addJoinObject($join, 'LA'); } return $this; } /** * Use the LA relation Lohnabrechnung object * * @see useQuery() * * @param string $relationAlias optional alias for the relation, * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return LohnabrechnungQuery A secondary query class using the current class as primary query */ public function useLAQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinLA($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'LA', 'LohnabrechnungQuery'); } /** * Exclude object from result * * @param Mitarbeiter $mitarbeiter Object to remove from the list of results * * @return MitarbeiterQuery The current query, for fluid interface */ public function prune($mitarbeiter = null) { if ($mitarbeiter) { $this->addUsingAlias(MitarbeiterPeer::ID, $mitarbeiter->getId(), Criteria::NOT_EQUAL); } return $this; } }