]> wagnertech.de Git - projects.git/blob - verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugQuery.php
verleihnix komplett eingescheckt
[projects.git] / verleihnix / Verleihnix / impl / data / build / classes / propel / om / BaseWerkzeugQuery.php
1 <?php
2
3
4 /**
5  * Base class that represents a query for the 'werkzeug' table.
6  *
7  *
8  *
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
15  *
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
22  *
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
26  *
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
29  *
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
35  *
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
42  *
43  * @package    propel.generator.propel.om
44  */
45 abstract class BaseWerkzeugQuery extends ModelCriteria
46 {
47     /**
48      * Initializes internal state of BaseWerkzeugQuery object.
49      *
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'
53      */
54     public function __construct($dbName = null, $modelName = null, $modelAlias = null)
55     {
56         if (null === $dbName) {
57             $dbName = 'mkrimi';
58         }
59         if (null === $modelName) {
60             $modelName = 'Werkzeug';
61         }
62         parent::__construct($dbName, $modelName, $modelAlias);
63     }
64
65     /**
66      * Returns a new WerkzeugQuery object.
67      *
68      * @param     string $modelAlias The alias of a model in the query
69      * @param   WerkzeugQuery|Criteria $criteria Optional Criteria to build the query from
70      *
71      * @return WerkzeugQuery
72      */
73     public static function create($modelAlias = null, $criteria = null)
74     {
75         if ($criteria instanceof WerkzeugQuery) {
76             return $criteria;
77         }
78         $query = new WerkzeugQuery(null, null, $modelAlias);
79
80         if ($criteria instanceof Criteria) {
81             $query->mergeWith($criteria);
82         }
83
84         return $query;
85     }
86
87     /**
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.
91      *
92      * <code>
93      * $obj  = $c->findPk(12, $con);
94      * </code>
95      *
96      * @param mixed $key Primary key to use for the query
97      * @param     PropelPDO $con an optional connection object
98      *
99      * @return   Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter
100      */
101     public function findPk($key, $con = null)
102     {
103         if ($key === null) {
104             return null;
105         }
106         if ((null !== ($obj = WerkzeugPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
107             // the object is already in the instance pool
108             return $obj;
109         }
110         if ($con === null) {
111             $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ);
112         }
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);
118         } else {
119             return $this->findPkSimple($key, $con);
120         }
121     }
122
123     /**
124      * Alias of findPk to use instance pooling
125      *
126      * @param     mixed $key Primary key to use for the query
127      * @param     PropelPDO $con A connection object
128      *
129      * @return                 Werkzeug A model object, or null if the key is not found
130      * @throws PropelException
131      */
132      public function findOneById($key, $con = null)
133      {
134         return $this->findPk($key, $con);
135      }
136
137     /**
138      * Find object by primary key using raw SQL to go fast.
139      * Bypass doSelect() and the object formatter by using generated code.
140      *
141      * @param     mixed $key Primary key to use for the query
142      * @param     PropelPDO $con A connection object
143      *
144      * @return                 Werkzeug A model object, or null if the key is not found
145      * @throws PropelException
146      */
147     protected function findPkSimple($key, $con)
148     {
149         $sql = 'SELECT `id`, `mod`, `typ`, `beschreibung`, `eigentumer`, `zz_bei` FROM `werkzeug` WHERE `id` = :p0';
150         try {
151             $stmt = $con->prepare($sql);
152             $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
153             $stmt->execute();
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);
157         }
158         $obj = null;
159         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
160             $obj = new Werkzeug();
161             $obj->hydrate($row);
162             WerkzeugPeer::addInstanceToPool($obj, (string) $key);
163         }
164         $stmt->closeCursor();
165
166         return $obj;
167     }
168
169     /**
170      * Find object by primary key.
171      *
172      * @param     mixed $key Primary key to use for the query
173      * @param     PropelPDO $con A connection object
174      *
175      * @return Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter
176      */
177     protected function findPkComplex($key, $con)
178     {
179         // As the query uses a PK condition, no limit(1) is necessary.
180         $criteria = $this->isKeepQuery() ? clone $this : $this;
181         $stmt = $criteria
182             ->filterByPrimaryKey($key)
183             ->doSelect($con);
184
185         return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
186     }
187
188     /**
189      * Find objects by primary key
190      * <code>
191      * $objs = $c->findPks(array(12, 56, 832), $con);
192      * </code>
193      * @param     array $keys Primary keys to use for the query
194      * @param     PropelPDO $con an optional connection object
195      *
196      * @return PropelObjectCollection|Werkzeug[]|mixed the list of results, formatted by the current formatter
197      */
198     public function findPks($keys, $con = null)
199     {
200         if ($con === null) {
201             $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
202         }
203         $this->basePreSelect($con);
204         $criteria = $this->isKeepQuery() ? clone $this : $this;
205         $stmt = $criteria
206             ->filterByPrimaryKeys($keys)
207             ->doSelect($con);
208
209         return $criteria->getFormatter()->init($criteria)->format($stmt);
210     }
211
212     /**
213      * Filter the query by primary key
214      *
215      * @param     mixed $key Primary key to use for the query
216      *
217      * @return WerkzeugQuery The current query, for fluid interface
218      */
219     public function filterByPrimaryKey($key)
220     {
221
222         return $this->addUsingAlias(WerkzeugPeer::ID, $key, Criteria::EQUAL);
223     }
224
225     /**
226      * Filter the query by a list of primary keys
227      *
228      * @param     array $keys The list of primary key to use for the query
229      *
230      * @return WerkzeugQuery The current query, for fluid interface
231      */
232     public function filterByPrimaryKeys($keys)
233     {
234
235         return $this->addUsingAlias(WerkzeugPeer::ID, $keys, Criteria::IN);
236     }
237
238     /**
239      * Filter the query on the id column
240      *
241      * Example usage:
242      * <code>
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
247      * </code>
248      *
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
254      *
255      * @return WerkzeugQuery The current query, for fluid interface
256      */
257     public function filterById($id = null, $comparison = null)
258     {
259         if (is_array($id)) {
260             $useMinMax = false;
261             if (isset($id['min'])) {
262                 $this->addUsingAlias(WerkzeugPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
263                 $useMinMax = true;
264             }
265             if (isset($id['max'])) {
266                 $this->addUsingAlias(WerkzeugPeer::ID, $id['max'], Criteria::LESS_EQUAL);
267                 $useMinMax = true;
268             }
269             if ($useMinMax) {
270                 return $this;
271             }
272             if (null === $comparison) {
273                 $comparison = Criteria::IN;
274             }
275         }
276
277         return $this->addUsingAlias(WerkzeugPeer::ID, $id, $comparison);
278     }
279
280     /**
281      * Filter the query on the mod column
282      *
283      * Example usage:
284      * <code>
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
289      * </code>
290      *
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
296      *
297      * @return WerkzeugQuery The current query, for fluid interface
298      */
299     public function filterByMod($mod = null, $comparison = null)
300     {
301         if (is_array($mod)) {
302             $useMinMax = false;
303             if (isset($mod['min'])) {
304                 $this->addUsingAlias(WerkzeugPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL);
305                 $useMinMax = true;
306             }
307             if (isset($mod['max'])) {
308                 $this->addUsingAlias(WerkzeugPeer::MOD, $mod['max'], Criteria::LESS_EQUAL);
309                 $useMinMax = true;
310             }
311             if ($useMinMax) {
312                 return $this;
313             }
314             if (null === $comparison) {
315                 $comparison = Criteria::IN;
316             }
317         }
318
319         return $this->addUsingAlias(WerkzeugPeer::MOD, $mod, $comparison);
320     }
321
322     /**
323      * Filter the query on the typ column
324      *
325      * Example usage:
326      * <code>
327      * $query->filterByTyp('fooValue');   // WHERE typ = 'fooValue'
328      * $query->filterByTyp('%fooValue%'); // WHERE typ LIKE '%fooValue%'
329      * </code>
330      *
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
334      *
335      * @return WerkzeugQuery The current query, for fluid interface
336      */
337     public function filterByTyp($typ = null, $comparison = null)
338     {
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;
345             }
346         }
347
348         return $this->addUsingAlias(WerkzeugPeer::TYP, $typ, $comparison);
349     }
350
351     /**
352      * Filter the query on the beschreibung column
353      *
354      * Example usage:
355      * <code>
356      * $query->filterByBeschreibung('fooValue');   // WHERE beschreibung = 'fooValue'
357      * $query->filterByBeschreibung('%fooValue%'); // WHERE beschreibung LIKE '%fooValue%'
358      * </code>
359      *
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
363      *
364      * @return WerkzeugQuery The current query, for fluid interface
365      */
366     public function filterByBeschreibung($beschreibung = null, $comparison = null)
367     {
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;
374             }
375         }
376
377         return $this->addUsingAlias(WerkzeugPeer::BESCHREIBUNG, $beschreibung, $comparison);
378     }
379
380     /**
381      * Filter the query on the eigentumer column
382      *
383      * Example usage:
384      * <code>
385      * $query->filterByEigentumer('fooValue');   // WHERE eigentumer = 'fooValue'
386      * $query->filterByEigentumer('%fooValue%'); // WHERE eigentumer LIKE '%fooValue%'
387      * </code>
388      *
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
392      *
393      * @return WerkzeugQuery The current query, for fluid interface
394      */
395     public function filterByEigentumer($eigentumer = null, $comparison = null)
396     {
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;
403             }
404         }
405
406         return $this->addUsingAlias(WerkzeugPeer::EIGENTUMER, $eigentumer, $comparison);
407     }
408
409     /**
410      * Filter the query on the zz_bei column
411      *
412      * Example usage:
413      * <code>
414      * $query->filterByZzBei('fooValue');   // WHERE zz_bei = 'fooValue'
415      * $query->filterByZzBei('%fooValue%'); // WHERE zz_bei LIKE '%fooValue%'
416      * </code>
417      *
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
421      *
422      * @return WerkzeugQuery The current query, for fluid interface
423      */
424     public function filterByZzBei($zzBei = null, $comparison = null)
425     {
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;
432             }
433         }
434
435         return $this->addUsingAlias(WerkzeugPeer::ZZ_BEI, $zzBei, $comparison);
436     }
437
438     /**
439      * Exclude object from result
440      *
441      * @param   Werkzeug $werkzeug Object to remove from the list of results
442      *
443      * @return WerkzeugQuery The current query, for fluid interface
444      */
445     public function prune($werkzeug = null)
446     {
447         if ($werkzeug) {
448             $this->addUsingAlias(WerkzeugPeer::ID, $werkzeug->getId(), Criteria::NOT_EQUAL);
449         }
450
451         return $this;
452     }
453
454 }