]> wagnertech.de Git - projects.git/blob - verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumQuery.php
eclipse-cpp added
[projects.git] / verleihnix / Verleihnix / impl / data / build / classes / propel / om / BaseMediumQuery.php
1 <?php
2
3
4 /**
5  * Base class that represents a query for the 'medium' table.
6  *
7  *
8  *
9  * @method MediumQuery orderById($order = Criteria::ASC) Order by the id column
10  * @method MediumQuery orderByMod($order = Criteria::ASC) Order by the mod column
11  * @method MediumQuery orderByAutor($order = Criteria::ASC) Order by the autor column
12  * @method MediumQuery orderByTitel($order = Criteria::ASC) Order by the titel column
13  * @method MediumQuery orderByEigentumer($order = Criteria::ASC) Order by the eigentumer column
14  * @method MediumQuery orderByZzBei($order = Criteria::ASC) Order by the zz_bei column
15  * @method MediumQuery orderByKommentar($order = Criteria::ASC) Order by the kommentar column
16  * @method MediumQuery orderByClassKey($order = Criteria::ASC) Order by the class_key column
17  *
18  * @method MediumQuery groupById() Group by the id column
19  * @method MediumQuery groupByMod() Group by the mod column
20  * @method MediumQuery groupByAutor() Group by the autor column
21  * @method MediumQuery groupByTitel() Group by the titel column
22  * @method MediumQuery groupByEigentumer() Group by the eigentumer column
23  * @method MediumQuery groupByZzBei() Group by the zz_bei column
24  * @method MediumQuery groupByKommentar() Group by the kommentar column
25  * @method MediumQuery groupByClassKey() Group by the class_key column
26  *
27  * @method MediumQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
28  * @method MediumQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
29  * @method MediumQuery innerJoin($relation) Adds a INNER JOIN clause to the query
30  *
31  * @method Medium findOne(PropelPDO $con = null) Return the first Medium matching the query
32  * @method Medium findOneOrCreate(PropelPDO $con = null) Return the first Medium matching the query, or a new Medium object populated from the query conditions when no match is found
33  *
34  * @method Medium findOneByMod(int $mod) Return the first Medium filtered by the mod column
35  * @method Medium findOneByAutor(string $autor) Return the first Medium filtered by the autor column
36  * @method Medium findOneByTitel(string $titel) Return the first Medium filtered by the titel column
37  * @method Medium findOneByEigentumer(string $eigentumer) Return the first Medium filtered by the eigentumer column
38  * @method Medium findOneByZzBei(string $zz_bei) Return the first Medium filtered by the zz_bei column
39  * @method Medium findOneByKommentar(string $kommentar) Return the first Medium filtered by the kommentar column
40  * @method Medium findOneByClassKey(int $class_key) Return the first Medium filtered by the class_key column
41  *
42  * @method array findById(int $id) Return Medium objects filtered by the id column
43  * @method array findByMod(int $mod) Return Medium objects filtered by the mod column
44  * @method array findByAutor(string $autor) Return Medium objects filtered by the autor column
45  * @method array findByTitel(string $titel) Return Medium objects filtered by the titel column
46  * @method array findByEigentumer(string $eigentumer) Return Medium objects filtered by the eigentumer column
47  * @method array findByZzBei(string $zz_bei) Return Medium objects filtered by the zz_bei column
48  * @method array findByKommentar(string $kommentar) Return Medium objects filtered by the kommentar column
49  * @method array findByClassKey(int $class_key) Return Medium objects filtered by the class_key column
50  *
51  * @package    propel.generator.propel.om
52  */
53 abstract class BaseMediumQuery extends ModelCriteria
54 {
55     /**
56      * Initializes internal state of BaseMediumQuery object.
57      *
58      * @param     string $dbName The dabase name
59      * @param     string $modelName The phpName of a model, e.g. 'Book'
60      * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
61      */
62     public function __construct($dbName = null, $modelName = null, $modelAlias = null)
63     {
64         if (null === $dbName) {
65             $dbName = 'mkrimi';
66         }
67         if (null === $modelName) {
68             $modelName = 'Medium';
69         }
70         parent::__construct($dbName, $modelName, $modelAlias);
71     }
72
73     /**
74      * Returns a new MediumQuery object.
75      *
76      * @param     string $modelAlias The alias of a model in the query
77      * @param   MediumQuery|Criteria $criteria Optional Criteria to build the query from
78      *
79      * @return MediumQuery
80      */
81     public static function create($modelAlias = null, $criteria = null)
82     {
83         if ($criteria instanceof MediumQuery) {
84             return $criteria;
85         }
86         $query = new MediumQuery(null, null, $modelAlias);
87
88         if ($criteria instanceof Criteria) {
89             $query->mergeWith($criteria);
90         }
91
92         return $query;
93     }
94
95     /**
96      * Find object by primary key.
97      * Propel uses the instance pool to skip the database if the object exists.
98      * Go fast if the query is untouched.
99      *
100      * <code>
101      * $obj  = $c->findPk(12, $con);
102      * </code>
103      *
104      * @param mixed $key Primary key to use for the query
105      * @param     PropelPDO $con an optional connection object
106      *
107      * @return   Medium|Medium[]|mixed the result, formatted by the current formatter
108      */
109     public function findPk($key, $con = null)
110     {
111         if ($key === null) {
112             return null;
113         }
114         if ((null !== ($obj = MediumPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
115             // the object is already in the instance pool
116             return $obj;
117         }
118         if ($con === null) {
119             $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ);
120         }
121         $this->basePreSelect($con);
122         if ($this->formatter || $this->modelAlias || $this->with || $this->select
123          || $this->selectColumns || $this->asColumns || $this->selectModifiers
124          || $this->map || $this->having || $this->joins) {
125             return $this->findPkComplex($key, $con);
126         } else {
127             return $this->findPkSimple($key, $con);
128         }
129     }
130
131     /**
132      * Alias of findPk to use instance pooling
133      *
134      * @param     mixed $key Primary key to use for the query
135      * @param     PropelPDO $con A connection object
136      *
137      * @return                 Medium A model object, or null if the key is not found
138      * @throws PropelException
139      */
140      public function findOneById($key, $con = null)
141      {
142         return $this->findPk($key, $con);
143      }
144
145     /**
146      * Find object by primary key using raw SQL to go fast.
147      * Bypass doSelect() and the object formatter by using generated code.
148      *
149      * @param     mixed $key Primary key to use for the query
150      * @param     PropelPDO $con A connection object
151      *
152      * @return                 Medium A model object, or null if the key is not found
153      * @throws PropelException
154      */
155     protected function findPkSimple($key, $con)
156     {
157         $sql = 'SELECT `id`, `mod`, `autor`, `titel`, `eigentumer`, `zz_bei`, `kommentar`, `class_key` FROM `medium` WHERE `id` = :p0';
158         try {
159             $stmt = $con->prepare($sql);
160             $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
161             $stmt->execute();
162         } catch (Exception $e) {
163             Propel::log($e->getMessage(), Propel::LOG_ERR);
164             throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
165         }
166         $obj = null;
167         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
168             $cls = MediumPeer::getOMClass($row, 0);
169             $obj = new $cls();
170             $obj->hydrate($row);
171             MediumPeer::addInstanceToPool($obj, (string) $key);
172         }
173         $stmt->closeCursor();
174
175         return $obj;
176     }
177
178     /**
179      * Find object by primary key.
180      *
181      * @param     mixed $key Primary key to use for the query
182      * @param     PropelPDO $con A connection object
183      *
184      * @return Medium|Medium[]|mixed the result, formatted by the current formatter
185      */
186     protected function findPkComplex($key, $con)
187     {
188         // As the query uses a PK condition, no limit(1) is necessary.
189         $criteria = $this->isKeepQuery() ? clone $this : $this;
190         $stmt = $criteria
191             ->filterByPrimaryKey($key)
192             ->doSelect($con);
193
194         return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
195     }
196
197     /**
198      * Find objects by primary key
199      * <code>
200      * $objs = $c->findPks(array(12, 56, 832), $con);
201      * </code>
202      * @param     array $keys Primary keys to use for the query
203      * @param     PropelPDO $con an optional connection object
204      *
205      * @return PropelObjectCollection|Medium[]|mixed the list of results, formatted by the current formatter
206      */
207     public function findPks($keys, $con = null)
208     {
209         if ($con === null) {
210             $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
211         }
212         $this->basePreSelect($con);
213         $criteria = $this->isKeepQuery() ? clone $this : $this;
214         $stmt = $criteria
215             ->filterByPrimaryKeys($keys)
216             ->doSelect($con);
217
218         return $criteria->getFormatter()->init($criteria)->format($stmt);
219     }
220
221     /**
222      * Filter the query by primary key
223      *
224      * @param     mixed $key Primary key to use for the query
225      *
226      * @return MediumQuery The current query, for fluid interface
227      */
228     public function filterByPrimaryKey($key)
229     {
230
231         return $this->addUsingAlias(MediumPeer::ID, $key, Criteria::EQUAL);
232     }
233
234     /**
235      * Filter the query by a list of primary keys
236      *
237      * @param     array $keys The list of primary key to use for the query
238      *
239      * @return MediumQuery The current query, for fluid interface
240      */
241     public function filterByPrimaryKeys($keys)
242     {
243
244         return $this->addUsingAlias(MediumPeer::ID, $keys, Criteria::IN);
245     }
246
247     /**
248      * Filter the query on the id column
249      *
250      * Example usage:
251      * <code>
252      * $query->filterById(1234); // WHERE id = 1234
253      * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
254      * $query->filterById(array('min' => 12)); // WHERE id >= 12
255      * $query->filterById(array('max' => 12)); // WHERE id <= 12
256      * </code>
257      *
258      * @param     mixed $id The value to use as filter.
259      *              Use scalar values for equality.
260      *              Use array values for in_array() equivalent.
261      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
262      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
263      *
264      * @return MediumQuery The current query, for fluid interface
265      */
266     public function filterById($id = null, $comparison = null)
267     {
268         if (is_array($id)) {
269             $useMinMax = false;
270             if (isset($id['min'])) {
271                 $this->addUsingAlias(MediumPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
272                 $useMinMax = true;
273             }
274             if (isset($id['max'])) {
275                 $this->addUsingAlias(MediumPeer::ID, $id['max'], Criteria::LESS_EQUAL);
276                 $useMinMax = true;
277             }
278             if ($useMinMax) {
279                 return $this;
280             }
281             if (null === $comparison) {
282                 $comparison = Criteria::IN;
283             }
284         }
285
286         return $this->addUsingAlias(MediumPeer::ID, $id, $comparison);
287     }
288
289     /**
290      * Filter the query on the mod column
291      *
292      * Example usage:
293      * <code>
294      * $query->filterByMod(1234); // WHERE mod = 1234
295      * $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34)
296      * $query->filterByMod(array('min' => 12)); // WHERE mod >= 12
297      * $query->filterByMod(array('max' => 12)); // WHERE mod <= 12
298      * </code>
299      *
300      * @param     mixed $mod The value to use as filter.
301      *              Use scalar values for equality.
302      *              Use array values for in_array() equivalent.
303      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
304      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
305      *
306      * @return MediumQuery The current query, for fluid interface
307      */
308     public function filterByMod($mod = null, $comparison = null)
309     {
310         if (is_array($mod)) {
311             $useMinMax = false;
312             if (isset($mod['min'])) {
313                 $this->addUsingAlias(MediumPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL);
314                 $useMinMax = true;
315             }
316             if (isset($mod['max'])) {
317                 $this->addUsingAlias(MediumPeer::MOD, $mod['max'], Criteria::LESS_EQUAL);
318                 $useMinMax = true;
319             }
320             if ($useMinMax) {
321                 return $this;
322             }
323             if (null === $comparison) {
324                 $comparison = Criteria::IN;
325             }
326         }
327
328         return $this->addUsingAlias(MediumPeer::MOD, $mod, $comparison);
329     }
330
331     /**
332      * Filter the query on the autor column
333      *
334      * Example usage:
335      * <code>
336      * $query->filterByAutor('fooValue');   // WHERE autor = 'fooValue'
337      * $query->filterByAutor('%fooValue%'); // WHERE autor LIKE '%fooValue%'
338      * </code>
339      *
340      * @param     string $autor The value to use as filter.
341      *              Accepts wildcards (* and % trigger a LIKE)
342      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
343      *
344      * @return MediumQuery The current query, for fluid interface
345      */
346     public function filterByAutor($autor = null, $comparison = null)
347     {
348         if (null === $comparison) {
349             if (is_array($autor)) {
350                 $comparison = Criteria::IN;
351             } elseif (preg_match('/[\%\*]/', $autor)) {
352                 $autor = str_replace('*', '%', $autor);
353                 $comparison = Criteria::LIKE;
354             }
355         }
356
357         return $this->addUsingAlias(MediumPeer::AUTOR, $autor, $comparison);
358     }
359
360     /**
361      * Filter the query on the titel column
362      *
363      * Example usage:
364      * <code>
365      * $query->filterByTitel('fooValue');   // WHERE titel = 'fooValue'
366      * $query->filterByTitel('%fooValue%'); // WHERE titel LIKE '%fooValue%'
367      * </code>
368      *
369      * @param     string $titel The value to use as filter.
370      *              Accepts wildcards (* and % trigger a LIKE)
371      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
372      *
373      * @return MediumQuery The current query, for fluid interface
374      */
375     public function filterByTitel($titel = null, $comparison = null)
376     {
377         if (null === $comparison) {
378             if (is_array($titel)) {
379                 $comparison = Criteria::IN;
380             } elseif (preg_match('/[\%\*]/', $titel)) {
381                 $titel = str_replace('*', '%', $titel);
382                 $comparison = Criteria::LIKE;
383             }
384         }
385
386         return $this->addUsingAlias(MediumPeer::TITEL, $titel, $comparison);
387     }
388
389     /**
390      * Filter the query on the eigentumer column
391      *
392      * Example usage:
393      * <code>
394      * $query->filterByEigentumer('fooValue');   // WHERE eigentumer = 'fooValue'
395      * $query->filterByEigentumer('%fooValue%'); // WHERE eigentumer LIKE '%fooValue%'
396      * </code>
397      *
398      * @param     string $eigentumer The value to use as filter.
399      *              Accepts wildcards (* and % trigger a LIKE)
400      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
401      *
402      * @return MediumQuery The current query, for fluid interface
403      */
404     public function filterByEigentumer($eigentumer = null, $comparison = null)
405     {
406         if (null === $comparison) {
407             if (is_array($eigentumer)) {
408                 $comparison = Criteria::IN;
409             } elseif (preg_match('/[\%\*]/', $eigentumer)) {
410                 $eigentumer = str_replace('*', '%', $eigentumer);
411                 $comparison = Criteria::LIKE;
412             }
413         }
414
415         return $this->addUsingAlias(MediumPeer::EIGENTUMER, $eigentumer, $comparison);
416     }
417
418     /**
419      * Filter the query on the zz_bei column
420      *
421      * Example usage:
422      * <code>
423      * $query->filterByZzBei('fooValue');   // WHERE zz_bei = 'fooValue'
424      * $query->filterByZzBei('%fooValue%'); // WHERE zz_bei LIKE '%fooValue%'
425      * </code>
426      *
427      * @param     string $zzBei The value to use as filter.
428      *              Accepts wildcards (* and % trigger a LIKE)
429      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
430      *
431      * @return MediumQuery The current query, for fluid interface
432      */
433     public function filterByZzBei($zzBei = null, $comparison = null)
434     {
435         if (null === $comparison) {
436             if (is_array($zzBei)) {
437                 $comparison = Criteria::IN;
438             } elseif (preg_match('/[\%\*]/', $zzBei)) {
439                 $zzBei = str_replace('*', '%', $zzBei);
440                 $comparison = Criteria::LIKE;
441             }
442         }
443
444         return $this->addUsingAlias(MediumPeer::ZZ_BEI, $zzBei, $comparison);
445     }
446
447     /**
448      * Filter the query on the kommentar column
449      *
450      * Example usage:
451      * <code>
452      * $query->filterByKommentar('fooValue');   // WHERE kommentar = 'fooValue'
453      * $query->filterByKommentar('%fooValue%'); // WHERE kommentar LIKE '%fooValue%'
454      * </code>
455      *
456      * @param     string $kommentar The value to use as filter.
457      *              Accepts wildcards (* and % trigger a LIKE)
458      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
459      *
460      * @return MediumQuery The current query, for fluid interface
461      */
462     public function filterByKommentar($kommentar = null, $comparison = null)
463     {
464         if (null === $comparison) {
465             if (is_array($kommentar)) {
466                 $comparison = Criteria::IN;
467             } elseif (preg_match('/[\%\*]/', $kommentar)) {
468                 $kommentar = str_replace('*', '%', $kommentar);
469                 $comparison = Criteria::LIKE;
470             }
471         }
472
473         return $this->addUsingAlias(MediumPeer::KOMMENTAR, $kommentar, $comparison);
474     }
475
476     /**
477      * Filter the query on the class_key column
478      *
479      * Example usage:
480      * <code>
481      * $query->filterByClassKey(1234); // WHERE class_key = 1234
482      * $query->filterByClassKey(array(12, 34)); // WHERE class_key IN (12, 34)
483      * $query->filterByClassKey(array('min' => 12)); // WHERE class_key >= 12
484      * $query->filterByClassKey(array('max' => 12)); // WHERE class_key <= 12
485      * </code>
486      *
487      * @param     mixed $classKey The value to use as filter.
488      *              Use scalar values for equality.
489      *              Use array values for in_array() equivalent.
490      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
491      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
492      *
493      * @return MediumQuery The current query, for fluid interface
494      */
495     public function filterByClassKey($classKey = null, $comparison = null)
496     {
497         if (is_array($classKey)) {
498             $useMinMax = false;
499             if (isset($classKey['min'])) {
500                 $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey['min'], Criteria::GREATER_EQUAL);
501                 $useMinMax = true;
502             }
503             if (isset($classKey['max'])) {
504                 $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey['max'], Criteria::LESS_EQUAL);
505                 $useMinMax = true;
506             }
507             if ($useMinMax) {
508                 return $this;
509             }
510             if (null === $comparison) {
511                 $comparison = Criteria::IN;
512             }
513         }
514
515         return $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey, $comparison);
516     }
517
518     /**
519      * Exclude object from result
520      *
521      * @param   Medium $medium Object to remove from the list of results
522      *
523      * @return MediumQuery The current query, for fluid interface
524      */
525     public function prune($medium = null)
526     {
527         if ($medium) {
528             $this->addUsingAlias(MediumPeer::ID, $medium->getId(), Criteria::NOT_EQUAL);
529         }
530
531         return $this;
532     }
533
534 }