|
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
|
|
|
if ((null !== ($obj = BannerImageTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) { |
|
179
|
|
|
// the object is already in the instance pool |
|
180
|
|
|
return $obj; |
|
181
|
|
|
} |
|
182
|
|
|
if ($con === null) { |
|
183
|
|
|
$con = Propel::getServiceContainer()->getReadConnection(BannerImageTableMap::DATABASE_NAME); |
|
184
|
|
|
} |
|
185
|
|
|
$this->basePreSelect($con); |
|
186
|
|
|
if ($this->formatter || $this->modelAlias || $this->with || $this->select |
|
187
|
|
|
|| $this->selectColumns || $this->asColumns || $this->selectModifiers |
|
|
|
|
|
|
188
|
|
|
|| $this->map || $this->having || $this->joins) { |
|
|
|
|
|
|
189
|
|
|
return $this->findPkComplex($key, $con); |
|
190
|
|
|
} else { |
|
191
|
|
|
return $this->findPkSimple($key, $con); |
|
192
|
|
|
} |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
/** |
|
196
|
|
|
* Find object by primary key using raw SQL to go fast. |
|
197
|
|
|
* Bypass doSelect() and the object formatter by using generated code. |
|
198
|
|
|
* |
|
199
|
|
|
* @param mixed $key Primary key to use for the query |
|
200
|
|
|
* @param ConnectionInterface $con A connection object |
|
201
|
|
|
* |
|
202
|
|
|
* @throws \Propel\Runtime\Exception\PropelException |
|
|
|
|
|
|
203
|
|
|
* |
|
204
|
|
|
* @return ChildBannerImage A model object, or null if the key is not found |
|
|
|
|
|
|
205
|
|
|
*/ |
|
206
|
|
View Code Duplication |
protected function findPkSimple($key, ConnectionInterface $con) |
|
207
|
|
|
{ |
|
208
|
|
|
$sql = 'SELECT id, banner_id, target, url, allowed_page, position, active_from, active_to, active, permanent FROM banner_image WHERE id = :p0'; |
|
209
|
|
|
try { |
|
210
|
|
|
$stmt = $con->prepare($sql); |
|
211
|
|
|
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); |
|
212
|
|
|
$stmt->execute(); |
|
213
|
|
|
} catch (Exception $e) { |
|
214
|
|
|
Propel::log($e->getMessage(), Propel::LOG_ERR); |
|
215
|
|
|
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); |
|
216
|
|
|
} |
|
217
|
|
|
$obj = null; |
|
218
|
|
|
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { |
|
219
|
|
|
/** @var ChildBannerImage $obj */ |
|
220
|
|
|
$obj = new ChildBannerImage(); |
|
221
|
|
|
$obj->hydrate($row); |
|
222
|
|
|
BannerImageTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key); |
|
223
|
|
|
} |
|
224
|
|
|
$stmt->closeCursor(); |
|
225
|
|
|
|
|
226
|
|
|
return $obj; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* Find object by primary key. |
|
231
|
|
|
* |
|
232
|
|
|
* @param mixed $key Primary key to use for the query |
|
233
|
|
|
* @param ConnectionInterface $con A connection object |
|
234
|
|
|
* |
|
235
|
|
|
* @return ChildBannerImage|array|mixed the result, formatted by the current formatter |
|
236
|
|
|
*/ |
|
237
|
|
View Code Duplication |
protected function findPkComplex($key, ConnectionInterface $con) |
|
238
|
|
|
{ |
|
239
|
|
|
// As the query uses a PK condition, no limit(1) is necessary. |
|
240
|
|
|
$criteria = $this->isKeepQuery() ? clone $this : $this; |
|
241
|
|
|
$dataFetcher = $criteria |
|
242
|
|
|
->filterByPrimaryKey($key) |
|
243
|
|
|
->doSelect($con); |
|
244
|
|
|
|
|
245
|
|
|
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher); |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* Find objects by primary key |
|
250
|
|
|
* <code> |
|
251
|
|
|
* $objs = $c->findPks(array(12, 56, 832), $con); |
|
252
|
|
|
* </code> |
|
253
|
|
|
* @param array $keys Primary keys to use for the query |
|
254
|
|
|
* @param ConnectionInterface $con an optional connection object |
|
|
|
|
|
|
255
|
|
|
* |
|
256
|
|
|
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter |
|
257
|
|
|
*/ |
|
258
|
|
View Code Duplication |
public function findPks($keys, ConnectionInterface $con = null) |
|
259
|
|
|
{ |
|
260
|
|
|
if (null === $con) { |
|
261
|
|
|
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); |
|
262
|
|
|
} |
|
263
|
|
|
$this->basePreSelect($con); |
|
264
|
|
|
$criteria = $this->isKeepQuery() ? clone $this : $this; |
|
265
|
|
|
$dataFetcher = $criteria |
|
266
|
|
|
->filterByPrimaryKeys($keys) |
|
267
|
|
|
->doSelect($con); |
|
268
|
|
|
|
|
269
|
|
|
return $criteria->getFormatter()->init($criteria)->format($dataFetcher); |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
/** |
|
273
|
|
|
* Filter the query by primary key |
|
274
|
|
|
* |
|
275
|
|
|
* @param mixed $key Primary key to use for the query |
|
276
|
|
|
* |
|
277
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
278
|
|
|
*/ |
|
279
|
|
|
public function filterByPrimaryKey($key) |
|
280
|
|
|
{ |
|
281
|
|
|
|
|
282
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ID, $key, Criteria::EQUAL); |
|
283
|
|
|
} |
|
284
|
|
|
|
|
285
|
|
|
/** |
|
286
|
|
|
* Filter the query by a list of primary keys |
|
287
|
|
|
* |
|
288
|
|
|
* @param array $keys The list of primary key to use for the query |
|
289
|
|
|
* |
|
290
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
291
|
|
|
*/ |
|
292
|
|
|
public function filterByPrimaryKeys($keys) |
|
293
|
|
|
{ |
|
294
|
|
|
|
|
295
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ID, $keys, Criteria::IN); |
|
296
|
|
|
} |
|
297
|
|
|
|
|
298
|
|
|
/** |
|
299
|
|
|
* Filter the query on the id column |
|
300
|
|
|
* |
|
301
|
|
|
* Example usage: |
|
302
|
|
|
* <code> |
|
303
|
|
|
* $query->filterById(1234); // WHERE id = 1234 |
|
304
|
|
|
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34) |
|
305
|
|
|
* $query->filterById(array('min' => 12)); // WHERE id > 12 |
|
306
|
|
|
* </code> |
|
307
|
|
|
* |
|
308
|
|
|
* @param mixed $id The value to use as filter. |
|
309
|
|
|
* Use scalar values for equality. |
|
310
|
|
|
* Use array values for in_array() equivalent. |
|
311
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
312
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
313
|
|
|
* |
|
314
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
315
|
|
|
*/ |
|
316
|
|
View Code Duplication |
public function filterById($id = null, $comparison = null) |
|
317
|
|
|
{ |
|
318
|
|
|
if (is_array($id)) { |
|
319
|
|
|
$useMinMax = false; |
|
320
|
|
|
if (isset($id['min'])) { |
|
321
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL); |
|
322
|
|
|
$useMinMax = true; |
|
323
|
|
|
} |
|
324
|
|
|
if (isset($id['max'])) { |
|
325
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL); |
|
326
|
|
|
$useMinMax = true; |
|
327
|
|
|
} |
|
328
|
|
|
if ($useMinMax) { |
|
329
|
|
|
return $this; |
|
330
|
|
|
} |
|
331
|
|
|
if (null === $comparison) { |
|
332
|
|
|
$comparison = Criteria::IN; |
|
333
|
|
|
} |
|
334
|
|
|
} |
|
335
|
|
|
|
|
336
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ID, $id, $comparison); |
|
337
|
|
|
} |
|
338
|
|
|
|
|
339
|
|
|
/** |
|
340
|
|
|
* Filter the query on the banner_id column |
|
341
|
|
|
* |
|
342
|
|
|
* Example usage: |
|
343
|
|
|
* <code> |
|
344
|
|
|
* $query->filterByBannerId(1234); // WHERE banner_id = 1234 |
|
345
|
|
|
* $query->filterByBannerId(array(12, 34)); // WHERE banner_id IN (12, 34) |
|
346
|
|
|
* $query->filterByBannerId(array('min' => 12)); // WHERE banner_id > 12 |
|
347
|
|
|
* </code> |
|
348
|
|
|
* |
|
349
|
|
|
* @see filterByBanners() |
|
350
|
|
|
* |
|
351
|
|
|
* @param mixed $bannerId The value to use as filter. |
|
|
|
|
|
|
352
|
|
|
* Use scalar values for equality. |
|
353
|
|
|
* Use array values for in_array() equivalent. |
|
354
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
355
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
356
|
|
|
* |
|
357
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
358
|
|
|
*/ |
|
359
|
|
View Code Duplication |
public function filterByBannerId($bannerId = null, $comparison = null) |
|
360
|
|
|
{ |
|
361
|
|
|
if (is_array($bannerId)) { |
|
362
|
|
|
$useMinMax = false; |
|
363
|
|
|
if (isset($bannerId['min'])) { |
|
364
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId['min'], Criteria::GREATER_EQUAL); |
|
365
|
|
|
$useMinMax = true; |
|
366
|
|
|
} |
|
367
|
|
|
if (isset($bannerId['max'])) { |
|
368
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId['max'], Criteria::LESS_EQUAL); |
|
369
|
|
|
$useMinMax = true; |
|
370
|
|
|
} |
|
371
|
|
|
if ($useMinMax) { |
|
372
|
|
|
return $this; |
|
373
|
|
|
} |
|
374
|
|
|
if (null === $comparison) { |
|
375
|
|
|
$comparison = Criteria::IN; |
|
376
|
|
|
} |
|
377
|
|
|
} |
|
378
|
|
|
|
|
379
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $bannerId, $comparison); |
|
380
|
|
|
} |
|
381
|
|
|
|
|
382
|
|
|
/** |
|
383
|
|
|
* Filter the query on the target column |
|
384
|
|
|
* |
|
385
|
|
|
* Example usage: |
|
386
|
|
|
* <code> |
|
387
|
|
|
* $query->filterByTarget(1234); // WHERE target = 1234 |
|
388
|
|
|
* $query->filterByTarget(array(12, 34)); // WHERE target IN (12, 34) |
|
389
|
|
|
* $query->filterByTarget(array('min' => 12)); // WHERE target > 12 |
|
390
|
|
|
* </code> |
|
391
|
|
|
* |
|
392
|
|
|
* @param mixed $target The value to use as filter. |
|
393
|
|
|
* Use scalar values for equality. |
|
394
|
|
|
* Use array values for in_array() equivalent. |
|
395
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
396
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
397
|
|
|
* |
|
398
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
399
|
|
|
*/ |
|
400
|
|
View Code Duplication |
public function filterByTarget($target = null, $comparison = null) |
|
401
|
|
|
{ |
|
402
|
|
|
if (is_array($target)) { |
|
403
|
|
|
$useMinMax = false; |
|
404
|
|
|
if (isset($target['min'])) { |
|
405
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target['min'], Criteria::GREATER_EQUAL); |
|
406
|
|
|
$useMinMax = true; |
|
407
|
|
|
} |
|
408
|
|
|
if (isset($target['max'])) { |
|
409
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target['max'], Criteria::LESS_EQUAL); |
|
410
|
|
|
$useMinMax = true; |
|
411
|
|
|
} |
|
412
|
|
|
if ($useMinMax) { |
|
413
|
|
|
return $this; |
|
414
|
|
|
} |
|
415
|
|
|
if (null === $comparison) { |
|
416
|
|
|
$comparison = Criteria::IN; |
|
417
|
|
|
} |
|
418
|
|
|
} |
|
419
|
|
|
|
|
420
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_TARGET, $target, $comparison); |
|
421
|
|
|
} |
|
422
|
|
|
|
|
423
|
|
|
/** |
|
424
|
|
|
* Filter the query on the url column |
|
425
|
|
|
* |
|
426
|
|
|
* Example usage: |
|
427
|
|
|
* <code> |
|
428
|
|
|
* $query->filterByUrl('fooValue'); // WHERE url = 'fooValue' |
|
429
|
|
|
* $query->filterByUrl('%fooValue%'); // WHERE url LIKE '%fooValue%' |
|
430
|
|
|
* </code> |
|
431
|
|
|
* |
|
432
|
|
|
* @param string $url The value to use as filter. |
|
|
|
|
|
|
433
|
|
|
* Accepts wildcards (* and % trigger a LIKE) |
|
|
|
|
|
|
434
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
435
|
|
|
* |
|
436
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
437
|
|
|
*/ |
|
438
|
|
View Code Duplication |
public function filterByUrl($url = null, $comparison = null) |
|
439
|
|
|
{ |
|
440
|
|
|
if (null === $comparison) { |
|
441
|
|
|
if (is_array($url)) { |
|
442
|
|
|
$comparison = Criteria::IN; |
|
443
|
|
|
} elseif (preg_match('/[\%\*]/', $url)) { |
|
444
|
|
|
$url = str_replace('*', '%', $url); |
|
445
|
|
|
$comparison = Criteria::LIKE; |
|
446
|
|
|
} |
|
447
|
|
|
} |
|
448
|
|
|
|
|
449
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_URL, $url, $comparison); |
|
450
|
|
|
} |
|
451
|
|
|
|
|
452
|
|
|
/** |
|
453
|
|
|
* Filter the query on the allowed_page column |
|
454
|
|
|
* |
|
455
|
|
|
* Example usage: |
|
456
|
|
|
* <code> |
|
457
|
|
|
* $query->filterByAllowedPage(1234); // WHERE allowed_page = 1234 |
|
458
|
|
|
* $query->filterByAllowedPage(array(12, 34)); // WHERE allowed_page IN (12, 34) |
|
459
|
|
|
* $query->filterByAllowedPage(array('min' => 12)); // WHERE allowed_page > 12 |
|
460
|
|
|
* </code> |
|
461
|
|
|
* |
|
462
|
|
|
* @param mixed $allowedPage The value to use as filter. |
|
463
|
|
|
* Use scalar values for equality. |
|
464
|
|
|
* Use array values for in_array() equivalent. |
|
465
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
466
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
467
|
|
|
* |
|
468
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
469
|
|
|
*/ |
|
470
|
|
View Code Duplication |
public function filterByAllowedPage($allowedPage = null, $comparison = null) |
|
471
|
|
|
{ |
|
472
|
|
|
if (is_array($allowedPage)) { |
|
473
|
|
|
$useMinMax = false; |
|
474
|
|
|
if (isset($allowedPage['min'])) { |
|
475
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['min'], Criteria::GREATER_EQUAL); |
|
476
|
|
|
$useMinMax = true; |
|
477
|
|
|
} |
|
478
|
|
|
if (isset($allowedPage['max'])) { |
|
479
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage['max'], Criteria::LESS_EQUAL); |
|
480
|
|
|
$useMinMax = true; |
|
481
|
|
|
} |
|
482
|
|
|
if ($useMinMax) { |
|
483
|
|
|
return $this; |
|
484
|
|
|
} |
|
485
|
|
|
if (null === $comparison) { |
|
486
|
|
|
$comparison = Criteria::IN; |
|
487
|
|
|
} |
|
488
|
|
|
} |
|
489
|
|
|
|
|
490
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ALLOWED_PAGE, $allowedPage, $comparison); |
|
491
|
|
|
} |
|
492
|
|
|
|
|
493
|
|
|
/** |
|
494
|
|
|
* Filter the query on the position column |
|
495
|
|
|
* |
|
496
|
|
|
* Example usage: |
|
497
|
|
|
* <code> |
|
498
|
|
|
* $query->filterByPosition(1234); // WHERE position = 1234 |
|
499
|
|
|
* $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34) |
|
500
|
|
|
* $query->filterByPosition(array('min' => 12)); // WHERE position > 12 |
|
501
|
|
|
* </code> |
|
502
|
|
|
* |
|
503
|
|
|
* @param mixed $position The value to use as filter. |
|
504
|
|
|
* Use scalar values for equality. |
|
505
|
|
|
* Use array values for in_array() equivalent. |
|
506
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
507
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
508
|
|
|
* |
|
509
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
510
|
|
|
*/ |
|
511
|
|
View Code Duplication |
public function filterByPosition($position = null, $comparison = null) |
|
512
|
|
|
{ |
|
513
|
|
|
if (is_array($position)) { |
|
514
|
|
|
$useMinMax = false; |
|
515
|
|
|
if (isset($position['min'])) { |
|
516
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['min'], Criteria::GREATER_EQUAL); |
|
517
|
|
|
$useMinMax = true; |
|
518
|
|
|
} |
|
519
|
|
|
if (isset($position['max'])) { |
|
520
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position['max'], Criteria::LESS_EQUAL); |
|
521
|
|
|
$useMinMax = true; |
|
522
|
|
|
} |
|
523
|
|
|
if ($useMinMax) { |
|
524
|
|
|
return $this; |
|
525
|
|
|
} |
|
526
|
|
|
if (null === $comparison) { |
|
527
|
|
|
$comparison = Criteria::IN; |
|
528
|
|
|
} |
|
529
|
|
|
} |
|
530
|
|
|
|
|
531
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_POSITION, $position, $comparison); |
|
532
|
|
|
} |
|
533
|
|
|
|
|
534
|
|
|
/** |
|
535
|
|
|
* Filter the query on the active_from column |
|
536
|
|
|
* |
|
537
|
|
|
* Example usage: |
|
538
|
|
|
* <code> |
|
539
|
|
|
* $query->filterByActiveFrom(1234); // WHERE active_from = 1234 |
|
540
|
|
|
* $query->filterByActiveFrom(array(12, 34)); // WHERE active_from IN (12, 34) |
|
541
|
|
|
* $query->filterByActiveFrom(array('min' => 12)); // WHERE active_from > 12 |
|
542
|
|
|
* </code> |
|
543
|
|
|
* |
|
544
|
|
|
* @param mixed $activeFrom The value to use as filter. |
|
545
|
|
|
* Use scalar values for equality. |
|
546
|
|
|
* Use array values for in_array() equivalent. |
|
547
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
548
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
549
|
|
|
* |
|
550
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
551
|
|
|
*/ |
|
552
|
|
View Code Duplication |
public function filterByActiveFrom($activeFrom = null, $comparison = null) |
|
553
|
|
|
{ |
|
554
|
|
|
if (is_array($activeFrom)) { |
|
555
|
|
|
$useMinMax = false; |
|
556
|
|
|
if (isset($activeFrom['min'])) { |
|
557
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['min'], Criteria::GREATER_EQUAL); |
|
558
|
|
|
$useMinMax = true; |
|
559
|
|
|
} |
|
560
|
|
|
if (isset($activeFrom['max'])) { |
|
561
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom['max'], Criteria::LESS_EQUAL); |
|
562
|
|
|
$useMinMax = true; |
|
563
|
|
|
} |
|
564
|
|
|
if ($useMinMax) { |
|
565
|
|
|
return $this; |
|
566
|
|
|
} |
|
567
|
|
|
if (null === $comparison) { |
|
568
|
|
|
$comparison = Criteria::IN; |
|
569
|
|
|
} |
|
570
|
|
|
} |
|
571
|
|
|
|
|
572
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_FROM, $activeFrom, $comparison); |
|
573
|
|
|
} |
|
574
|
|
|
|
|
575
|
|
|
/** |
|
576
|
|
|
* Filter the query on the active_to column |
|
577
|
|
|
* |
|
578
|
|
|
* Example usage: |
|
579
|
|
|
* <code> |
|
580
|
|
|
* $query->filterByActiveTo(1234); // WHERE active_to = 1234 |
|
581
|
|
|
* $query->filterByActiveTo(array(12, 34)); // WHERE active_to IN (12, 34) |
|
582
|
|
|
* $query->filterByActiveTo(array('min' => 12)); // WHERE active_to > 12 |
|
583
|
|
|
* </code> |
|
584
|
|
|
* |
|
585
|
|
|
* @param mixed $activeTo The value to use as filter. |
|
586
|
|
|
* Use scalar values for equality. |
|
587
|
|
|
* Use array values for in_array() equivalent. |
|
588
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
589
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
590
|
|
|
* |
|
591
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
592
|
|
|
*/ |
|
593
|
|
View Code Duplication |
public function filterByActiveTo($activeTo = null, $comparison = null) |
|
594
|
|
|
{ |
|
595
|
|
|
if (is_array($activeTo)) { |
|
596
|
|
|
$useMinMax = false; |
|
597
|
|
|
if (isset($activeTo['min'])) { |
|
598
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['min'], Criteria::GREATER_EQUAL); |
|
599
|
|
|
$useMinMax = true; |
|
600
|
|
|
} |
|
601
|
|
|
if (isset($activeTo['max'])) { |
|
602
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo['max'], Criteria::LESS_EQUAL); |
|
603
|
|
|
$useMinMax = true; |
|
604
|
|
|
} |
|
605
|
|
|
if ($useMinMax) { |
|
606
|
|
|
return $this; |
|
607
|
|
|
} |
|
608
|
|
|
if (null === $comparison) { |
|
609
|
|
|
$comparison = Criteria::IN; |
|
610
|
|
|
} |
|
611
|
|
|
} |
|
612
|
|
|
|
|
613
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE_TO, $activeTo, $comparison); |
|
614
|
|
|
} |
|
615
|
|
|
|
|
616
|
|
|
/** |
|
617
|
|
|
* Filter the query on the active column |
|
618
|
|
|
* |
|
619
|
|
|
* Example usage: |
|
620
|
|
|
* <code> |
|
621
|
|
|
* $query->filterByActive(1234); // WHERE active = 1234 |
|
622
|
|
|
* $query->filterByActive(array(12, 34)); // WHERE active IN (12, 34) |
|
623
|
|
|
* $query->filterByActive(array('min' => 12)); // WHERE active > 12 |
|
624
|
|
|
* </code> |
|
625
|
|
|
* |
|
626
|
|
|
* @param mixed $active The value to use as filter. |
|
627
|
|
|
* Use scalar values for equality. |
|
628
|
|
|
* Use array values for in_array() equivalent. |
|
629
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
630
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
631
|
|
|
* |
|
632
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
633
|
|
|
*/ |
|
634
|
|
View Code Duplication |
public function filterByActive($active = null, $comparison = null) |
|
635
|
|
|
{ |
|
636
|
|
|
if (is_array($active)) { |
|
637
|
|
|
$useMinMax = false; |
|
638
|
|
|
if (isset($active['min'])) { |
|
639
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['min'], Criteria::GREATER_EQUAL); |
|
640
|
|
|
$useMinMax = true; |
|
641
|
|
|
} |
|
642
|
|
|
if (isset($active['max'])) { |
|
643
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active['max'], Criteria::LESS_EQUAL); |
|
644
|
|
|
$useMinMax = true; |
|
645
|
|
|
} |
|
646
|
|
|
if ($useMinMax) { |
|
647
|
|
|
return $this; |
|
648
|
|
|
} |
|
649
|
|
|
if (null === $comparison) { |
|
650
|
|
|
$comparison = Criteria::IN; |
|
651
|
|
|
} |
|
652
|
|
|
} |
|
653
|
|
|
|
|
654
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_ACTIVE, $active, $comparison); |
|
655
|
|
|
} |
|
656
|
|
|
|
|
657
|
|
|
/** |
|
658
|
|
|
* Filter the query on the permanent column |
|
659
|
|
|
* |
|
660
|
|
|
* Example usage: |
|
661
|
|
|
* <code> |
|
662
|
|
|
* $query->filterByPermanent(1234); // WHERE permanent = 1234 |
|
663
|
|
|
* $query->filterByPermanent(array(12, 34)); // WHERE permanent IN (12, 34) |
|
664
|
|
|
* $query->filterByPermanent(array('min' => 12)); // WHERE permanent > 12 |
|
665
|
|
|
* </code> |
|
666
|
|
|
* |
|
667
|
|
|
* @param mixed $permanent The value to use as filter. |
|
668
|
|
|
* Use scalar values for equality. |
|
669
|
|
|
* Use array values for in_array() equivalent. |
|
670
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
|
671
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
672
|
|
|
* |
|
673
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
674
|
|
|
*/ |
|
675
|
|
View Code Duplication |
public function filterByPermanent($permanent = null, $comparison = null) |
|
676
|
|
|
{ |
|
677
|
|
|
if (is_array($permanent)) { |
|
678
|
|
|
$useMinMax = false; |
|
679
|
|
|
if (isset($permanent['min'])) { |
|
680
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['min'], Criteria::GREATER_EQUAL); |
|
681
|
|
|
$useMinMax = true; |
|
682
|
|
|
} |
|
683
|
|
|
if (isset($permanent['max'])) { |
|
684
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent['max'], Criteria::LESS_EQUAL); |
|
685
|
|
|
$useMinMax = true; |
|
686
|
|
|
} |
|
687
|
|
|
if ($useMinMax) { |
|
688
|
|
|
return $this; |
|
689
|
|
|
} |
|
690
|
|
|
if (null === $comparison) { |
|
691
|
|
|
$comparison = Criteria::IN; |
|
692
|
|
|
} |
|
693
|
|
|
} |
|
694
|
|
|
|
|
695
|
|
|
return $this->addUsingAlias(BannerImageTableMap::COL_PERMANENT, $permanent, $comparison); |
|
696
|
|
|
} |
|
697
|
|
|
|
|
698
|
|
|
/** |
|
699
|
|
|
* Filter the query by a related \xbanners\models\Banners object |
|
700
|
|
|
* |
|
701
|
|
|
* @param \xbanners\models\Banners|ObjectCollection $banners The related object(s) to use as filter |
|
702
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
703
|
|
|
* |
|
704
|
|
|
* @throws \Propel\Runtime\Exception\PropelException |
|
|
|
|
|
|
705
|
|
|
* |
|
706
|
|
|
* @return ChildBannerImageQuery The current query, for fluid interface |
|
707
|
|
|
*/ |
|
708
|
|
View Code Duplication |
public function filterByBanners($banners, $comparison = null) |
|
709
|
|
|
{ |
|
710
|
|
|
if ($banners instanceof \xbanners\models\Banners) { |
|
711
|
|
|
return $this |
|
712
|
|
|
->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->getId(), $comparison); |
|
713
|
|
|
} elseif ($banners instanceof ObjectCollection) { |
|
714
|
|
|
if (null === $comparison) { |
|
715
|
|
|
$comparison = Criteria::IN; |
|
716
|
|
|
} |
|
717
|
|
|
|
|
718
|
|
|
return $this |
|
719
|
|
|
->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->toKeyValue('PrimaryKey', 'Id'), $comparison); |
|
720
|
|
|
} else { |
|
721
|
|
|
throw new PropelException('filterByBanners() only accepts arguments of type \xbanners\models\Banners or Collection'); |
|
722
|
|
|
} |
|
723
|
|
|
} |
|
724
|
|
|
|
|
725
|
|
|
/** |
|
726
|
|
|
* Adds a JOIN clause to the query using the Banners relation |
|
727
|
|
|
* |
|
728
|
|
|
* @param string $relationAlias optional alias for the relation |
|
|
|
|
|
|
729
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
|
730
|
|
|
* |
|
731
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
732
|
|
|
*/ |
|
733
|
|
View Code Duplication |
public function joinBanners($relationAlias = null, $joinType = Criteria::INNER_JOIN) |
|
734
|
|
|
{ |
|
735
|
|
|
$tableMap = $this->getTableMap(); |
|
736
|
|
|
$relationMap = $tableMap->getRelation('Banners'); |
|
737
|
|
|
|
|
738
|
|
|
// create a ModelJoin object for this join |
|
739
|
|
|
$join = new ModelJoin(); |
|
740
|
|
|
$join->setJoinType($joinType); |
|
741
|
|
|
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); |
|
742
|
|
|
if ($previousJoin = $this->getPreviousJoin()) { |
|
743
|
|
|
$join->setPreviousJoin($previousJoin); |
|
|
|
|
|
|
744
|
|
|
} |
|
745
|
|
|
|
|
746
|
|
|
// add the ModelJoin to the current object |
|
747
|
|
|
if ($relationAlias) { |
|
748
|
|
|
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); |
|
749
|
|
|
$this->addJoinObject($join, $relationAlias); |
|
750
|
|
|
} else { |
|
751
|
|
|
$this->addJoinObject($join, 'Banners'); |
|
752
|
|
|
} |
|
753
|
|
|
|
|
754
|
|
|
return $this; |
|
755
|
|
|
} |
|
756
|
|
|
|
|
757
|
|
|
/** |
|
758
|
|
|
* Use the Banners relation Banners object |
|
759
|
|
|
* |
|
760
|
|
|
* @see useQuery() |
|
761
|
|
|
* |
|
762
|
|
|
* @param string $relationAlias optional alias for the relation, |
|
|
|
|
|
|
763
|
|
|
* to be used as main alias in the secondary query |
|
|
|
|
|
|
764
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
|
765
|
|
|
* |
|
766
|
|
|
* @return \xbanners\models\BannersQuery A secondary query class using the current class as primary query |
|
767
|
|
|
*/ |
|
768
|
|
|
public function useBannersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) |
|
769
|
|
|
{ |
|
770
|
|
|
return $this |
|
771
|
|
|
->joinBanners($relationAlias, $joinType) |
|
772
|
|
|
->useQuery($relationAlias ? $relationAlias : 'Banners', '\xbanners\models\BannersQuery'); |
|
773
|
|
|
} |
|
774
|
|
|
|
|
775
|
|
|
/** |
|
776
|
|
|
* Filter the query by a related \xbanners\models\BannerImageI18n object |
|
777
|
|
|
* |
|
778
|
|
|
* @param \xbanners\models\BannerImageI18n|ObjectCollection $bannerImageI18n the related object to use as filter |
|
779
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
|
|
|
|
|
|
780
|
|
|
* |
|
781
|
|
|
* @return ChildBannerImageQuery The current query, for fluid interface |
|
782
|
|
|
*/ |
|
783
|
|
View Code Duplication |
public function filterByBannerImageI18n($bannerImageI18n, $comparison = null) |
|
784
|
|
|
{ |
|
785
|
|
|
if ($bannerImageI18n instanceof \xbanners\models\BannerImageI18n) { |
|
786
|
|
|
return $this |
|
787
|
|
|
->addUsingAlias(BannerImageTableMap::COL_ID, $bannerImageI18n->getId(), $comparison); |
|
788
|
|
|
} elseif ($bannerImageI18n instanceof ObjectCollection) { |
|
789
|
|
|
return $this |
|
790
|
|
|
->useBannerImageI18nQuery() |
|
791
|
|
|
->filterByPrimaryKeys($bannerImageI18n->getPrimaryKeys()) |
|
792
|
|
|
->endUse(); |
|
793
|
|
|
} else { |
|
794
|
|
|
throw new PropelException('filterByBannerImageI18n() only accepts arguments of type \xbanners\models\BannerImageI18n or Collection'); |
|
795
|
|
|
} |
|
796
|
|
|
} |
|
797
|
|
|
|
|
798
|
|
|
/** |
|
799
|
|
|
* Adds a JOIN clause to the query using the BannerImageI18n relation |
|
800
|
|
|
* |
|
801
|
|
|
* @param string $relationAlias optional alias for the relation |
|
|
|
|
|
|
802
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
|
803
|
|
|
* |
|
804
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
805
|
|
|
*/ |
|
806
|
|
View Code Duplication |
public function joinBannerImageI18n($relationAlias = null, $joinType = 'LEFT JOIN') |
|
807
|
|
|
{ |
|
808
|
|
|
$tableMap = $this->getTableMap(); |
|
809
|
|
|
$relationMap = $tableMap->getRelation('BannerImageI18n'); |
|
810
|
|
|
|
|
811
|
|
|
// create a ModelJoin object for this join |
|
812
|
|
|
$join = new ModelJoin(); |
|
813
|
|
|
$join->setJoinType($joinType); |
|
814
|
|
|
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); |
|
815
|
|
|
if ($previousJoin = $this->getPreviousJoin()) { |
|
816
|
|
|
$join->setPreviousJoin($previousJoin); |
|
|
|
|
|
|
817
|
|
|
} |
|
818
|
|
|
|
|
819
|
|
|
// add the ModelJoin to the current object |
|
820
|
|
|
if ($relationAlias) { |
|
821
|
|
|
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); |
|
822
|
|
|
$this->addJoinObject($join, $relationAlias); |
|
823
|
|
|
} else { |
|
824
|
|
|
$this->addJoinObject($join, 'BannerImageI18n'); |
|
825
|
|
|
} |
|
826
|
|
|
|
|
827
|
|
|
return $this; |
|
828
|
|
|
} |
|
829
|
|
|
|
|
830
|
|
|
/** |
|
831
|
|
|
* Use the BannerImageI18n relation BannerImageI18n object |
|
832
|
|
|
* |
|
833
|
|
|
* @see useQuery() |
|
834
|
|
|
* |
|
835
|
|
|
* @param string $relationAlias optional alias for the relation, |
|
|
|
|
|
|
836
|
|
|
* to be used as main alias in the secondary query |
|
|
|
|
|
|
837
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
|
838
|
|
|
* |
|
839
|
|
|
* @return \xbanners\models\BannerImageI18nQuery A secondary query class using the current class as primary query |
|
840
|
|
|
*/ |
|
841
|
|
|
public function useBannerImageI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN') |
|
842
|
|
|
{ |
|
843
|
|
|
return $this |
|
844
|
|
|
->joinBannerImageI18n($relationAlias, $joinType) |
|
845
|
|
|
->useQuery($relationAlias ? $relationAlias : 'BannerImageI18n', '\xbanners\models\BannerImageI18nQuery'); |
|
846
|
|
|
} |
|
847
|
|
|
|
|
848
|
|
|
/** |
|
849
|
|
|
* Exclude object from result |
|
850
|
|
|
* |
|
851
|
|
|
* @param ChildBannerImage $bannerImage Object to remove from the list of results |
|
|
|
|
|
|
852
|
|
|
* |
|
853
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
854
|
|
|
*/ |
|
855
|
|
|
public function prune($bannerImage = null) |
|
856
|
|
|
{ |
|
857
|
|
|
if ($bannerImage) { |
|
858
|
|
|
$this->addUsingAlias(BannerImageTableMap::COL_ID, $bannerImage->getId(), Criteria::NOT_EQUAL); |
|
859
|
|
|
} |
|
860
|
|
|
|
|
861
|
|
|
return $this; |
|
862
|
|
|
} |
|
863
|
|
|
|
|
864
|
|
|
/** |
|
865
|
|
|
* Deletes all rows from the banner_image table. |
|
866
|
|
|
* |
|
867
|
|
|
* @param ConnectionInterface $con the connection to use |
|
|
|
|
|
|
868
|
|
|
* @return int The number of affected rows (if supported by underlying database driver). |
|
869
|
|
|
*/ |
|
870
|
|
View Code Duplication |
public function doDeleteAll(ConnectionInterface $con = null) |
|
871
|
|
|
{ |
|
872
|
|
|
if (null === $con) { |
|
873
|
|
|
$con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME); |
|
874
|
|
|
} |
|
875
|
|
|
|
|
876
|
|
|
// use transaction because $criteria could contain info |
|
877
|
|
|
// for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
878
|
|
|
return $con->transaction(function () use ($con) { |
|
879
|
|
|
$affectedRows = 0; // initialize var to track total num of affected rows |
|
880
|
|
|
$affectedRows += $this->doOnDeleteCascade($con); |
|
881
|
|
|
$affectedRows += parent::doDeleteAll($con); |
|
882
|
|
|
// Because this db requires some delete cascade/set null emulation, we have to |
|
883
|
|
|
// clear the cached instance *after* the emulation has happened (since |
|
884
|
|
|
// instances get re-added by the select statement contained therein). |
|
885
|
|
|
BannerImageTableMap::clearInstancePool(); |
|
886
|
|
|
BannerImageTableMap::clearRelatedInstancePool(); |
|
887
|
|
|
|
|
888
|
|
|
return $affectedRows; |
|
889
|
|
|
}); |
|
890
|
|
|
} |
|
891
|
|
|
|
|
892
|
|
|
/** |
|
893
|
|
|
* Performs a DELETE on the database based on the current ModelCriteria |
|
894
|
|
|
* |
|
895
|
|
|
* @param ConnectionInterface $con the connection to use |
|
|
|
|
|
|
896
|
|
|
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows |
|
897
|
|
|
* if supported by native driver or if emulated using Propel. |
|
898
|
|
|
* @throws PropelException Any exceptions caught during processing will be |
|
899
|
|
|
* rethrown wrapped into a PropelException. |
|
|
|
|
|
|
900
|
|
|
*/ |
|
901
|
|
View Code Duplication |
public function delete(ConnectionInterface $con = null) |
|
902
|
|
|
{ |
|
903
|
|
|
if (null === $con) { |
|
904
|
|
|
$con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME); |
|
905
|
|
|
} |
|
906
|
|
|
|
|
907
|
|
|
$criteria = $this; |
|
908
|
|
|
|
|
909
|
|
|
// Set the correct dbName |
|
910
|
|
|
$criteria->setDbName(BannerImageTableMap::DATABASE_NAME); |
|
911
|
|
|
|
|
912
|
|
|
// use transaction because $criteria could contain info |
|
913
|
|
|
// for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
914
|
|
|
return $con->transaction(function () use ($con, $criteria) { |
|
915
|
|
|
$affectedRows = 0; // initialize var to track total num of affected rows |
|
916
|
|
|
|
|
917
|
|
|
// cloning the Criteria in case it's modified by doSelect() or doSelectStmt() |
|
918
|
|
|
$c = clone $criteria; |
|
919
|
|
|
$affectedRows += $c->doOnDeleteCascade($con); |
|
920
|
|
|
|
|
921
|
|
|
BannerImageTableMap::removeInstanceFromPool($criteria); |
|
922
|
|
|
|
|
923
|
|
|
$affectedRows += ModelCriteria::delete($con); |
|
924
|
|
|
BannerImageTableMap::clearRelatedInstancePool(); |
|
925
|
|
|
|
|
926
|
|
|
return $affectedRows; |
|
927
|
|
|
}); |
|
928
|
|
|
} |
|
929
|
|
|
|
|
930
|
|
|
/** |
|
931
|
|
|
* This is a method for emulating ON DELETE CASCADE for DBs that don't support this |
|
932
|
|
|
* feature (like MySQL or SQLite). |
|
933
|
|
|
* |
|
934
|
|
|
* This method is not very speedy because it must perform a query first to get |
|
935
|
|
|
* the implicated records and then perform the deletes by calling those Query classes. |
|
936
|
|
|
* |
|
937
|
|
|
* This method should be used within a transaction if possible. |
|
938
|
|
|
* |
|
939
|
|
|
* @param ConnectionInterface $con |
|
940
|
|
|
* @return int The number of affected rows (if supported by underlying database driver). |
|
941
|
|
|
*/ |
|
942
|
|
|
protected function doOnDeleteCascade(ConnectionInterface $con) |
|
943
|
|
|
{ |
|
944
|
|
|
// initialize var to track total num of affected rows |
|
945
|
|
|
$affectedRows = 0; |
|
946
|
|
|
|
|
947
|
|
|
// first find the objects that are implicated by the $this |
|
948
|
|
|
$objects = ChildBannerImageQuery::create(null, $this)->find($con); |
|
949
|
|
|
foreach ($objects as $obj) { |
|
950
|
|
|
|
|
|
|
|
|
|
951
|
|
|
|
|
952
|
|
|
// delete related BannerImageI18n objects |
|
953
|
|
|
$query = new \xbanners\models\BannerImageI18nQuery; |
|
|
|
|
|
|
954
|
|
|
|
|
955
|
|
|
$query->add(BannerImageI18nTableMap::COL_ID, $obj->getId()); |
|
956
|
|
|
$affectedRows += $query->delete($con); |
|
957
|
|
|
} |
|
958
|
|
|
|
|
959
|
|
|
return $affectedRows; |
|
960
|
|
|
} |
|
961
|
|
|
|
|
962
|
|
|
// i18n behavior |
|
963
|
|
|
|
|
964
|
|
|
/** |
|
965
|
|
|
* Adds a JOIN clause to the query using the i18n relation |
|
966
|
|
|
* |
|
967
|
|
|
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR' |
|
968
|
|
|
* @param string $relationAlias optional alias for the relation |
|
|
|
|
|
|
969
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. |
|
970
|
|
|
* |
|
971
|
|
|
* @return ChildBannerImageQuery The current query, for fluid interface |
|
972
|
|
|
*/ |
|
973
|
|
View Code Duplication |
public function joinI18n($locale = 'ru', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) |
|
974
|
|
|
{ |
|
975
|
|
|
$relationName = $relationAlias ? $relationAlias : 'BannerImageI18n'; |
|
976
|
|
|
|
|
977
|
|
|
return $this |
|
978
|
|
|
->joinBannerImageI18n($relationAlias, $joinType) |
|
979
|
|
|
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); |
|
980
|
|
|
} |
|
981
|
|
|
|
|
982
|
|
|
/** |
|
983
|
|
|
* Adds a JOIN clause to the query and hydrates the related I18n object. |
|
984
|
|
|
* Shortcut for $c->joinI18n($locale)->with() |
|
985
|
|
|
* |
|
986
|
|
|
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR' |
|
987
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. |
|
988
|
|
|
* |
|
989
|
|
|
* @return $this|ChildBannerImageQuery The current query, for fluid interface |
|
|
|
|
|
|
990
|
|
|
*/ |
|
991
|
|
View Code Duplication |
public function joinWithI18n($locale = 'ru', $joinType = Criteria::LEFT_JOIN) |
|
992
|
|
|
{ |
|
993
|
|
|
$this |
|
994
|
|
|
->joinI18n($locale, null, $joinType) |
|
995
|
|
|
->with('BannerImageI18n'); |
|
996
|
|
|
$this->with['BannerImageI18n']->setIsWithOneToMany(false); |
|
997
|
|
|
|
|
998
|
|
|
return $this; |
|
999
|
|
|
} |
|
1000
|
|
|
|
|
1001
|
|
|
/** |
|
1002
|
|
|
* Use the I18n relation query object |
|
1003
|
|
|
* |
|
1004
|
|
|
* @see useQuery() |
|
1005
|
|
|
* |
|
1006
|
|
|
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR' |
|
|
|
|
|
|
1007
|
|
|
* @param string $relationAlias optional alias for the relation |
|
|
|
|
|
|
1008
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. |
|
1009
|
|
|
* |
|
1010
|
|
|
* @return ChildBannerImageI18nQuery A secondary query class using the current class as primary query |
|
1011
|
|
|
*/ |
|
1012
|
|
|
public function useI18nQuery($locale = 'ru', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) |
|
1013
|
|
|
{ |
|
1014
|
|
|
return $this |
|
1015
|
|
|
->joinI18n($locale, $relationAlias, $joinType) |
|
1016
|
|
|
->useQuery($relationAlias ? $relationAlias : 'BannerImageI18n', '\xbanners\models\BannerImageI18nQuery'); |
|
1017
|
|
|
} |
|
1018
|
|
|
|
|
1019
|
|
|
} // BannerImageQuery |
|
|
|
|
|
|
1020
|
|
|
|