]> wagnertech.de Git - projects.git/blob - verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseKrimiQuery.php
eclipse-cpp added
[projects.git] / verleihnix / Verleihnix / impl / data / build / classes / propel / om / BaseKrimiQuery.php
1 <?php
2
3
4 /**
5  * Skeleton subclass for representing a query for one of the subclasses of the 'medium' table.
6  *
7  *
8  *
9  * You should add additional methods to this class to meet the
10  * application requirements.  This class will only be generated as
11  * long as it does not already exist in the output directory.
12  *
13  * @package    propel.generator.propel.om
14  */
15 class BaseKrimiQuery extends MediumQuery {
16
17     /**
18      * Returns a new KrimiQuery object.
19      *
20      * @param     string $modelAlias The alias of a model in the query
21      * @param     Criteria $criteria Optional Criteria to build the query from
22      *
23      * @return KrimiQuery
24      */
25     public static function create($modelAlias = null, $criteria = null)
26     {
27         if ($criteria instanceof KrimiQuery) {
28             return $criteria;
29         }
30         $query = new KrimiQuery();
31         if (null !== $modelAlias) {
32             $query->setModelAlias($modelAlias);
33         }
34         if ($criteria instanceof Criteria) {
35             $query->mergeWith($criteria);
36         }
37
38         return $query;
39     }
40
41     /**
42      * Filters the query to target only Krimi objects.
43      */
44     public function preSelect(PropelPDO $con)
45     {
46         $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1);
47     }
48
49     /**
50      * Filters the query to target only Krimi objects.
51      */
52     public function preUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
53     {
54         $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1);
55     }
56
57     /**
58      * Filters the query to target only Krimi objects.
59      */
60     public function preDelete(PropelPDO $con)
61     {
62         $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1);
63     }
64
65     /**
66      * Issue a DELETE query based on the current ModelCriteria deleting all rows in the table
67      * Having the Krimi class.
68      * This method is called by ModelCriteria::deleteAll() inside a transaction
69      *
70      * @param PropelPDO $con a connection object
71      *
72      * @return integer the number of deleted rows
73      */
74     public function doDeleteAll($con)
75     {
76         // condition on class key is already added in preDelete()
77         return parent::doDelete($con);
78     }
79
80
81     /**
82      * Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria
83      * and format the result with the current formatter
84      * By default, returns a model object
85      *
86      * @param PropelPDO $con an optional connection object
87      *
88      * @return mixed the result, formatted by the current formatter
89      *
90      * @throws PropelException
91      */
92     public function findOneOrCreate($con = null)
93     {
94         if ($this->joins) {
95             throw new PropelException('findOneOrCreate() cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.');
96         }
97         if (!$ret = $this->findOne($con)) {
98             $class = MediumPeer::CLASSNAME_1;
99             $obj = new $class;
100             foreach ($this->keys() as $key) {
101                 $obj->setByName($key, $this->getValue($key), BasePeer::TYPE_COLNAME);
102             }
103             $ret = $this->getFormatter()->formatRecord($obj);
104         }
105
106         return $ret;
107     }
108
109 } // BaseKrimiQuery