5 * Base class that represents a query for the 'werkzeug' table.
9 * @method WerkzeugQuery orderById($order = Criteria::ASC) Order by the id column
10 * @method WerkzeugQuery orderByMod($order = Criteria::ASC) Order by the mod column
11 * @method WerkzeugQuery orderByTyp($order = Criteria::ASC) Order by the typ column
12 * @method WerkzeugQuery orderByBeschreibung($order = Criteria::ASC) Order by the beschreibung column
13 * @method WerkzeugQuery orderByEigentumer($order = Criteria::ASC) Order by the eigentumer column
14 * @method WerkzeugQuery orderByZzBei($order = Criteria::ASC) Order by the zz_bei column
16 * @method WerkzeugQuery groupById() Group by the id column
17 * @method WerkzeugQuery groupByMod() Group by the mod column
18 * @method WerkzeugQuery groupByTyp() Group by the typ column
19 * @method WerkzeugQuery groupByBeschreibung() Group by the beschreibung column
20 * @method WerkzeugQuery groupByEigentumer() Group by the eigentumer column
21 * @method WerkzeugQuery groupByZzBei() Group by the zz_bei column
23 * @method WerkzeugQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
24 * @method WerkzeugQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
25 * @method WerkzeugQuery innerJoin($relation) Adds a INNER JOIN clause to the query
27 * @method Werkzeug findOne(PropelPDO $con = null) Return the first Werkzeug matching the query
28 * @method Werkzeug findOneOrCreate(PropelPDO $con = null) Return the first Werkzeug matching the query, or a new Werkzeug object populated from the query conditions when no match is found
30 * @method Werkzeug findOneByMod(int $mod) Return the first Werkzeug filtered by the mod column
31 * @method Werkzeug findOneByTyp(string $typ) Return the first Werkzeug filtered by the typ column
32 * @method Werkzeug findOneByBeschreibung(string $beschreibung) Return the first Werkzeug filtered by the beschreibung column
33 * @method Werkzeug findOneByEigentumer(string $eigentumer) Return the first Werkzeug filtered by the eigentumer column
34 * @method Werkzeug findOneByZzBei(string $zz_bei) Return the first Werkzeug filtered by the zz_bei column
36 * @method array findById(int $id) Return Werkzeug objects filtered by the id column
37 * @method array findByMod(int $mod) Return Werkzeug objects filtered by the mod column
38 * @method array findByTyp(string $typ) Return Werkzeug objects filtered by the typ column
39 * @method array findByBeschreibung(string $beschreibung) Return Werkzeug objects filtered by the beschreibung column
40 * @method array findByEigentumer(string $eigentumer) Return Werkzeug objects filtered by the eigentumer column
41 * @method array findByZzBei(string $zz_bei) Return Werkzeug objects filtered by the zz_bei column
43 * @package propel.generator.propel.om
45 abstract class BaseWerkzeugQuery extends ModelCriteria
48 * Initializes internal state of BaseWerkzeugQuery object.
50 * @param string $dbName The dabase name
51 * @param string $modelName The phpName of a model, e.g. 'Book'
52 * @param string $modelAlias The alias for the model in this query, e.g. 'b'
54 public function __construct($dbName = null, $modelName = null, $modelAlias = null)
56 if (null === $dbName) {
59 if (null === $modelName) {
60 $modelName = 'Werkzeug';
62 parent::__construct($dbName, $modelName, $modelAlias);
66 * Returns a new WerkzeugQuery object.
68 * @param string $modelAlias The alias of a model in the query
69 * @param WerkzeugQuery|Criteria $criteria Optional Criteria to build the query from
71 * @return WerkzeugQuery
73 public static function create($modelAlias = null, $criteria = null)
75 if ($criteria instanceof WerkzeugQuery) {
78 $query = new WerkzeugQuery(null, null, $modelAlias);
80 if ($criteria instanceof Criteria) {
81 $query->mergeWith($criteria);
88 * Find object by primary key.
89 * Propel uses the instance pool to skip the database if the object exists.
90 * Go fast if the query is untouched.
93 * $obj = $c->findPk(12, $con);
96 * @param mixed $key Primary key to use for the query
97 * @param PropelPDO $con an optional connection object
99 * @return Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter
101 public function findPk($key, $con = null)
106 if ((null !== ($obj = WerkzeugPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
107 // the object is already in the instance pool
111 $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ);
113 $this->basePreSelect($con);
114 if ($this->formatter || $this->modelAlias || $this->with || $this->select
115 || $this->selectColumns || $this->asColumns || $this->selectModifiers
116 || $this->map || $this->having || $this->joins) {
117 return $this->findPkComplex($key, $con);
119 return $this->findPkSimple($key, $con);
124 * Alias of findPk to use instance pooling
126 * @param mixed $key Primary key to use for the query
127 * @param PropelPDO $con A connection object
129 * @return Werkzeug A model object, or null if the key is not found
130 * @throws PropelException
132 public function findOneById($key, $con = null)
134 return $this->findPk($key, $con);
138 * Find object by primary key using raw SQL to go fast.
139 * Bypass doSelect() and the object formatter by using generated code.
141 * @param mixed $key Primary key to use for the query
142 * @param PropelPDO $con A connection object
144 * @return Werkzeug A model object, or null if the key is not found
145 * @throws PropelException
147 protected function findPkSimple($key, $con)
149 $sql = 'SELECT `id`, `mod`, `typ`, `beschreibung`, `eigentumer`, `zz_bei` FROM `werkzeug` WHERE `id` = :p0';
151 $stmt = $con->prepare($sql);
152 $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
154 } catch (Exception $e) {
155 Propel::log($e->getMessage(), Propel::LOG_ERR);
156 throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
159 if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
160 $obj = new Werkzeug();
162 WerkzeugPeer::addInstanceToPool($obj, (string) $key);
164 $stmt->closeCursor();
170 * Find object by primary key.
172 * @param mixed $key Primary key to use for the query
173 * @param PropelPDO $con A connection object
175 * @return Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter
177 protected function findPkComplex($key, $con)
179 // As the query uses a PK condition, no limit(1) is necessary.
180 $criteria = $this->isKeepQuery() ? clone $this : $this;
182 ->filterByPrimaryKey($key)
185 return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
189 * Find objects by primary key
191 * $objs = $c->findPks(array(12, 56, 832), $con);
193 * @param array $keys Primary keys to use for the query
194 * @param PropelPDO $con an optional connection object
196 * @return PropelObjectCollection|Werkzeug[]|mixed the list of results, formatted by the current formatter
198 public function findPks($keys, $con = null)
201 $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
203 $this->basePreSelect($con);
204 $criteria = $this->isKeepQuery() ? clone $this : $this;
206 ->filterByPrimaryKeys($keys)
209 return $criteria->getFormatter()->init($criteria)->format($stmt);
213 * Filter the query by primary key
215 * @param mixed $key Primary key to use for the query
217 * @return WerkzeugQuery The current query, for fluid interface
219 public function filterByPrimaryKey($key)
222 return $this->addUsingAlias(WerkzeugPeer::ID, $key, Criteria::EQUAL);
226 * Filter the query by a list of primary keys
228 * @param array $keys The list of primary key to use for the query
230 * @return WerkzeugQuery The current query, for fluid interface
232 public function filterByPrimaryKeys($keys)
235 return $this->addUsingAlias(WerkzeugPeer::ID, $keys, Criteria::IN);
239 * Filter the query on the id column
243 * $query->filterById(1234); // WHERE id = 1234
244 * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
245 * $query->filterById(array('min' => 12)); // WHERE id >= 12
246 * $query->filterById(array('max' => 12)); // WHERE id <= 12
249 * @param mixed $id The value to use as filter.
250 * Use scalar values for equality.
251 * Use array values for in_array() equivalent.
252 * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
253 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
255 * @return WerkzeugQuery The current query, for fluid interface
257 public function filterById($id = null, $comparison = null)
261 if (isset($id['min'])) {
262 $this->addUsingAlias(WerkzeugPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
265 if (isset($id['max'])) {
266 $this->addUsingAlias(WerkzeugPeer::ID, $id['max'], Criteria::LESS_EQUAL);
272 if (null === $comparison) {
273 $comparison = Criteria::IN;
277 return $this->addUsingAlias(WerkzeugPeer::ID, $id, $comparison);
281 * Filter the query on the mod column
285 * $query->filterByMod(1234); // WHERE mod = 1234
286 * $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34)
287 * $query->filterByMod(array('min' => 12)); // WHERE mod >= 12
288 * $query->filterByMod(array('max' => 12)); // WHERE mod <= 12
291 * @param mixed $mod The value to use as filter.
292 * Use scalar values for equality.
293 * Use array values for in_array() equivalent.
294 * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
295 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
297 * @return WerkzeugQuery The current query, for fluid interface
299 public function filterByMod($mod = null, $comparison = null)
301 if (is_array($mod)) {
303 if (isset($mod['min'])) {
304 $this->addUsingAlias(WerkzeugPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL);
307 if (isset($mod['max'])) {
308 $this->addUsingAlias(WerkzeugPeer::MOD, $mod['max'], Criteria::LESS_EQUAL);
314 if (null === $comparison) {
315 $comparison = Criteria::IN;
319 return $this->addUsingAlias(WerkzeugPeer::MOD, $mod, $comparison);
323 * Filter the query on the typ column
327 * $query->filterByTyp('fooValue'); // WHERE typ = 'fooValue'
328 * $query->filterByTyp('%fooValue%'); // WHERE typ LIKE '%fooValue%'
331 * @param string $typ The value to use as filter.
332 * Accepts wildcards (* and % trigger a LIKE)
333 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
335 * @return WerkzeugQuery The current query, for fluid interface
337 public function filterByTyp($typ = null, $comparison = null)
339 if (null === $comparison) {
340 if (is_array($typ)) {
341 $comparison = Criteria::IN;
342 } elseif (preg_match('/[\%\*]/', $typ)) {
343 $typ = str_replace('*', '%', $typ);
344 $comparison = Criteria::LIKE;
348 return $this->addUsingAlias(WerkzeugPeer::TYP, $typ, $comparison);
352 * Filter the query on the beschreibung column
356 * $query->filterByBeschreibung('fooValue'); // WHERE beschreibung = 'fooValue'
357 * $query->filterByBeschreibung('%fooValue%'); // WHERE beschreibung LIKE '%fooValue%'
360 * @param string $beschreibung The value to use as filter.
361 * Accepts wildcards (* and % trigger a LIKE)
362 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
364 * @return WerkzeugQuery The current query, for fluid interface
366 public function filterByBeschreibung($beschreibung = null, $comparison = null)
368 if (null === $comparison) {
369 if (is_array($beschreibung)) {
370 $comparison = Criteria::IN;
371 } elseif (preg_match('/[\%\*]/', $beschreibung)) {
372 $beschreibung = str_replace('*', '%', $beschreibung);
373 $comparison = Criteria::LIKE;
377 return $this->addUsingAlias(WerkzeugPeer::BESCHREIBUNG, $beschreibung, $comparison);
381 * Filter the query on the eigentumer column
385 * $query->filterByEigentumer('fooValue'); // WHERE eigentumer = 'fooValue'
386 * $query->filterByEigentumer('%fooValue%'); // WHERE eigentumer LIKE '%fooValue%'
389 * @param string $eigentumer The value to use as filter.
390 * Accepts wildcards (* and % trigger a LIKE)
391 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
393 * @return WerkzeugQuery The current query, for fluid interface
395 public function filterByEigentumer($eigentumer = null, $comparison = null)
397 if (null === $comparison) {
398 if (is_array($eigentumer)) {
399 $comparison = Criteria::IN;
400 } elseif (preg_match('/[\%\*]/', $eigentumer)) {
401 $eigentumer = str_replace('*', '%', $eigentumer);
402 $comparison = Criteria::LIKE;
406 return $this->addUsingAlias(WerkzeugPeer::EIGENTUMER, $eigentumer, $comparison);
410 * Filter the query on the zz_bei column
414 * $query->filterByZzBei('fooValue'); // WHERE zz_bei = 'fooValue'
415 * $query->filterByZzBei('%fooValue%'); // WHERE zz_bei LIKE '%fooValue%'
418 * @param string $zzBei The value to use as filter.
419 * Accepts wildcards (* and % trigger a LIKE)
420 * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
422 * @return WerkzeugQuery The current query, for fluid interface
424 public function filterByZzBei($zzBei = null, $comparison = null)
426 if (null === $comparison) {
427 if (is_array($zzBei)) {
428 $comparison = Criteria::IN;
429 } elseif (preg_match('/[\%\*]/', $zzBei)) {
430 $zzBei = str_replace('*', '%', $zzBei);
431 $comparison = Criteria::LIKE;
435 return $this->addUsingAlias(WerkzeugPeer::ZZ_BEI, $zzBei, $comparison);
439 * Exclude object from result
441 * @param Werkzeug $werkzeug Object to remove from the list of results
443 * @return WerkzeugQuery The current query, for fluid interface
445 public function prune($werkzeug = null)
448 $this->addUsingAlias(WerkzeugPeer::ID, $werkzeug->getId(), Criteria::NOT_EQUAL);