Completed
Push — development ( 006c45...63d178 )
by Andrij
19:41 queued 09:38
created

modules/xbanners/models/Base/BannerImageQuery.php (3 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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) {
0 ignored issues
show
The class Propel\Runtime\ActiveQuery\Criteria does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
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
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
    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
    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%'); // WHERE url LIKE '%fooValue%'
436
     * </code>
437
     *
438
     * @param     string $url The value to use as filter.
439
     *              Accepts wildcards (* and % trigger a LIKE)
440
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
441
     *
442
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
443
     */
444 View Code Duplication
    public function filterByUrl($url = null, $comparison = null)
445
    {
446
        if (null === $comparison) {
447
            if (is_array($url)) {
448
                $comparison = Criteria::IN;
449
            } elseif (preg_match('/[\%\*]/', $url)) {
450
                $url = str_replace('*', '%', $url);
451
                $comparison = Criteria::LIKE;
452
            }
453
        }
454
455
        return $this->addUsingAlias(BannerImageTableMap::COL_URL, $url, $comparison);
456
    }
457
458
    /**
459
     * Filter the query on the allowed_page column
460
     *
461
     * Example usage:
462
     * <code>
463
     * $query->filterByAllowedPage(1234); // WHERE allowed_page = 1234
464
     * $query->filterByAllowedPage(array(12, 34)); // WHERE allowed_page IN (12, 34)
465
     * $query->filterByAllowedPage(array('min' => 12)); // WHERE allowed_page > 12
466
     * </code>
467
     *
468
     * @param     mixed $allowedPage The value to use as filter.
469
     *              Use scalar values for equality.
470
     *              Use array values for in_array() equivalent.
471
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
472
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
473
     *
474
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
475
     */
476 View Code Duplication
    public function filterByAllowedPage($allowedPage = null, $comparison = null)
477
    {
478
        if (is_array($allowedPage)) {
479
            $useMinMax = false;
480
            if (isset($allowedPage['min'])) {
481
                $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['min'], Criteria::GREATER_EQUAL);
482
                $useMinMax = true;
483
            }
484
            if (isset($allowedPage['max'])) {
485
                $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['max'], Criteria::LESS_EQUAL);
486
                $useMinMax = true;
487
            }
488
            if ($useMinMax) {
489
                return $this;
490
            }
491
            if (null === $comparison) {
492
                $comparison = Criteria::IN;
493
            }
494
        }
495
496
        return $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage, $comparison);
497
    }
498
499
    /**
500
     * Filter the query on the position column
501
     *
502
     * Example usage:
503
     * <code>
504
     * $query->filterByPosition(1234); // WHERE position = 1234
505
     * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34)
506
     * $query->filterByPosition(array('min' => 12)); // WHERE position > 12
507
     * </code>
508
     *
509
     * @param     mixed $position The value to use as filter.
510
     *              Use scalar values for equality.
511
     *              Use array values for in_array() equivalent.
512
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
513
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
514
     *
515
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
516
     */
517 View Code Duplication
    public function filterByPosition($position = null, $comparison = null)
518
    {
519
        if (is_array($position)) {
520
            $useMinMax = false;
521
            if (isset($position['min'])) {
522
                $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['min'], Criteria::GREATER_EQUAL);
523
                $useMinMax = true;
524
            }
525
            if (isset($position['max'])) {
526
                $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['max'], Criteria::LESS_EQUAL);
527
                $useMinMax = true;
528
            }
529
            if ($useMinMax) {
530
                return $this;
531
            }
532
            if (null === $comparison) {
533
                $comparison = Criteria::IN;
534
            }
535
        }
536
537
        return $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position, $comparison);
538
    }
539
540
    /**
541
     * Filter the query on the active_from column
542
     *
543
     * Example usage:
544
     * <code>
545
     * $query->filterByActiveFrom(1234); // WHERE active_from = 1234
546
     * $query->filterByActiveFrom(array(12, 34)); // WHERE active_from IN (12, 34)
547
     * $query->filterByActiveFrom(array('min' => 12)); // WHERE active_from > 12
548
     * </code>
549
     *
550
     * @param     mixed $activeFrom The value to use as filter.
551
     *              Use scalar values for equality.
552
     *              Use array values for in_array() equivalent.
553
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
554
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
555
     *
556
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
557
     */
558 View Code Duplication
    public function filterByActiveFrom($activeFrom = null, $comparison = null)
559
    {
560
        if (is_array($activeFrom)) {
561
            $useMinMax = false;
562
            if (isset($activeFrom['min'])) {
563
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['min'], Criteria::GREATER_EQUAL);
564
                $useMinMax = true;
565
            }
566
            if (isset($activeFrom['max'])) {
567
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['max'], Criteria::LESS_EQUAL);
568
                $useMinMax = true;
569
            }
570
            if ($useMinMax) {
571
                return $this;
572
            }
573
            if (null === $comparison) {
574
                $comparison = Criteria::IN;
575
            }
576
        }
577
578
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom, $comparison);
579
    }
580
581
    /**
582
     * Filter the query on the active_to column
583
     *
584
     * Example usage:
585
     * <code>
586
     * $query->filterByActiveTo(1234); // WHERE active_to = 1234
587
     * $query->filterByActiveTo(array(12, 34)); // WHERE active_to IN (12, 34)
588
     * $query->filterByActiveTo(array('min' => 12)); // WHERE active_to > 12
589
     * </code>
590
     *
591
     * @param     mixed $activeTo The value to use as filter.
592
     *              Use scalar values for equality.
593
     *              Use array values for in_array() equivalent.
594
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
595
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
596
     *
597
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
598
     */
599 View Code Duplication
    public function filterByActiveTo($activeTo = null, $comparison = null)
600
    {
601
        if (is_array($activeTo)) {
602
            $useMinMax = false;
603
            if (isset($activeTo['min'])) {
604
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['min'], Criteria::GREATER_EQUAL);
605
                $useMinMax = true;
606
            }
607
            if (isset($activeTo['max'])) {
608
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['max'], Criteria::LESS_EQUAL);
609
                $useMinMax = true;
610
            }
611
            if ($useMinMax) {
612
                return $this;
613
            }
614
            if (null === $comparison) {
615
                $comparison = Criteria::IN;
616
            }
617
        }
618
619
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo, $comparison);
620
    }
621
622
    /**
623
     * Filter the query on the active column
624
     *
625
     * Example usage:
626
     * <code>
627
     * $query->filterByActive(1234); // WHERE active = 1234
628
     * $query->filterByActive(array(12, 34)); // WHERE active IN (12, 34)
629
     * $query->filterByActive(array('min' => 12)); // WHERE active > 12
630
     * </code>
631
     *
632
     * @param     mixed $active The value to use as filter.
633
     *              Use scalar values for equality.
634
     *              Use array values for in_array() equivalent.
635
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
636
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
637
     *
638
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
639
     */
640 View Code Duplication
    public function filterByActive($active = null, $comparison = null)
641
    {
642
        if (is_array($active)) {
643
            $useMinMax = false;
644
            if (isset($active['min'])) {
645
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['min'], Criteria::GREATER_EQUAL);
646
                $useMinMax = true;
647
            }
648
            if (isset($active['max'])) {
649
                $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['max'], Criteria::LESS_EQUAL);
650
                $useMinMax = true;
651
            }
652
            if ($useMinMax) {
653
                return $this;
654
            }
655
            if (null === $comparison) {
656
                $comparison = Criteria::IN;
657
            }
658
        }
659
660
        return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active, $comparison);
661
    }
662
663
    /**
664
     * Filter the query on the permanent column
665
     *
666
     * Example usage:
667
     * <code>
668
     * $query->filterByPermanent(1234); // WHERE permanent = 1234
669
     * $query->filterByPermanent(array(12, 34)); // WHERE permanent IN (12, 34)
670
     * $query->filterByPermanent(array('min' => 12)); // WHERE permanent > 12
671
     * </code>
672
     *
673
     * @param     mixed $permanent The value to use as filter.
674
     *              Use scalar values for equality.
675
     *              Use array values for in_array() equivalent.
676
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
677
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
678
     *
679
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
680
     */
681 View Code Duplication
    public function filterByPermanent($permanent = null, $comparison = null)
682
    {
683
        if (is_array($permanent)) {
684
            $useMinMax = false;
685
            if (isset($permanent['min'])) {
686
                $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['min'], Criteria::GREATER_EQUAL);
687
                $useMinMax = true;
688
            }
689
            if (isset($permanent['max'])) {
690
                $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['max'], Criteria::LESS_EQUAL);
691
                $useMinMax = true;
692
            }
693
            if ($useMinMax) {
694
                return $this;
695
            }
696
            if (null === $comparison) {
697
                $comparison = Criteria::IN;
698
            }
699
        }
700
701
        return $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent, $comparison);
702
    }
703
704
    /**
705
     * Filter the query by a related \xbanners\models\Banners object
706
     *
707
     * @param \xbanners\models\Banners|ObjectCollection $banners The related object(s) to use as filter
708
     * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
709
     *
710
     * @throws \Propel\Runtime\Exception\PropelException
711
     *
712
     * @return ChildBannerImageQuery The current query, for fluid interface
713
     */
714
    public function filterByBanners($banners, $comparison = null)
715
    {
716
        if ($banners instanceof \xbanners\models\Banners) {
717
            return $this
718
                ->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->getId(), $comparison);
719
        } elseif ($banners instanceof ObjectCollection) {
0 ignored issues
show
The class Propel\Runtime\Collection\ObjectCollection does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
720
            if (null === $comparison) {
721
                $comparison = Criteria::IN;
722
            }
723
724
            return $this
725
                ->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->toKeyValue('PrimaryKey', 'Id'), $comparison);
726
        } else {
727
            throw new PropelException('filterByBanners() only accepts arguments of type \xbanners\models\Banners or Collection');
728
        }
729
    }
730
731
    /**
732
     * Adds a JOIN clause to the query using the Banners relation
733
     *
734
     * @param     string $relationAlias optional alias for the relation
735
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
736
     *
737
     * @return $this|ChildBannerImageQuery The current query, for fluid interface
738
     */
739
    public function joinBanners($relationAlias = null, $joinType = Criteria::INNER_JOIN)
740
    {
741
        $tableMap = $this->getTableMap();
742
        $relationMap = $tableMap->getRelation('Banners');
743
744
        // create a ModelJoin object for this join
745
        $join = new ModelJoin();
746
        $join->setJoinType($joinType);
747
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
748
        if ($previousJoin = $this->getPreviousJoin()) {
749
            $join->setPreviousJoin($previousJoin);
750
        }
751
752
        // add the ModelJoin to the current object
753
        if ($relationAlias) {
754
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
755
            $this->addJoinObject($join, $relationAlias);
756
        } else {
757
            $this->addJoinObject($join, 'Banners');
758
        }
759
760
        return $this;
761
    }
762
763
    /**
764
     * Use the Banners relation Banners object
765
     *
766
     * @see useQuery()
767
     *
768
     * @param     string $relationAlias optional alias for the relation,
769
     *                                   to be used as main alias in the secondary query
770
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
771
     *
772
     * @return \xbanners\models\BannersQuery A secondary query class using the current class as primary query
773
     */
774
    public function useBannersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
775
    {
776
        return $this
777
            ->joinBanners($relationAlias, $joinType)
778
            ->useQuery($relationAlias ? $relationAlias : 'Banners', '\xbanners\models\BannersQuery');
779
    }
780
781
    /**
782
     * Filter the query by a related \xbanners\models\BannerImageI18n object
783
     *
784
     * @param \xbanners\models\BannerImageI18n|ObjectCollection $bannerImageI18n the related object to use as filter
785
     * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
786
     *
787
     * @return ChildBannerImageQuery The current query, for fluid interface
788
     */
789 View Code Duplication
    public function filterByBannerImageI18n($bannerImageI18n, $comparison = null)
790
    {
791
        if ($bannerImageI18n instanceof \xbanners\models\BannerImageI18n) {
792
            return $this
793
                ->addUsingAlias(BannerImageTableMap::COL_ID, $bannerImageI18n->getId(), $comparison);
794
        } elseif ($bannerImageI18n instanceof ObjectCollection) {
0 ignored issues
show
The class Propel\Runtime\Collection\ObjectCollection does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

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