BannerImageQuery::filterByActiveTo()   B
last analyzed

Complexity

Conditions 6
Paths 13

Size

Total Lines 22

Duplication

Lines 22
Ratio 100 %

Importance

Changes 0
Metric Value
cc 6
nc 13
nop 2
dl 22
loc 22
rs 8.9457
c 0
b 0
f 0
1
<?php
2
3
namespace xbanners\models\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\ActiveQuery\ModelJoin;
11
use Propel\Runtime\Collection\ObjectCollection;
12
use Propel\Runtime\Connection\ConnectionInterface;
13
use Propel\Runtime\Exception\PropelException;
14
use xbanners\models\BannerImage as ChildBannerImage;
15
use xbanners\models\BannerImageI18nQuery as ChildBannerImageI18nQuery;
16
use xbanners\models\BannerImageQuery as ChildBannerImageQuery;
17
use xbanners\models\Map\BannerImageI18nTableMap;
18
use xbanners\models\Map\BannerImageTableMap;
19
20
/**
21
 * Base class that represents a query for the 'banner_image' table.
22
 *
23
 *
24
 *
25
 * @method     ChildBannerImageQuery orderById($order = Criteria::ASC) Order by the id column
26
 * @method     ChildBannerImageQuery orderByBannerId($order = Criteria::ASC) Order by the banner_id column
27
 * @method     ChildBannerImageQuery orderByTarget($order = Criteria::ASC) Order by the target column
28
 * @method     ChildBannerImageQuery orderByUrl($order = Criteria::ASC) Order by the url column
29
 * @method     ChildBannerImageQuery orderByAllowedPage($order = Criteria::ASC) Order by the allowed_page column
30
 * @method     ChildBannerImageQuery orderByPosition($order = Criteria::ASC) Order by the position column
31
 * @method     ChildBannerImageQuery orderByActiveFrom($order = Criteria::ASC) Order by the active_from column
32
 * @method     ChildBannerImageQuery orderByActiveTo($order = Criteria::ASC) Order by the active_to column
33
 * @method     ChildBannerImageQuery orderByActive($order = Criteria::ASC) Order by the active column
34
 * @method     ChildBannerImageQuery orderByPermanent($order = Criteria::ASC) Order by the permanent column
35
 *
36
 * @method     ChildBannerImageQuery groupById() Group by the id column
37
 * @method     ChildBannerImageQuery groupByBannerId() Group by the banner_id column
38
 * @method     ChildBannerImageQuery groupByTarget() Group by the target column
39
 * @method     ChildBannerImageQuery groupByUrl() Group by the url column
40
 * @method     ChildBannerImageQuery groupByAllowedPage() Group by the allowed_page column
41
 * @method     ChildBannerImageQuery groupByPosition() Group by the position column
42
 * @method     ChildBannerImageQuery groupByActiveFrom() Group by the active_from column
43
 * @method     ChildBannerImageQuery groupByActiveTo() Group by the active_to column
44
 * @method     ChildBannerImageQuery groupByActive() Group by the active column
45
 * @method     ChildBannerImageQuery groupByPermanent() Group by the permanent column
46
 *
47
 * @method     ChildBannerImageQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
48
 * @method     ChildBannerImageQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
49
 * @method     ChildBannerImageQuery innerJoin($relation) Adds a INNER JOIN clause to the query
50
 *
51
 * @method     ChildBannerImageQuery leftJoinWith($relation) Adds a LEFT JOIN clause and with to the query
52
 * @method     ChildBannerImageQuery rightJoinWith($relation) Adds a RIGHT JOIN clause and with to the query
53
 * @method     ChildBannerImageQuery innerJoinWith($relation) Adds a INNER JOIN clause and with to the query
54
 *
55
 * @method     ChildBannerImageQuery leftJoinBanners($relationAlias = null) Adds a LEFT JOIN clause to the query using the Banners relation
56
 * @method     ChildBannerImageQuery rightJoinBanners($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Banners relation
57
 * @method     ChildBannerImageQuery innerJoinBanners($relationAlias = null) Adds a INNER JOIN clause to the query using the Banners relation
58
 *
59
 * @method     ChildBannerImageQuery joinWithBanners($joinType = Criteria::INNER_JOIN) Adds a join clause and with to the query using the Banners relation
60
 *
61
 * @method     ChildBannerImageQuery leftJoinWithBanners() Adds a LEFT JOIN clause and with to the query using the Banners relation
62
 * @method     ChildBannerImageQuery rightJoinWithBanners() Adds a RIGHT JOIN clause and with to the query using the Banners relation
63
 * @method     ChildBannerImageQuery innerJoinWithBanners() Adds a INNER JOIN clause and with to the query using the Banners relation
64
 *
65
 * @method     ChildBannerImageQuery leftJoinBannerImageI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the BannerImageI18n relation
66
 * @method     ChildBannerImageQuery rightJoinBannerImageI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BannerImageI18n relation
67
 * @method     ChildBannerImageQuery innerJoinBannerImageI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the BannerImageI18n relation
68
 *
69
 * @method     ChildBannerImageQuery joinWithBannerImageI18n($joinType = Criteria::INNER_JOIN) Adds a join clause and with to the query using the BannerImageI18n relation
70
 *
71
 * @method     ChildBannerImageQuery leftJoinWithBannerImageI18n() Adds a LEFT JOIN clause and with to the query using the BannerImageI18n relation
72
 * @method     ChildBannerImageQuery rightJoinWithBannerImageI18n() Adds a RIGHT JOIN clause and with to the query using the BannerImageI18n relation
73
 * @method     ChildBannerImageQuery innerJoinWithBannerImageI18n() Adds a INNER JOIN clause and with to the query using the BannerImageI18n relation
74
 *
75
 * @method     \xbanners\models\BannersQuery|\xbanners\models\BannerImageI18nQuery endUse() Finalizes a secondary criteria and merges it with its primary Criteria
76
 *
77
 * @method     ChildBannerImage findOne(ConnectionInterface $con = null) Return the first ChildBannerImage matching the query
78
 * @method     ChildBannerImage findOneOrCreate(ConnectionInterface $con = null) Return the first ChildBannerImage matching the query, or a new ChildBannerImage object populated from the query conditions when no match is found
79
 *
80
 * @method     ChildBannerImage findOneById(int $id) Return the first ChildBannerImage filtered by the id column
81
 * @method     ChildBannerImage findOneByBannerId(int $banner_id) Return the first ChildBannerImage filtered by the banner_id column
82
 * @method     ChildBannerImage findOneByTarget(int $target) Return the first ChildBannerImage filtered by the target column
83
 * @method     ChildBannerImage findOneByUrl(string $url) Return the first ChildBannerImage filtered by the url column
84
 * @method     ChildBannerImage findOneByAllowedPage(int $allowed_page) Return the first ChildBannerImage filtered by the allowed_page column
85
 * @method     ChildBannerImage findOneByPosition(int $position) Return the first ChildBannerImage filtered by the position column
86
 * @method     ChildBannerImage findOneByActiveFrom(int $active_from) Return the first ChildBannerImage filtered by the active_from column
87
 * @method     ChildBannerImage findOneByActiveTo(int $active_to) Return the first ChildBannerImage filtered by the active_to column
88
 * @method     ChildBannerImage findOneByActive(int $active) Return the first ChildBannerImage filtered by the active column
89
 * @method     ChildBannerImage findOneByPermanent(int $permanent) Return the first ChildBannerImage filtered by the permanent column *
90
91
 * @method     ChildBannerImage requirePk($key, ConnectionInterface $con = null) Return the ChildBannerImage by primary key and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
92
 * @method     ChildBannerImage requireOne(ConnectionInterface $con = null) Return the first ChildBannerImage matching the query and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
93
 *
94
 * @method     ChildBannerImage requireOneById(int $id) Return the first ChildBannerImage filtered by the id column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
95
 * @method     ChildBannerImage requireOneByBannerId(int $banner_id) Return the first ChildBannerImage filtered by the banner_id column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
96
 * @method     ChildBannerImage requireOneByTarget(int $target) Return the first ChildBannerImage filtered by the target column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
97
 * @method     ChildBannerImage requireOneByUrl(string $url) Return the first ChildBannerImage filtered by the url column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
98
 * @method     ChildBannerImage requireOneByAllowedPage(int $allowed_page) Return the first ChildBannerImage filtered by the allowed_page column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
99
 * @method     ChildBannerImage requireOneByPosition(int $position) Return the first ChildBannerImage filtered by the position column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
100
 * @method     ChildBannerImage requireOneByActiveFrom(int $active_from) Return the first ChildBannerImage filtered by the active_from column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
101
 * @method     ChildBannerImage requireOneByActiveTo(int $active_to) Return the first ChildBannerImage filtered by the active_to column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
102
 * @method     ChildBannerImage requireOneByActive(int $active) Return the first ChildBannerImage filtered by the active column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
103
 * @method     ChildBannerImage requireOneByPermanent(int $permanent) Return the first ChildBannerImage filtered by the permanent column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
104
 *
105
 * @method     ChildBannerImage[]|ObjectCollection find(ConnectionInterface $con = null) Return ChildBannerImage objects based on current ModelCriteria
106
 * @method     ChildBannerImage[]|ObjectCollection findById(int $id) Return ChildBannerImage objects filtered by the id column
107
 * @method     ChildBannerImage[]|ObjectCollection findByBannerId(int $banner_id) Return ChildBannerImage objects filtered by the banner_id column
108
 * @method     ChildBannerImage[]|ObjectCollection findByTarget(int $target) Return ChildBannerImage objects filtered by the target column
109
 * @method     ChildBannerImage[]|ObjectCollection findByUrl(string $url) Return ChildBannerImage objects filtered by the url column
110
 * @method     ChildBannerImage[]|ObjectCollection findByAllowedPage(int $allowed_page) Return ChildBannerImage objects filtered by the allowed_page column
111
 * @method     ChildBannerImage[]|ObjectCollection findByPosition(int $position) Return ChildBannerImage objects filtered by the position column
112
 * @method     ChildBannerImage[]|ObjectCollection findByActiveFrom(int $active_from) Return ChildBannerImage objects filtered by the active_from column
113
 * @method     ChildBannerImage[]|ObjectCollection findByActiveTo(int $active_to) Return ChildBannerImage objects filtered by the active_to column
114
 * @method     ChildBannerImage[]|ObjectCollection findByActive(int $active) Return ChildBannerImage objects filtered by the active column
115
 * @method     ChildBannerImage[]|ObjectCollection findByPermanent(int $permanent) Return ChildBannerImage objects filtered by the permanent column
116
 * @method     ChildBannerImage[]|\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
117
 *
118
 */
119
abstract class BannerImageQuery extends ModelCriteria
120
{
121
    protected $entityNotFoundExceptionClass = '\\Propel\\Runtime\\Exception\\EntityNotFoundException';
122
123
    /**
124
     * Initializes internal state of \xbanners\models\Base\BannerImageQuery object.
125
     *
126
     * @param     string $dbName The database name
127
     * @param     string $modelName The phpName of a model, e.g. 'Book'
128
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
129
     */
130
    public function __construct($dbName = 'Shop', $modelName = '\\xbanners\\models\\BannerImage', $modelAlias = null)
131
    {
132
        parent::__construct($dbName, $modelName, $modelAlias);
133
    }
134
135
    /**
136
     * Returns a new ChildBannerImageQuery object.
137
     *
138
     * @param     string $modelAlias The alias of a model in the query
139
     * @param     Criteria $criteria Optional Criteria to build the query from
140
     *
141
     * @return ChildBannerImageQuery
142
     */
143 View Code Duplication
    public static function create($modelAlias = null, Criteria $criteria = null)
144
    {
145
        if ($criteria instanceof ChildBannerImageQuery) {
146
            return $criteria;
147
        }
148
        $query = new ChildBannerImageQuery();
149
        if (null !== $modelAlias) {
150
            $query->setModelAlias($modelAlias);
151
        }
152
        if ($criteria instanceof Criteria) {
153
            $query->mergeWith($criteria);
154
        }
155
156
        return $query;
157
    }
158
159
    /**
160
     * Find object by primary key.
161
     * Propel uses the instance pool to skip the database if the object exists.
162
     * Go fast if the query is untouched.
163
     *
164
     * <code>
165
     * $obj  = $c->findPk(12, $con);
166
     * </code>
167
     *
168
     * @param mixed $key Primary key to use for the query
169
     * @param ConnectionInterface $con an optional connection object
170
     *
171
     * @return ChildBannerImage|array|mixed the result, formatted by the current formatter
172
     */
173 View Code Duplication
    public function findPk($key, ConnectionInterface $con = null)
174
    {
175
        if ($key === null) {
176
            return null;
177
        }
178
179
        if ($con === null) {
180
            $con = Propel::getServiceContainer()->getReadConnection(BannerImageTableMap::DATABASE_NAME);
181
        }
182
183
        $this->basePreSelect($con);
184
185
        if (
186
            $this->formatter || $this->modelAlias || $this->with || $this->select
187
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
188
            || $this->map || $this->having || $this->joins
189
        ) {
190
            return $this->findPkComplex($key, $con);
191
        }
192
193
        if ((null !== ($obj = BannerImageTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {
194
            // the object is already in the instance pool
195
            return $obj;
196
        }
197
198
        return $this->findPkSimple($key, $con);
199
    }
200
201
    /**
202
     * Find object by primary key using raw SQL to go fast.
203
     * Bypass doSelect() and the object formatter by using generated code.
204
     *
205
     * @param     mixed $key Primary key to use for the query
206
     * @param     ConnectionInterface $con A connection object
207
     *
208
     * @throws \Propel\Runtime\Exception\PropelException
209
     *
210
     * @return ChildBannerImage A model object, or null if the key is not found
0 ignored issues
show
Documentation introduced by
Should the return type not be ChildBannerImage|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
211
     */
212 View Code Duplication
    protected function findPkSimple($key, ConnectionInterface $con)
213
    {
214
        $sql = 'SELECT id, banner_id, target, url, allowed_page, position, active_from, active_to, active, permanent FROM banner_image WHERE id = :p0';
215
        try {
216
            $stmt = $con->prepare($sql);
217
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
218
            $stmt->execute();
219
        } catch (Exception $e) {
220
            Propel::log($e->getMessage(), Propel::LOG_ERR);
221
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
222
        }
223
        $obj = null;
224
        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
225
            /** @var ChildBannerImage $obj */
226
            $obj = new ChildBannerImage();
227
            $obj->hydrate($row);
228
            BannerImageTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key);
229
        }
230
        $stmt->closeCursor();
231
232
        return $obj;
233
    }
234
235
    /**
236
     * Find object by primary key.
237
     *
238
     * @param     mixed $key Primary key to use for the query
239
     * @param     ConnectionInterface $con A connection object
240
     *
241
     * @return ChildBannerImage|array|mixed the result, formatted by the current formatter
242
     */
243 View Code Duplication
    protected function findPkComplex($key, ConnectionInterface $con)
244
    {
245
        // As the query uses a PK condition, no limit(1) is necessary.
246
        $criteria = $this->isKeepQuery() ? clone $this : $this;
247
        $dataFetcher = $criteria
248
            ->filterByPrimaryKey($key)
249
            ->doSelect($con);
250
251
        return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
252
    }
253
254
    /**
255
     * Find objects by primary key
256
     * <code>
257
     * $objs = $c->findPks(array(12, 56, 832), $con);
258
     * </code>
259
     * @param     array $keys Primary keys to use for the query
260
     * @param     ConnectionInterface $con an optional connection object
261
     *
262
     * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
263
     */
264 View Code Duplication
    public function findPks($keys, ConnectionInterface $con = null)
265
    {
266
        if (null === $con) {
267
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
268
        }
269
        $this->basePreSelect($con);
270
        $criteria = $this->isKeepQuery() ? clone $this : $this;
271
        $dataFetcher = $criteria
272
            ->filterByPrimaryKeys($keys)
273
            ->doSelect($con);
274
275
        return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
276
    }
277
278
    /**
279
     * Filter the query by primary key
280
     *
281
     * @param     mixed $key Primary key to use for the query
282
     *
283
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
284
     */
285
    public function filterByPrimaryKey($key)
286
    {
287
288
        return $this->addUsingAlias(BannerImageTableMap::COL_ID, $key, Criteria::EQUAL);
289
    }
290
291
    /**
292
     * Filter the query by a list of primary keys
293
     *
294
     * @param     array $keys The list of primary key to use for the query
295
     *
296
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
297
     */
298
    public function filterByPrimaryKeys($keys)
299
    {
300
301
        return $this->addUsingAlias(BannerImageTableMap::COL_ID, $keys, Criteria::IN);
302
    }
303
304
    /**
305
     * Filter the query on the id column
306
     *
307
     * Example usage:
308
     * <code>
309
     * $query->filterById(1234); // WHERE id = 1234
310
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
311
     * $query->filterById(array('min' => 12)); // WHERE id > 12
312
     * </code>
313
     *
314
     * @param     mixed $id The value to use as filter.
315
     *              Use scalar values for equality.
316
     *              Use array values for in_array() equivalent.
317
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
318
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
319
     *
320
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
321
     */
322 View Code Duplication
    public function filterById($id = null, $comparison = null)
323
    {
324
        if (is_array($id)) {
325
            $useMinMax = false;
326
            if (isset($id['min'])) {
327
                $this->addUsingAlias(BannerImageTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);
328
                $useMinMax = true;
329
            }
330
            if (isset($id['max'])) {
331
                $this->addUsingAlias(BannerImageTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);
332
                $useMinMax = true;
333
            }
334
            if ($useMinMax) {
335
                return $this;
336
            }
337
            if (null === $comparison) {
338
                $comparison = Criteria::IN;
339
            }
340
        }
341
342
        return $this->addUsingAlias(BannerImageTableMap::COL_ID, $id, $comparison);
343
    }
344
345
    /**
346
     * Filter the query on the banner_id column
347
     *
348
     * Example usage:
349
     * <code>
350
     * $query->filterByBannerId(1234); // WHERE banner_id = 1234
351
     * $query->filterByBannerId(array(12, 34)); // WHERE banner_id IN (12, 34)
352
     * $query->filterByBannerId(array('min' => 12)); // WHERE banner_id > 12
353
     * </code>
354
     *
355
     * @see       filterByBanners()
356
     *
357
     * @param     mixed $bannerId The value to use as filter.
358
     *              Use scalar values for equality.
359
     *              Use array values for in_array() equivalent.
360
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
361
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
362
     *
363
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
364
     */
365 View Code Duplication
    public function filterByBannerId($bannerId = null, $comparison = null)
366
    {
367
        if (is_array($bannerId)) {
368
            $useMinMax = false;
369
            if (isset($bannerId['min'])) {
370
                $this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId['min'], Criteria::GREATER_EQUAL);
371
                $useMinMax = true;
372
            }
373
            if (isset($bannerId['max'])) {
374
                $this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId['max'], Criteria::LESS_EQUAL);
375
                $useMinMax = true;
376
            }
377
            if ($useMinMax) {
378
                return $this;
379
            }
380
            if (null === $comparison) {
381
                $comparison = Criteria::IN;
382
            }
383
        }
384
385
        return $this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId, $comparison);
386
    }
387
388
    /**
389
     * Filter the query on the target column
390
     *
391
     * Example usage:
392
     * <code>
393
     * $query->filterByTarget(1234); // WHERE target = 1234
394
     * $query->filterByTarget(array(12, 34)); // WHERE target IN (12, 34)
395
     * $query->filterByTarget(array('min' => 12)); // WHERE target > 12
396
     * </code>
397
     *
398
     * @param     mixed $target The value to use as filter.
399
     *              Use scalar values for equality.
400
     *              Use array values for in_array() equivalent.
401
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
402
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
403
     *
404
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
405
     */
406 View Code Duplication
    public function filterByTarget($target = null, $comparison = null)
407
    {
408
        if (is_array($target)) {
409
            $useMinMax = false;
410
            if (isset($target['min'])) {
411
                $this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target['min'], Criteria::GREATER_EQUAL);
412
                $useMinMax = true;
413
            }
414
            if (isset($target['max'])) {
415
                $this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target['max'], Criteria::LESS_EQUAL);
416
                $useMinMax = true;
417
            }
418
            if ($useMinMax) {
419
                return $this;
420
            }
421
            if (null === $comparison) {
422
                $comparison = Criteria::IN;
423
            }
424
        }
425
426
        return $this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target, $comparison);
427
    }
428
429
    /**
430
     * Filter the query on the url column
431
     *
432
     * Example usage:
433
     * <code>
434
     * $query->filterByUrl('fooValue');   // WHERE url = 'fooValue'
435
     * $query->filterByUrl('%fooValue%', Criteria::LIKE); // WHERE url LIKE '%fooValue%'
436
     * </code>
437
     *
438
     * @param     string $url The value to use as filter.
439
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
440
     *
441
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
442
     */
443 View Code Duplication
    public function filterByUrl($url = null, $comparison = null)
444
    {
445
        if (null === $comparison) {
446
            if (is_array($url)) {
447
                $comparison = Criteria::IN;
448
            }
449
        }
450
451
        return $this->addUsingAlias(BannerImageTableMap::COL_URL, $url, $comparison);
452
    }
453
454
    /**
455
     * Filter the query on the allowed_page column
456
     *
457
     * Example usage:
458
     * <code>
459
     * $query->filterByAllowedPage(1234); // WHERE allowed_page = 1234
460
     * $query->filterByAllowedPage(array(12, 34)); // WHERE allowed_page IN (12, 34)
461
     * $query->filterByAllowedPage(array('min' => 12)); // WHERE allowed_page > 12
462
     * </code>
463
     *
464
     * @param     mixed $allowedPage The value to use as filter.
465
     *              Use scalar values for equality.
466
     *              Use array values for in_array() equivalent.
467
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
468
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
469
     *
470
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
471
     */
472 View Code Duplication
    public function filterByAllowedPage($allowedPage = null, $comparison = null)
473
    {
474
        if (is_array($allowedPage)) {
475
            $useMinMax = false;
476
            if (isset($allowedPage['min'])) {
477
                $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['min'], Criteria::GREATER_EQUAL);
478
                $useMinMax = true;
479
            }
480
            if (isset($allowedPage['max'])) {
481
                $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['max'], Criteria::LESS_EQUAL);
482
                $useMinMax = true;
483
            }
484
            if ($useMinMax) {
485
                return $this;
486
            }
487
            if (null === $comparison) {
488
                $comparison = Criteria::IN;
489
            }
490
        }
491
492
        return $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage, $comparison);
493
    }
494
495
    /**
496
     * Filter the query on the position column
497
     *
498
     * Example usage:
499
     * <code>
500
     * $query->filterByPosition(1234); // WHERE position = 1234
501
     * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
502
     * $query->filterByPosition(array('min' => 12)); // WHERE position > 12
503
     * </code>
504
     *
505
     * @param     mixed $position The value to use as filter.
506
     *              Use scalar values for equality.
507
     *              Use array values for in_array() equivalent.
508
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
509
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
510
     *
511
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
512
     */
513 View Code Duplication
    public function filterByPosition($position = null, $comparison = null)
514
    {
515
        if (is_array($position)) {
516
            $useMinMax = false;
517
            if (isset($position['min'])) {
518
                $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['min'], Criteria::GREATER_EQUAL);
519
                $useMinMax = true;
520
            }
521
            if (isset($position['max'])) {
522
                $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['max'], Criteria::LESS_EQUAL);
523
                $useMinMax = true;
524
            }
525
            if ($useMinMax) {
526
                return $this;
527
            }
528
            if (null === $comparison) {
529
                $comparison = Criteria::IN;
530
            }
531
        }
532
533
        return $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position, $comparison);
534
    }
535
536
    /**
537
     * Filter the query on the active_from column
538
     *
539
     * Example usage:
540
     * <code>
541
     * $query->filterByActiveFrom(1234); // WHERE active_from = 1234
542
     * $query->filterByActiveFrom(array(12, 34)); // WHERE active_from IN (12, 34)
543
     * $query->filterByActiveFrom(array('min' => 12)); // WHERE active_from > 12
544
     * </code>
545
     *
546
     * @param     mixed $activeFrom The value to use as filter.
547
     *              Use scalar values for equality.
548
     *              Use array values for in_array() equivalent.
549
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
550
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
551
     *
552
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
553
     */
554 View Code Duplication
    public function filterByActiveFrom($activeFrom = null, $comparison = null)
555
    {
556
        if (is_array($activeFrom)) {
557
            $useMinMax = false;
558
            if (isset($activeFrom['min'])) {
559
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['min'], Criteria::GREATER_EQUAL);
560
                $useMinMax = true;
561
            }
562
            if (isset($activeFrom['max'])) {
563
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['max'], Criteria::LESS_EQUAL);
564
                $useMinMax = true;
565
            }
566
            if ($useMinMax) {
567
                return $this;
568
            }
569
            if (null === $comparison) {
570
                $comparison = Criteria::IN;
571
            }
572
        }
573
574
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom, $comparison);
575
    }
576
577
    /**
578
     * Filter the query on the active_to column
579
     *
580
     * Example usage:
581
     * <code>
582
     * $query->filterByActiveTo(1234); // WHERE active_to = 1234
583
     * $query->filterByActiveTo(array(12, 34)); // WHERE active_to IN (12, 34)
584
     * $query->filterByActiveTo(array('min' => 12)); // WHERE active_to > 12
585
     * </code>
586
     *
587
     * @param     mixed $activeTo The value to use as filter.
588
     *              Use scalar values for equality.
589
     *              Use array values for in_array() equivalent.
590
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
591
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
592
     *
593
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
594
     */
595 View Code Duplication
    public function filterByActiveTo($activeTo = null, $comparison = null)
596
    {
597
        if (is_array($activeTo)) {
598
            $useMinMax = false;
599
            if (isset($activeTo['min'])) {
600
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['min'], Criteria::GREATER_EQUAL);
601
                $useMinMax = true;
602
            }
603
            if (isset($activeTo['max'])) {
604
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['max'], Criteria::LESS_EQUAL);
605
                $useMinMax = true;
606
            }
607
            if ($useMinMax) {
608
                return $this;
609
            }
610
            if (null === $comparison) {
611
                $comparison = Criteria::IN;
612
            }
613
        }
614
615
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo, $comparison);
616
    }
617
618
    /**
619
     * Filter the query on the active column
620
     *
621
     * Example usage:
622
     * <code>
623
     * $query->filterByActive(1234); // WHERE active = 1234
624
     * $query->filterByActive(array(12, 34)); // WHERE active IN (12, 34)
625
     * $query->filterByActive(array('min' => 12)); // WHERE active > 12
626
     * </code>
627
     *
628
     * @param     mixed $active The value to use as filter.
629
     *              Use scalar values for equality.
630
     *              Use array values for in_array() equivalent.
631
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
632
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
633
     *
634
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
635
     */
636 View Code Duplication
    public function filterByActive($active = null, $comparison = null)
637
    {
638
        if (is_array($active)) {
639
            $useMinMax = false;
640
            if (isset($active['min'])) {
641
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['min'], Criteria::GREATER_EQUAL);
642
                $useMinMax = true;
643
            }
644
            if (isset($active['max'])) {
645
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['max'], Criteria::LESS_EQUAL);
646
                $useMinMax = true;
647
            }
648
            if ($useMinMax) {
649
                return $this;
650
            }
651
            if (null === $comparison) {
652
                $comparison = Criteria::IN;
653
            }
654
        }
655
656
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active, $comparison);
657
    }
658
659
    /**
660
     * Filter the query on the permanent column
661
     *
662
     * Example usage:
663
     * <code>
664
     * $query->filterByPermanent(1234); // WHERE permanent = 1234
665
     * $query->filterByPermanent(array(12, 34)); // WHERE permanent IN (12, 34)
666
     * $query->filterByPermanent(array('min' => 12)); // WHERE permanent > 12
667
     * </code>
668
     *
669
     * @param     mixed $permanent The value to use as filter.
670
     *              Use scalar values for equality.
671
     *              Use array values for in_array() equivalent.
672
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
673
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
674
     *
675
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
676
     */
677 View Code Duplication
    public function filterByPermanent($permanent = null, $comparison = null)
678
    {
679
        if (is_array($permanent)) {
680
            $useMinMax = false;
681
            if (isset($permanent['min'])) {
682
                $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['min'], Criteria::GREATER_EQUAL);
683
                $useMinMax = true;
684
            }
685
            if (isset($permanent['max'])) {
686
                $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['max'], Criteria::LESS_EQUAL);
687
                $useMinMax = true;
688
            }
689
            if ($useMinMax) {
690
                return $this;
691
            }
692
            if (null === $comparison) {
693
                $comparison = Criteria::IN;
694
            }
695
        }
696
697
        return $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent, $comparison);
698
    }
699
700
    /**
701
     * Filter the query by a related \xbanners\models\Banners object
702
     *
703
     * @param \xbanners\models\Banners|ObjectCollection $banners The related object(s) to use as filter
704
     * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
705
     *
706
     * @throws \Propel\Runtime\Exception\PropelException
707
     *
708
     * @return ChildBannerImageQuery The current query, for fluid interface
709
     */
710 View Code Duplication
    public function filterByBanners($banners, $comparison = null)
711
    {
712
        if ($banners instanceof \xbanners\models\Banners) {
713
            return $this
714
                ->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->getId(), $comparison);
715
        } elseif ($banners instanceof ObjectCollection) {
716
            if (null === $comparison) {
717
                $comparison = Criteria::IN;
718
            }
719
720
            return $this
721
                ->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->toKeyValue('PrimaryKey', 'Id'), $comparison);
722
        } else {
723
            throw new PropelException('filterByBanners() only accepts arguments of type \xbanners\models\Banners or Collection');
724
        }
725
    }
726
727
    /**
728
     * Adds a JOIN clause to the query using the Banners relation
729
     *
730
     * @param     string $relationAlias optional alias for the relation
731
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
732
     *
733
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
734
     */
735 View Code Duplication
    public function joinBanners($relationAlias = null, $joinType = Criteria::INNER_JOIN)
736
    {
737
        $tableMap = $this->getTableMap();
738
        $relationMap = $tableMap->getRelation('Banners');
739
740
        // create a ModelJoin object for this join
741
        $join = new ModelJoin();
742
        $join->setJoinType($joinType);
743
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
744
        if ($previousJoin = $this->getPreviousJoin()) {
745
            $join->setPreviousJoin($previousJoin);
0 ignored issues
show
Compatibility introduced by
$previousJoin of type object<Propel\Runtime\ActiveQuery\Join> is not a sub-type of object<Propel\Runtime\ActiveQuery\ModelJoin>. It seems like you assume a child class of the class Propel\Runtime\ActiveQuery\Join to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
746
        }
747
748
        // add the ModelJoin to the current object
749
        if ($relationAlias) {
750
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
751
            $this->addJoinObject($join, $relationAlias);
752
        } else {
753
            $this->addJoinObject($join, 'Banners');
754
        }
755
756
        return $this;
757
    }
758
759
    /**
760
     * Use the Banners relation Banners object
761
     *
762
     * @see useQuery()
763
     *
764
     * @param     string $relationAlias optional alias for the relation,
765
     *                                   to be used as main alias in the secondary query
766
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
767
     *
768
     * @return \xbanners\models\BannersQuery A secondary query class using the current class as primary query
769
     */
770
    public function useBannersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
771
    {
772
        return $this
773
            ->joinBanners($relationAlias, $joinType)
774
            ->useQuery($relationAlias ? $relationAlias : 'Banners', '\xbanners\models\BannersQuery');
775
    }
776
777
    /**
778
     * Filter the query by a related \xbanners\models\BannerImageI18n object
779
     *
780
     * @param \xbanners\models\BannerImageI18n|ObjectCollection $bannerImageI18n the related object to use as filter
781
     * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
782
     *
783
     * @return ChildBannerImageQuery The current query, for fluid interface
784
     */
785 View Code Duplication
    public function filterByBannerImageI18n($bannerImageI18n, $comparison = null)
786
    {
787
        if ($bannerImageI18n instanceof \xbanners\models\BannerImageI18n) {
788
            return $this
789
                ->addUsingAlias(BannerImageTableMap::COL_ID, $bannerImageI18n->getId(), $comparison);
790
        } elseif ($bannerImageI18n instanceof ObjectCollection) {
791
            return $this
792
                ->useBannerImageI18nQuery()
793
                ->filterByPrimaryKeys($bannerImageI18n->getPrimaryKeys())
794
                ->endUse();
795
        } else {
796
            throw new PropelException('filterByBannerImageI18n() only accepts arguments of type \xbanners\models\BannerImageI18n or Collection');
797
        }
798
    }
799
800
    /**
801
     * Adds a JOIN clause to the query using the BannerImageI18n relation
802
     *
803
     * @param     string $relationAlias optional alias for the relation
804
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
805
     *
806
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
807
     */
808 View Code Duplication
    public function joinBannerImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
809
    {
810
        $tableMap = $this->getTableMap();
811
        $relationMap = $tableMap->getRelation('BannerImageI18n');
812
813
        // create a ModelJoin object for this join
814
        $join = new ModelJoin();
815
        $join->setJoinType($joinType);
816
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
817
        if ($previousJoin = $this->getPreviousJoin()) {
818
            $join->setPreviousJoin($previousJoin);
0 ignored issues
show
Compatibility introduced by
$previousJoin of type object<Propel\Runtime\ActiveQuery\Join> is not a sub-type of object<Propel\Runtime\ActiveQuery\ModelJoin>. It seems like you assume a child class of the class Propel\Runtime\ActiveQuery\Join to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
819
        }
820
821
        // add the ModelJoin to the current object
822
        if ($relationAlias) {
823
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
824
            $this->addJoinObject($join, $relationAlias);
825
        } else {
826
            $this->addJoinObject($join, 'BannerImageI18n');
827
        }
828
829
        return $this;
830
    }
831
832
    /**
833
     * Use the BannerImageI18n relation BannerImageI18n object
834
     *
835
     * @see useQuery()
836
     *
837
     * @param     string $relationAlias optional alias for the relation,
838
     *                                   to be used as main alias in the secondary query
839
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
840
     *
841
     * @return \xbanners\models\BannerImageI18nQuery A secondary query class using the current class as primary query
842
     */
843
    public function useBannerImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
844
    {
845
        return $this
846
            ->joinBannerImageI18n($relationAlias, $joinType)
847
            ->useQuery($relationAlias ? $relationAlias : 'BannerImageI18n', '\xbanners\models\BannerImageI18nQuery');
848
    }
849
850
    /**
851
     * Exclude object from result
852
     *
853
     * @param   ChildBannerImage $bannerImage Object to remove from the list of results
854
     *
855
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
856
     */
857
    public function prune($bannerImage = null)
858
    {
859
        if ($bannerImage) {
860
            $this->addUsingAlias(BannerImageTableMap::COL_ID, $bannerImage->getId(), Criteria::NOT_EQUAL);
861
        }
862
863
        return $this;
864
    }
865
866
    /**
867
     * Deletes all rows from the banner_image table.
868
     *
869
     * @param ConnectionInterface $con the connection to use
870
     * @return int The number of affected rows (if supported by underlying database driver).
871
     */
872 View Code Duplication
    public function doDeleteAll(ConnectionInterface $con = null)
873
    {
874
        if (null === $con) {
875
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
876
        }
877
878
        // use transaction because $criteria could contain info
879
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
880
        return $con->transaction(function () use ($con) {
881
            $affectedRows = 0; // initialize var to track total num of affected rows
882
            $affectedRows += $this->doOnDeleteCascade($con);
883
            $affectedRows += parent::doDeleteAll($con);
884
            // Because this db requires some delete cascade/set null emulation, we have to
885
            // clear the cached instance *after* the emulation has happened (since
886
            // instances get re-added by the select statement contained therein).
887
            BannerImageTableMap::clearInstancePool();
888
            BannerImageTableMap::clearRelatedInstancePool();
889
890
            return $affectedRows;
891
        });
892
    }
893
894
    /**
895
     * Performs a DELETE on the database based on the current ModelCriteria
896
     *
897
     * @param ConnectionInterface $con the connection to use
898
     * @return int             The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
899
     *                         if supported by native driver or if emulated using Propel.
900
     * @throws PropelException Any exceptions caught during processing will be
901
     *                         rethrown wrapped into a PropelException.
902
     */
903 View Code Duplication
    public function delete(ConnectionInterface $con = null)
904
    {
905
        if (null === $con) {
906
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
907
        }
908
909
        $criteria = $this;
910
911
        // Set the correct dbName
912
        $criteria->setDbName(BannerImageTableMap::DATABASE_NAME);
913
914
        // use transaction because $criteria could contain info
915
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
916
        return $con->transaction(function () use ($con, $criteria) {
917
            $affectedRows = 0; // initialize var to track total num of affected rows
918
919
            // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
920
            $c = clone $criteria;
921
            $affectedRows += $c->doOnDeleteCascade($con);
922
923
            BannerImageTableMap::removeInstanceFromPool($criteria);
924
925
            $affectedRows += ModelCriteria::delete($con);
926
            BannerImageTableMap::clearRelatedInstancePool();
927
928
            return $affectedRows;
929
        });
930
    }
931
932
    /**
933
     * This is a method for emulating ON DELETE CASCADE for DBs that don't support this
934
     * feature (like MySQL or SQLite).
935
     *
936
     * This method is not very speedy because it must perform a query first to get
937
     * the implicated records and then perform the deletes by calling those Query classes.
938
     *
939
     * This method should be used within a transaction if possible.
940
     *
941
     * @param ConnectionInterface $con
942
     * @return int The number of affected rows (if supported by underlying database driver).
943
     */
944
    protected function doOnDeleteCascade(ConnectionInterface $con)
945
    {
946
        // initialize var to track total num of affected rows
947
        $affectedRows = 0;
948
949
        // first find the objects that are implicated by the $this
950
        $objects = ChildBannerImageQuery::create(null, $this)->find($con);
951
        foreach ($objects as $obj) {
952
953
954
            // delete related BannerImageI18n objects
955
            $query = new \xbanners\models\BannerImageI18nQuery;
956
957
            $query->add(BannerImageI18nTableMap::COL_ID, $obj->getId());
958
            $affectedRows += $query->delete($con);
959
        }
960
961
        return $affectedRows;
962
    }
963
964
    // i18n behavior
965
966
    /**
967
     * Adds a JOIN clause to the query using the i18n relation
968
     *
969
     * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
970
     * @param     string $relationAlias optional alias for the relation
971
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
972
     *
973
     * @return    ChildBannerImageQuery The current query, for fluid interface
974
     */
975 View Code Duplication
    public function joinI18n($locale = 'ru', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
976
    {
977
        $relationName = $relationAlias ? $relationAlias : 'BannerImageI18n';
978
979
        return $this
980
            ->joinBannerImageI18n($relationAlias, $joinType)
981
            ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
982
    }
983
984
    /**
985
     * Adds a JOIN clause to the query and hydrates the related I18n object.
986
     * Shortcut for $c->joinI18n($locale)->with()
987
     *
988
     * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
989
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
990
     *
991
     * @return    $this|ChildBannerImageQuery The current query, for fluid interface
992
     */
993 View Code Duplication
    public function joinWithI18n($locale = 'ru', $joinType = Criteria::LEFT_JOIN)
994
    {
995
        $this
996
            ->joinI18n($locale, null, $joinType)
997
            ->with('BannerImageI18n');
998
        $this->with['BannerImageI18n']->setIsWithOneToMany(false);
999
1000
        return $this;
1001
    }
1002
1003
    /**
1004
     * Use the I18n relation query object
1005
     *
1006
     * @see       useQuery()
1007
     *
1008
     * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
1009
     * @param     string $relationAlias optional alias for the relation
1010
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
1011
     *
1012
     * @return    ChildBannerImageI18nQuery A secondary query class using the current class as primary query
1013
     */
1014
    public function useI18nQuery($locale = 'ru', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
1015
    {
1016
        return $this
1017
            ->joinI18n($locale, $relationAlias, $joinType)
1018
            ->useQuery($relationAlias ? $relationAlias : 'BannerImageI18n', '\xbanners\models\BannerImageI18nQuery');
1019
    }
1020
1021
} // BannerImageQuery
1022