Completed
Pull Request — master (#288)
by
unknown
03:49
created

GamecurrencyQuery::findPkComplex()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 2
1
<?php
2
3
namespace eXpansion\Framework\PlayersBundle\Model\Base;
4
5
use \Exception;
6
use \PDO;
7
use Propel\Runtime\Propel;
8
use Propel\Runtime\ActiveQuery\Criteria;
9
use Propel\Runtime\ActiveQuery\ModelCriteria;
10
use Propel\Runtime\Collection\ObjectCollection;
11
use Propel\Runtime\Connection\ConnectionInterface;
12
use Propel\Runtime\Exception\PropelException;
13
use eXpansion\Framework\PlayersBundle\Model\Gamecurrency as ChildGamecurrency;
14
use eXpansion\Framework\PlayersBundle\Model\GamecurrencyQuery as ChildGamecurrencyQuery;
15
use eXpansion\Framework\PlayersBundle\Model\Map\GamecurrencyTableMap;
16
17
/**
18
 * Base class that represents a query for the 'gamecurrency' table.
19
 *
20
 *
21
 *
22
 * @method     ChildGamecurrencyQuery orderById($order = Criteria::ASC) Order by the id column
23
 * @method     ChildGamecurrencyQuery orderBySenderlogin($order = Criteria::ASC) Order by the senderLogin column
24
 * @method     ChildGamecurrencyQuery orderByReceiverlogin($order = Criteria::ASC) Order by the receiverLogin column
25
 * @method     ChildGamecurrencyQuery orderByTransactionid($order = Criteria::ASC) Order by the transactionId column
26
 * @method     ChildGamecurrencyQuery orderByBillid($order = Criteria::ASC) Order by the billId column
27
 * @method     ChildGamecurrencyQuery orderByAmount($order = Criteria::ASC) Order by the amount column
28
 * @method     ChildGamecurrencyQuery orderByMessage($order = Criteria::ASC) Order by the message column
29
 * @method     ChildGamecurrencyQuery orderByStatus($order = Criteria::ASC) Order by the status column
30
 * @method     ChildGamecurrencyQuery orderByDatetime($order = Criteria::ASC) Order by the datetime column
31
 *
32
 * @method     ChildGamecurrencyQuery groupById() Group by the id column
33
 * @method     ChildGamecurrencyQuery groupBySenderlogin() Group by the senderLogin column
34
 * @method     ChildGamecurrencyQuery groupByReceiverlogin() Group by the receiverLogin column
35
 * @method     ChildGamecurrencyQuery groupByTransactionid() Group by the transactionId column
36
 * @method     ChildGamecurrencyQuery groupByBillid() Group by the billId column
37
 * @method     ChildGamecurrencyQuery groupByAmount() Group by the amount column
38
 * @method     ChildGamecurrencyQuery groupByMessage() Group by the message column
39
 * @method     ChildGamecurrencyQuery groupByStatus() Group by the status column
40
 * @method     ChildGamecurrencyQuery groupByDatetime() Group by the datetime column
41
 *
42
 * @method     ChildGamecurrencyQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
43
 * @method     ChildGamecurrencyQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
44
 * @method     ChildGamecurrencyQuery innerJoin($relation) Adds a INNER JOIN clause to the query
45
 *
46
 * @method     ChildGamecurrencyQuery leftJoinWith($relation) Adds a LEFT JOIN clause and with to the query
47
 * @method     ChildGamecurrencyQuery rightJoinWith($relation) Adds a RIGHT JOIN clause and with to the query
48
 * @method     ChildGamecurrencyQuery innerJoinWith($relation) Adds a INNER JOIN clause and with to the query
49
 *
50
 * @method     ChildGamecurrency findOne(ConnectionInterface $con = null) Return the first ChildGamecurrency matching the query
51
 * @method     ChildGamecurrency findOneOrCreate(ConnectionInterface $con = null) Return the first ChildGamecurrency matching the query, or a new ChildGamecurrency object populated from the query conditions when no match is found
52
 *
53
 * @method     ChildGamecurrency findOneById(int $id) Return the first ChildGamecurrency filtered by the id column
54
 * @method     ChildGamecurrency findOneBySenderlogin(string $senderLogin) Return the first ChildGamecurrency filtered by the senderLogin column
55
 * @method     ChildGamecurrency findOneByReceiverlogin(string $receiverLogin) Return the first ChildGamecurrency filtered by the receiverLogin column
56
 * @method     ChildGamecurrency findOneByTransactionid(int $transactionId) Return the first ChildGamecurrency filtered by the transactionId column
57
 * @method     ChildGamecurrency findOneByBillid(int $billId) Return the first ChildGamecurrency filtered by the billId column
58
 * @method     ChildGamecurrency findOneByAmount(int $amount) Return the first ChildGamecurrency filtered by the amount column
59
 * @method     ChildGamecurrency findOneByMessage(string $message) Return the first ChildGamecurrency filtered by the message column
60
 * @method     ChildGamecurrency findOneByStatus(int $status) Return the first ChildGamecurrency filtered by the status column
61
 * @method     ChildGamecurrency findOneByDatetime(string $datetime) Return the first ChildGamecurrency filtered by the datetime column *
62
63
 * @method     ChildGamecurrency requirePk($key, ConnectionInterface $con = null) Return the ChildGamecurrency by primary key and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
64
 * @method     ChildGamecurrency requireOne(ConnectionInterface $con = null) Return the first ChildGamecurrency matching the query and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
65
 *
66
 * @method     ChildGamecurrency requireOneById(int $id) Return the first ChildGamecurrency filtered by the id column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
67
 * @method     ChildGamecurrency requireOneBySenderlogin(string $senderLogin) Return the first ChildGamecurrency filtered by the senderLogin column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
68
 * @method     ChildGamecurrency requireOneByReceiverlogin(string $receiverLogin) Return the first ChildGamecurrency filtered by the receiverLogin column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
69
 * @method     ChildGamecurrency requireOneByTransactionid(int $transactionId) Return the first ChildGamecurrency filtered by the transactionId column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
70
 * @method     ChildGamecurrency requireOneByBillid(int $billId) Return the first ChildGamecurrency filtered by the billId column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
71
 * @method     ChildGamecurrency requireOneByAmount(int $amount) Return the first ChildGamecurrency filtered by the amount column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
72
 * @method     ChildGamecurrency requireOneByMessage(string $message) Return the first ChildGamecurrency filtered by the message column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
73
 * @method     ChildGamecurrency requireOneByStatus(int $status) Return the first ChildGamecurrency filtered by the status column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
74
 * @method     ChildGamecurrency requireOneByDatetime(string $datetime) Return the first ChildGamecurrency filtered by the datetime column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
75
 *
76
 * @method     ChildGamecurrency[]|ObjectCollection find(ConnectionInterface $con = null) Return ChildGamecurrency objects based on current ModelCriteria
77
 * @method     ChildGamecurrency[]|ObjectCollection findById(int $id) Return ChildGamecurrency objects filtered by the id column
78
 * @method     ChildGamecurrency[]|ObjectCollection findBySenderlogin(string $senderLogin) Return ChildGamecurrency objects filtered by the senderLogin column
79
 * @method     ChildGamecurrency[]|ObjectCollection findByReceiverlogin(string $receiverLogin) Return ChildGamecurrency objects filtered by the receiverLogin column
80
 * @method     ChildGamecurrency[]|ObjectCollection findByTransactionid(int $transactionId) Return ChildGamecurrency objects filtered by the transactionId column
81
 * @method     ChildGamecurrency[]|ObjectCollection findByBillid(int $billId) Return ChildGamecurrency objects filtered by the billId column
82
 * @method     ChildGamecurrency[]|ObjectCollection findByAmount(int $amount) Return ChildGamecurrency objects filtered by the amount column
83
 * @method     ChildGamecurrency[]|ObjectCollection findByMessage(string $message) Return ChildGamecurrency objects filtered by the message column
84
 * @method     ChildGamecurrency[]|ObjectCollection findByStatus(int $status) Return ChildGamecurrency objects filtered by the status column
85
 * @method     ChildGamecurrency[]|ObjectCollection findByDatetime(string $datetime) Return ChildGamecurrency objects filtered by the datetime column
86
 * @method     ChildGamecurrency[]|\Propel\Runtime\Util\PropelModelPager paginate($page = 1, $maxPerPage = 10, ConnectionInterface $con = null) Issue a SELECT query based on the current ModelCriteria and uses a page and a maximum number of results per page to compute an offset and a limit
87
 *
88
 */
89
abstract class GamecurrencyQuery extends ModelCriteria
90
{
91
    protected $entityNotFoundExceptionClass = '\\Propel\\Runtime\\Exception\\EntityNotFoundException';
92
93
    /**
94
     * Initializes internal state of \eXpansion\Framework\PlayersBundle\Model\Base\GamecurrencyQuery object.
95
     *
96
     * @param     string $dbName The database name
97
     * @param     string $modelName The phpName of a model, e.g. 'Book'
98
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
99
     */
100
    public function __construct($dbName = 'expansion', $modelName = '\\eXpansion\\Framework\\PlayersBundle\\Model\\Gamecurrency', $modelAlias = null)
101
    {
102
        parent::__construct($dbName, $modelName, $modelAlias);
103
    }
104
105
    /**
106
     * Returns a new ChildGamecurrencyQuery object.
107
     *
108
     * @param     string $modelAlias The alias of a model in the query
109
     * @param     Criteria $criteria Optional Criteria to build the query from
110
     *
111
     * @return ChildGamecurrencyQuery
112
     */
113
    public static function create($modelAlias = null, Criteria $criteria = null)
114
    {
115
        if ($criteria instanceof ChildGamecurrencyQuery) {
116
            return $criteria;
117
        }
118
        $query = new ChildGamecurrencyQuery();
119
        if (null !== $modelAlias) {
120
            $query->setModelAlias($modelAlias);
121
        }
122
        if ($criteria instanceof Criteria) {
123
            $query->mergeWith($criteria);
124
        }
125
126
        return $query;
127
    }
128
129
    /**
130
     * Find object by primary key.
131
     * Propel uses the instance pool to skip the database if the object exists.
132
     * Go fast if the query is untouched.
133
     *
134
     * <code>
135
     * $obj  = $c->findPk(12, $con);
136
     * </code>
137
     *
138
     * @param mixed $key Primary key to use for the query
139
     * @param ConnectionInterface $con an optional connection object
140
     *
141
     * @return ChildGamecurrency|array|mixed the result, formatted by the current formatter
142
     */
143
    public function findPk($key, ConnectionInterface $con = null)
144
    {
145
        if ($key === null) {
146
            return null;
147
        }
148
149
        if ($con === null) {
150
            $con = Propel::getServiceContainer()->getReadConnection(GamecurrencyTableMap::DATABASE_NAME);
151
        }
152
153
        $this->basePreSelect($con);
154
155
        if (
156
            $this->formatter || $this->modelAlias || $this->with || $this->select
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->modelAlias of type string|null is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
Bug Best Practice introduced by
The expression $this->with of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
157
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->selectColumns of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
Bug Best Practice introduced by
The expression $this->asColumns of type string[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
Bug Best Practice introduced by
The expression $this->selectModifiers of type string[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
158
            || $this->map || $this->having || $this->joins
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->map of type Propel\Runtime\ActiveQue...ion\AbstractCriterion[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
Bug Best Practice introduced by
The expression $this->joins of type Propel\Runtime\ActiveQuery\Join[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
159
        ) {
160
            return $this->findPkComplex($key, $con);
161
        }
162
163
        if ((null !== ($obj = GamecurrencyTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {
164
            // the object is already in the instance pool
165
            return $obj;
166
        }
167
168
        return $this->findPkSimple($key, $con);
169
    }
170
171
    /**
172
     * Find object by primary key using raw SQL to go fast.
173
     * Bypass doSelect() and the object formatter by using generated code.
174
     *
175
     * @param     mixed $key Primary key to use for the query
176
     * @param     ConnectionInterface $con A connection object
177
     *
178
     * @throws \Propel\Runtime\Exception\PropelException
179
     *
180
     * @return ChildGamecurrency A model object, or null if the key is not found
181
     */
182
    protected function findPkSimple($key, ConnectionInterface $con)
183
    {
184
        $sql = 'SELECT id, senderLogin, receiverLogin, transactionId, billId, amount, message, status, datetime FROM gamecurrency WHERE id = :p0';
185
        try {
186
            $stmt = $con->prepare($sql);
187
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
188
            $stmt->execute();
189
        } catch (Exception $e) {
190
            Propel::log($e->getMessage(), Propel::LOG_ERR);
191
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
192
        }
193
        $obj = null;
194
        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
195
            /** @var ChildGamecurrency $obj */
196
            $obj = new ChildGamecurrency();
197
            $obj->hydrate($row);
198
            GamecurrencyTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);
199
        }
200
        $stmt->closeCursor();
201
202
        return $obj;
203
    }
204
205
    /**
206
     * Find object by primary key.
207
     *
208
     * @param     mixed $key Primary key to use for the query
209
     * @param     ConnectionInterface $con A connection object
210
     *
211
     * @return ChildGamecurrency|array|mixed the result, formatted by the current formatter
212
     */
213
    protected function findPkComplex($key, ConnectionInterface $con)
214
    {
215
        // As the query uses a PK condition, no limit(1) is necessary.
216
        $criteria = $this->isKeepQuery() ? clone $this : $this;
217
        $dataFetcher = $criteria
218
            ->filterByPrimaryKey($key)
219
            ->doSelect($con);
220
221
        return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
222
    }
223
224
    /**
225
     * Find objects by primary key
226
     * <code>
227
     * $objs = $c->findPks(array(12, 56, 832), $con);
228
     * </code>
229
     * @param     array $keys Primary keys to use for the query
230
     * @param     ConnectionInterface $con an optional connection object
231
     *
232
     * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
233
     */
234
    public function findPks($keys, ConnectionInterface $con = null)
235
    {
236
        if (null === $con) {
237
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
238
        }
239
        $this->basePreSelect($con);
240
        $criteria = $this->isKeepQuery() ? clone $this : $this;
241
        $dataFetcher = $criteria
242
            ->filterByPrimaryKeys($keys)
243
            ->doSelect($con);
244
245
        return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
246
    }
247
248
    /**
249
     * Filter the query by primary key
250
     *
251
     * @param     mixed $key Primary key to use for the query
252
     *
253
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
254
     */
255
    public function filterByPrimaryKey($key)
256
    {
257
258
        return $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $key, Criteria::EQUAL);
259
    }
260
261
    /**
262
     * Filter the query by a list of primary keys
263
     *
264
     * @param     array $keys The list of primary key to use for the query
265
     *
266
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
267
     */
268
    public function filterByPrimaryKeys($keys)
269
    {
270
271
        return $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $keys, Criteria::IN);
272
    }
273
274
    /**
275
     * Filter the query on the id column
276
     *
277
     * Example usage:
278
     * <code>
279
     * $query->filterById(1234); // WHERE id = 1234
280
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
281
     * $query->filterById(array('min' => 12)); // WHERE id > 12
282
     * </code>
283
     *
284
     * @param     mixed $id The value to use as filter.
285
     *              Use scalar values for equality.
286
     *              Use array values for in_array() equivalent.
287
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
288
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
289
     *
290
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
291
     */
292 View Code Duplication
    public function filterById($id = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
293
    {
294
        if (is_array($id)) {
295
            $useMinMax = false;
296
            if (isset($id['min'])) {
297
                $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);
298
                $useMinMax = true;
299
            }
300
            if (isset($id['max'])) {
301
                $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);
302
                $useMinMax = true;
303
            }
304
            if ($useMinMax) {
305
                return $this;
306
            }
307
            if (null === $comparison) {
308
                $comparison = Criteria::IN;
309
            }
310
        }
311
312
        return $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $id, $comparison);
313
    }
314
315
    /**
316
     * Filter the query on the senderLogin column
317
     *
318
     * Example usage:
319
     * <code>
320
     * $query->filterBySenderlogin('fooValue');   // WHERE senderLogin = 'fooValue'
321
     * $query->filterBySenderlogin('%fooValue%', Criteria::LIKE); // WHERE senderLogin LIKE '%fooValue%'
322
     * </code>
323
     *
324
     * @param     string $senderlogin The value to use as filter.
325
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
326
     *
327
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
328
     */
329 View Code Duplication
    public function filterBySenderlogin($senderlogin = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
330
    {
331
        if (null === $comparison) {
332
            if (is_array($senderlogin)) {
333
                $comparison = Criteria::IN;
334
            }
335
        }
336
337
        return $this->addUsingAlias(GamecurrencyTableMap::COL_SENDERLOGIN, $senderlogin, $comparison);
338
    }
339
340
    /**
341
     * Filter the query on the receiverLogin column
342
     *
343
     * Example usage:
344
     * <code>
345
     * $query->filterByReceiverlogin('fooValue');   // WHERE receiverLogin = 'fooValue'
346
     * $query->filterByReceiverlogin('%fooValue%', Criteria::LIKE); // WHERE receiverLogin LIKE '%fooValue%'
347
     * </code>
348
     *
349
     * @param     string $receiverlogin The value to use as filter.
350
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
351
     *
352
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
353
     */
354 View Code Duplication
    public function filterByReceiverlogin($receiverlogin = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
355
    {
356
        if (null === $comparison) {
357
            if (is_array($receiverlogin)) {
358
                $comparison = Criteria::IN;
359
            }
360
        }
361
362
        return $this->addUsingAlias(GamecurrencyTableMap::COL_RECEIVERLOGIN, $receiverlogin, $comparison);
363
    }
364
365
    /**
366
     * Filter the query on the transactionId column
367
     *
368
     * Example usage:
369
     * <code>
370
     * $query->filterByTransactionid(1234); // WHERE transactionId = 1234
371
     * $query->filterByTransactionid(array(12, 34)); // WHERE transactionId IN (12, 34)
372
     * $query->filterByTransactionid(array('min' => 12)); // WHERE transactionId > 12
373
     * </code>
374
     *
375
     * @param     mixed $transactionid The value to use as filter.
376
     *              Use scalar values for equality.
377
     *              Use array values for in_array() equivalent.
378
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
379
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
380
     *
381
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
382
     */
383 View Code Duplication
    public function filterByTransactionid($transactionid = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
384
    {
385
        if (is_array($transactionid)) {
386
            $useMinMax = false;
387
            if (isset($transactionid['min'])) {
388
                $this->addUsingAlias(GamecurrencyTableMap::COL_TRANSACTIONID, $transactionid['min'], Criteria::GREATER_EQUAL);
389
                $useMinMax = true;
390
            }
391
            if (isset($transactionid['max'])) {
392
                $this->addUsingAlias(GamecurrencyTableMap::COL_TRANSACTIONID, $transactionid['max'], Criteria::LESS_EQUAL);
393
                $useMinMax = true;
394
            }
395
            if ($useMinMax) {
396
                return $this;
397
            }
398
            if (null === $comparison) {
399
                $comparison = Criteria::IN;
400
            }
401
        }
402
403
        return $this->addUsingAlias(GamecurrencyTableMap::COL_TRANSACTIONID, $transactionid, $comparison);
404
    }
405
406
    /**
407
     * Filter the query on the billId column
408
     *
409
     * Example usage:
410
     * <code>
411
     * $query->filterByBillid(1234); // WHERE billId = 1234
412
     * $query->filterByBillid(array(12, 34)); // WHERE billId IN (12, 34)
413
     * $query->filterByBillid(array('min' => 12)); // WHERE billId > 12
414
     * </code>
415
     *
416
     * @param     mixed $billid The value to use as filter.
417
     *              Use scalar values for equality.
418
     *              Use array values for in_array() equivalent.
419
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
420
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
421
     *
422
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
423
     */
424 View Code Duplication
    public function filterByBillid($billid = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
425
    {
426
        if (is_array($billid)) {
427
            $useMinMax = false;
428
            if (isset($billid['min'])) {
429
                $this->addUsingAlias(GamecurrencyTableMap::COL_BILLID, $billid['min'], Criteria::GREATER_EQUAL);
430
                $useMinMax = true;
431
            }
432
            if (isset($billid['max'])) {
433
                $this->addUsingAlias(GamecurrencyTableMap::COL_BILLID, $billid['max'], Criteria::LESS_EQUAL);
434
                $useMinMax = true;
435
            }
436
            if ($useMinMax) {
437
                return $this;
438
            }
439
            if (null === $comparison) {
440
                $comparison = Criteria::IN;
441
            }
442
        }
443
444
        return $this->addUsingAlias(GamecurrencyTableMap::COL_BILLID, $billid, $comparison);
445
    }
446
447
    /**
448
     * Filter the query on the amount column
449
     *
450
     * Example usage:
451
     * <code>
452
     * $query->filterByAmount(1234); // WHERE amount = 1234
453
     * $query->filterByAmount(array(12, 34)); // WHERE amount IN (12, 34)
454
     * $query->filterByAmount(array('min' => 12)); // WHERE amount > 12
455
     * </code>
456
     *
457
     * @param     mixed $amount The value to use as filter.
458
     *              Use scalar values for equality.
459
     *              Use array values for in_array() equivalent.
460
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
461
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
462
     *
463
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
464
     */
465 View Code Duplication
    public function filterByAmount($amount = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
466
    {
467
        if (is_array($amount)) {
468
            $useMinMax = false;
469
            if (isset($amount['min'])) {
470
                $this->addUsingAlias(GamecurrencyTableMap::COL_AMOUNT, $amount['min'], Criteria::GREATER_EQUAL);
471
                $useMinMax = true;
472
            }
473
            if (isset($amount['max'])) {
474
                $this->addUsingAlias(GamecurrencyTableMap::COL_AMOUNT, $amount['max'], Criteria::LESS_EQUAL);
475
                $useMinMax = true;
476
            }
477
            if ($useMinMax) {
478
                return $this;
479
            }
480
            if (null === $comparison) {
481
                $comparison = Criteria::IN;
482
            }
483
        }
484
485
        return $this->addUsingAlias(GamecurrencyTableMap::COL_AMOUNT, $amount, $comparison);
486
    }
487
488
    /**
489
     * Filter the query on the message column
490
     *
491
     * Example usage:
492
     * <code>
493
     * $query->filterByMessage('fooValue');   // WHERE message = 'fooValue'
494
     * $query->filterByMessage('%fooValue%', Criteria::LIKE); // WHERE message LIKE '%fooValue%'
495
     * </code>
496
     *
497
     * @param     string $message The value to use as filter.
498
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
499
     *
500
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
501
     */
502 View Code Duplication
    public function filterByMessage($message = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
503
    {
504
        if (null === $comparison) {
505
            if (is_array($message)) {
506
                $comparison = Criteria::IN;
507
            }
508
        }
509
510
        return $this->addUsingAlias(GamecurrencyTableMap::COL_MESSAGE, $message, $comparison);
511
    }
512
513
    /**
514
     * Filter the query on the status column
515
     *
516
     * Example usage:
517
     * <code>
518
     * $query->filterByStatus(1234); // WHERE status = 1234
519
     * $query->filterByStatus(array(12, 34)); // WHERE status IN (12, 34)
520
     * $query->filterByStatus(array('min' => 12)); // WHERE status > 12
521
     * </code>
522
     *
523
     * @param     mixed $status The value to use as filter.
524
     *              Use scalar values for equality.
525
     *              Use array values for in_array() equivalent.
526
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
527
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
528
     *
529
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
530
     */
531 View Code Duplication
    public function filterByStatus($status = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
532
    {
533
        if (is_array($status)) {
534
            $useMinMax = false;
535
            if (isset($status['min'])) {
536
                $this->addUsingAlias(GamecurrencyTableMap::COL_STATUS, $status['min'], Criteria::GREATER_EQUAL);
537
                $useMinMax = true;
538
            }
539
            if (isset($status['max'])) {
540
                $this->addUsingAlias(GamecurrencyTableMap::COL_STATUS, $status['max'], Criteria::LESS_EQUAL);
541
                $useMinMax = true;
542
            }
543
            if ($useMinMax) {
544
                return $this;
545
            }
546
            if (null === $comparison) {
547
                $comparison = Criteria::IN;
548
            }
549
        }
550
551
        return $this->addUsingAlias(GamecurrencyTableMap::COL_STATUS, $status, $comparison);
552
    }
553
554
    /**
555
     * Filter the query on the datetime column
556
     *
557
     * Example usage:
558
     * <code>
559
     * $query->filterByDatetime('2011-03-14'); // WHERE datetime = '2011-03-14'
560
     * $query->filterByDatetime('now'); // WHERE datetime = '2011-03-14'
561
     * $query->filterByDatetime(array('max' => 'yesterday')); // WHERE datetime > '2011-03-13'
562
     * </code>
563
     *
564
     * @param     mixed $datetime The value to use as filter.
565
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
566
     *              Empty strings are treated as NULL.
567
     *              Use scalar values for equality.
568
     *              Use array values for in_array() equivalent.
569
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
570
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
571
     *
572
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
573
     */
574 View Code Duplication
    public function filterByDatetime($datetime = null, $comparison = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
575
    {
576
        if (is_array($datetime)) {
577
            $useMinMax = false;
578
            if (isset($datetime['min'])) {
579
                $this->addUsingAlias(GamecurrencyTableMap::COL_DATETIME, $datetime['min'], Criteria::GREATER_EQUAL);
580
                $useMinMax = true;
581
            }
582
            if (isset($datetime['max'])) {
583
                $this->addUsingAlias(GamecurrencyTableMap::COL_DATETIME, $datetime['max'], Criteria::LESS_EQUAL);
584
                $useMinMax = true;
585
            }
586
            if ($useMinMax) {
587
                return $this;
588
            }
589
            if (null === $comparison) {
590
                $comparison = Criteria::IN;
591
            }
592
        }
593
594
        return $this->addUsingAlias(GamecurrencyTableMap::COL_DATETIME, $datetime, $comparison);
595
    }
596
597
    /**
598
     * Exclude object from result
599
     *
600
     * @param   ChildGamecurrency $gamecurrency Object to remove from the list of results
601
     *
602
     * @return $this|ChildGamecurrencyQuery The current query, for fluid interface
603
     */
604
    public function prune($gamecurrency = null)
605
    {
606
        if ($gamecurrency) {
607
            $this->addUsingAlias(GamecurrencyTableMap::COL_ID, $gamecurrency->getId(), Criteria::NOT_EQUAL);
608
        }
609
610
        return $this;
611
    }
612
613
    /**
614
     * Deletes all rows from the gamecurrency table.
615
     *
616
     * @param ConnectionInterface $con the connection to use
617
     * @return int The number of affected rows (if supported by underlying database driver).
618
     */
619
    public function doDeleteAll(ConnectionInterface $con = null)
620
    {
621
        if (null === $con) {
622
            $con = Propel::getServiceContainer()->getWriteConnection(GamecurrencyTableMap::DATABASE_NAME);
623
        }
624
625
        // use transaction because $criteria could contain info
626
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
627
        return $con->transaction(function () use ($con) {
628
            $affectedRows = 0; // initialize var to track total num of affected rows
629
            $affectedRows += parent::doDeleteAll($con);
630
            // Because this db requires some delete cascade/set null emulation, we have to
631
            // clear the cached instance *after* the emulation has happened (since
632
            // instances get re-added by the select statement contained therein).
633
            GamecurrencyTableMap::clearInstancePool();
634
            GamecurrencyTableMap::clearRelatedInstancePool();
635
636
            return $affectedRows;
637
        });
638
    }
639
640
    /**
641
     * Performs a DELETE on the database based on the current ModelCriteria
642
     *
643
     * @param ConnectionInterface $con the connection to use
644
     * @return int             The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
645
     *                         if supported by native driver or if emulated using Propel.
646
     * @throws PropelException Any exceptions caught during processing will be
647
     *                         rethrown wrapped into a PropelException.
648
     */
649
    public function delete(ConnectionInterface $con = null)
650
    {
651
        if (null === $con) {
652
            $con = Propel::getServiceContainer()->getWriteConnection(GamecurrencyTableMap::DATABASE_NAME);
653
        }
654
655
        $criteria = $this;
656
657
        // Set the correct dbName
658
        $criteria->setDbName(GamecurrencyTableMap::DATABASE_NAME);
659
660
        // use transaction because $criteria could contain info
661
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
662
        return $con->transaction(function () use ($con, $criteria) {
663
            $affectedRows = 0; // initialize var to track total num of affected rows
664
665
            GamecurrencyTableMap::removeInstanceFromPool($criteria);
666
667
            $affectedRows += ModelCriteria::delete($con);
668
            GamecurrencyTableMap::clearRelatedInstancePool();
669
670
            return $affectedRows;
671
        });
672
    }
673
674
} // GamecurrencyQuery
675