1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace mod_link\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 mod_link\models\PageLink as ChildPageLink; |
15
|
|
|
use mod_link\models\PageLinkQuery as ChildPageLinkQuery; |
16
|
|
|
use mod_link\models\Map\PageLinkTableMap; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Base class that represents a query for the 'page_link' table. |
20
|
|
|
* |
21
|
|
|
* |
22
|
|
|
* |
23
|
|
|
* @method ChildPageLinkQuery orderById($order = Criteria::ASC) Order by the id column |
24
|
|
|
* @method ChildPageLinkQuery orderByPageId($order = Criteria::ASC) Order by the page_id column |
25
|
|
|
* @method ChildPageLinkQuery orderByActiveFrom($order = Criteria::ASC) Order by the active_from column |
26
|
|
|
* @method ChildPageLinkQuery orderByActiveTo($order = Criteria::ASC) Order by the active_to column |
27
|
|
|
* @method ChildPageLinkQuery orderByShowOn($order = Criteria::ASC) Order by the show_on column |
28
|
|
|
* @method ChildPageLinkQuery orderByPermanent($order = Criteria::ASC) Order by the permanent column |
29
|
|
|
* |
30
|
|
|
* @method ChildPageLinkQuery groupById() Group by the id column |
31
|
|
|
* @method ChildPageLinkQuery groupByPageId() Group by the page_id column |
32
|
|
|
* @method ChildPageLinkQuery groupByActiveFrom() Group by the active_from column |
33
|
|
|
* @method ChildPageLinkQuery groupByActiveTo() Group by the active_to column |
34
|
|
|
* @method ChildPageLinkQuery groupByShowOn() Group by the show_on column |
35
|
|
|
* @method ChildPageLinkQuery groupByPermanent() Group by the permanent column |
36
|
|
|
* |
37
|
|
|
* @method ChildPageLinkQuery leftJoin($relation) Adds a LEFT JOIN clause to the query |
38
|
|
|
* @method ChildPageLinkQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query |
39
|
|
|
* @method ChildPageLinkQuery innerJoin($relation) Adds a INNER JOIN clause to the query |
40
|
|
|
* |
41
|
|
|
* @method ChildPageLinkQuery leftJoinWith($relation) Adds a LEFT JOIN clause and with to the query |
42
|
|
|
* @method ChildPageLinkQuery rightJoinWith($relation) Adds a RIGHT JOIN clause and with to the query |
43
|
|
|
* @method ChildPageLinkQuery innerJoinWith($relation) Adds a INNER JOIN clause and with to the query |
44
|
|
|
* |
45
|
|
|
* @method ChildPageLinkQuery leftJoinPageLinkProduct($relationAlias = null) Adds a LEFT JOIN clause to the query using the PageLinkProduct relation |
46
|
|
|
* @method ChildPageLinkQuery rightJoinPageLinkProduct($relationAlias = null) Adds a RIGHT JOIN clause to the query using the PageLinkProduct relation |
47
|
|
|
* @method ChildPageLinkQuery innerJoinPageLinkProduct($relationAlias = null) Adds a INNER JOIN clause to the query using the PageLinkProduct relation |
48
|
|
|
* |
49
|
|
|
* @method ChildPageLinkQuery joinWithPageLinkProduct($joinType = Criteria::INNER_JOIN) Adds a join clause and with to the query using the PageLinkProduct relation |
50
|
|
|
* |
51
|
|
|
* @method ChildPageLinkQuery leftJoinWithPageLinkProduct() Adds a LEFT JOIN clause and with to the query using the PageLinkProduct relation |
52
|
|
|
* @method ChildPageLinkQuery rightJoinWithPageLinkProduct() Adds a RIGHT JOIN clause and with to the query using the PageLinkProduct relation |
53
|
|
|
* @method ChildPageLinkQuery innerJoinWithPageLinkProduct() Adds a INNER JOIN clause and with to the query using the PageLinkProduct relation |
54
|
|
|
* |
55
|
|
|
* @method \mod_link\models\PageLinkProductQuery endUse() Finalizes a secondary criteria and merges it with its primary Criteria |
56
|
|
|
* |
57
|
|
|
* @method ChildPageLink findOne(ConnectionInterface $con = null) Return the first ChildPageLink matching the query |
58
|
|
|
* @method ChildPageLink findOneOrCreate(ConnectionInterface $con = null) Return the first ChildPageLink matching the query, or a new ChildPageLink object populated from the query conditions when no match is found |
59
|
|
|
* |
60
|
|
|
* @method ChildPageLink findOneById(int $id) Return the first ChildPageLink filtered by the id column |
61
|
|
|
* @method ChildPageLink findOneByPageId(int $page_id) Return the first ChildPageLink filtered by the page_id column |
62
|
|
|
* @method ChildPageLink findOneByActiveFrom(int $active_from) Return the first ChildPageLink filtered by the active_from column |
63
|
|
|
* @method ChildPageLink findOneByActiveTo(int $active_to) Return the first ChildPageLink filtered by the active_to column |
64
|
|
|
* @method ChildPageLink findOneByShowOn(boolean $show_on) Return the first ChildPageLink filtered by the show_on column |
65
|
|
|
* @method ChildPageLink findOneByPermanent(boolean $permanent) Return the first ChildPageLink filtered by the permanent column * |
66
|
|
|
|
67
|
|
|
* @method ChildPageLink requirePk($key, ConnectionInterface $con = null) Return the ChildPageLink by primary key and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
68
|
|
|
* @method ChildPageLink requireOne(ConnectionInterface $con = null) Return the first ChildPageLink matching the query and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
69
|
|
|
* |
70
|
|
|
* @method ChildPageLink requireOneById(int $id) Return the first ChildPageLink filtered by the id column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
71
|
|
|
* @method ChildPageLink requireOneByPageId(int $page_id) Return the first ChildPageLink filtered by the page_id column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
72
|
|
|
* @method ChildPageLink requireOneByActiveFrom(int $active_from) Return the first ChildPageLink filtered by the active_from column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
73
|
|
|
* @method ChildPageLink requireOneByActiveTo(int $active_to) Return the first ChildPageLink filtered by the active_to column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
74
|
|
|
* @method ChildPageLink requireOneByShowOn(boolean $show_on) Return the first ChildPageLink filtered by the show_on column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
75
|
|
|
* @method ChildPageLink requireOneByPermanent(boolean $permanent) Return the first ChildPageLink filtered by the permanent column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
76
|
|
|
* |
77
|
|
|
* @method ChildPageLink[]|ObjectCollection find(ConnectionInterface $con = null) Return ChildPageLink objects based on current ModelCriteria |
78
|
|
|
* @method ChildPageLink[]|ObjectCollection findById(int $id) Return ChildPageLink objects filtered by the id column |
79
|
|
|
* @method ChildPageLink[]|ObjectCollection findByPageId(int $page_id) Return ChildPageLink objects filtered by the page_id column |
80
|
|
|
* @method ChildPageLink[]|ObjectCollection findByActiveFrom(int $active_from) Return ChildPageLink objects filtered by the active_from column |
81
|
|
|
* @method ChildPageLink[]|ObjectCollection findByActiveTo(int $active_to) Return ChildPageLink objects filtered by the active_to column |
82
|
|
|
* @method ChildPageLink[]|ObjectCollection findByShowOn(boolean $show_on) Return ChildPageLink objects filtered by the show_on column |
83
|
|
|
* @method ChildPageLink[]|ObjectCollection findByPermanent(boolean $permanent) Return ChildPageLink objects filtered by the permanent column |
84
|
|
|
* @method ChildPageLink[]|\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 |
85
|
|
|
* |
86
|
|
|
*/ |
|
|
|
|
87
|
|
|
abstract class PageLinkQuery extends ModelCriteria |
88
|
|
|
{ |
|
|
|
|
89
|
|
|
protected $entityNotFoundExceptionClass = '\\Propel\\Runtime\\Exception\\EntityNotFoundException'; |
|
|
|
|
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Initializes internal state of \mod_link\models\Base\PageLinkQuery object. |
93
|
|
|
* |
94
|
|
|
* @param string $dbName The database name |
95
|
|
|
* @param string $modelName The phpName of a model, e.g. 'Book' |
96
|
|
|
* @param string $modelAlias The alias for the model in this query, e.g. 'b' |
97
|
|
|
*/ |
98
|
|
|
public function __construct($dbName = 'Shop', $modelName = '\\mod_link\\models\\PageLink', $modelAlias = null) |
99
|
|
|
{ |
100
|
|
|
parent::__construct($dbName, $modelName, $modelAlias); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Returns a new ChildPageLinkQuery object. |
105
|
|
|
* |
106
|
|
|
* @param string $modelAlias The alias of a model in the query |
107
|
|
|
* @param Criteria $criteria Optional Criteria to build the query from |
108
|
|
|
* |
109
|
|
|
* @return ChildPageLinkQuery |
110
|
|
|
*/ |
111
|
|
|
public static function create($modelAlias = null, Criteria $criteria = null) |
112
|
|
|
{ |
113
|
|
|
if ($criteria instanceof ChildPageLinkQuery) { |
114
|
|
|
return $criteria; |
115
|
|
|
} |
116
|
|
|
$query = new ChildPageLinkQuery(); |
117
|
|
|
if (null !== $modelAlias) { |
118
|
|
|
$query->setModelAlias($modelAlias); |
119
|
|
|
} |
120
|
|
|
if ($criteria instanceof Criteria) { |
121
|
|
|
$query->mergeWith($criteria); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
return $query; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Find object by primary key. |
129
|
|
|
* Propel uses the instance pool to skip the database if the object exists. |
130
|
|
|
* Go fast if the query is untouched. |
131
|
|
|
* |
132
|
|
|
* <code> |
|
|
|
|
133
|
|
|
* $obj = $c->findPk(12, $con); |
134
|
|
|
* </code> |
135
|
|
|
* |
136
|
|
|
* @param mixed $key Primary key to use for the query |
137
|
|
|
* @param ConnectionInterface $con an optional connection object |
138
|
|
|
* |
139
|
|
|
* @return ChildPageLink|array|mixed the result, formatted by the current formatter |
140
|
|
|
*/ |
141
|
|
View Code Duplication |
public function findPk($key, ConnectionInterface $con = null) |
142
|
|
|
{ |
143
|
|
|
if ($key === null) { |
144
|
|
|
return null; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
if ($con === null) { |
148
|
|
|
$con = Propel::getServiceContainer()->getReadConnection(PageLinkTableMap::DATABASE_NAME); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
$this->basePreSelect($con); |
152
|
|
|
|
153
|
|
|
if ( |
|
|
|
|
154
|
|
|
$this->formatter || $this->modelAlias || $this->with || $this->select |
|
|
|
|
155
|
|
|
|| $this->selectColumns || $this->asColumns || $this->selectModifiers |
156
|
|
|
|| $this->map || $this->having || $this->joins |
157
|
|
|
) { |
158
|
|
|
return $this->findPkComplex($key, $con); |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
if ((null !== ($obj = PageLinkTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) { |
162
|
|
|
// the object is already in the instance pool |
163
|
|
|
return $obj; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
return $this->findPkSimple($key, $con); |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Find object by primary key using raw SQL to go fast. |
171
|
|
|
* Bypass doSelect() and the object formatter by using generated code. |
172
|
|
|
* |
173
|
|
|
* @param mixed $key Primary key to use for the query |
174
|
|
|
* @param ConnectionInterface $con A connection object |
175
|
|
|
* |
176
|
|
|
* @throws \Propel\Runtime\Exception\PropelException |
|
|
|
|
177
|
|
|
* |
178
|
|
|
* @return ChildPageLink A model object, or null if the key is not found |
|
|
|
|
179
|
|
|
*/ |
180
|
|
|
protected function findPkSimple($key, ConnectionInterface $con) |
181
|
|
|
{ |
182
|
|
|
$sql = 'SELECT id, page_id, active_from, active_to, show_on, permanent FROM page_link WHERE id = :p0'; |
183
|
|
|
try { |
184
|
|
|
$stmt = $con->prepare($sql); |
185
|
|
|
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); |
186
|
|
|
$stmt->execute(); |
187
|
|
|
} catch (Exception $e) { |
188
|
|
|
Propel::log($e->getMessage(), Propel::LOG_ERR); |
189
|
|
|
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e); |
190
|
|
|
} |
191
|
|
|
$obj = null; |
192
|
|
|
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) { |
193
|
|
|
/** @var ChildPageLink $obj */ |
194
|
|
|
$obj = new ChildPageLink(); |
195
|
|
|
$obj->hydrate($row); |
196
|
|
|
PageLinkTableMap::addInstanceToPool($obj, null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key); |
197
|
|
|
} |
198
|
|
|
$stmt->closeCursor(); |
199
|
|
|
|
200
|
|
|
return $obj; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* Find object by primary key. |
205
|
|
|
* |
206
|
|
|
* @param mixed $key Primary key to use for the query |
207
|
|
|
* @param ConnectionInterface $con A connection object |
208
|
|
|
* |
209
|
|
|
* @return ChildPageLink|array|mixed the result, formatted by the current formatter |
210
|
|
|
*/ |
211
|
|
|
protected function findPkComplex($key, ConnectionInterface $con) |
212
|
|
|
{ |
213
|
|
|
// As the query uses a PK condition, no limit(1) is necessary. |
214
|
|
|
$criteria = $this->isKeepQuery() ? clone $this : $this; |
215
|
|
|
$dataFetcher = $criteria |
216
|
|
|
->filterByPrimaryKey($key) |
217
|
|
|
->doSelect($con); |
218
|
|
|
|
219
|
|
|
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher); |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* Find objects by primary key |
224
|
|
|
* <code> |
225
|
|
|
* $objs = $c->findPks(array(12, 56, 832), $con); |
226
|
|
|
* </code> |
227
|
|
|
* @param array $keys Primary keys to use for the query |
228
|
|
|
* @param ConnectionInterface $con an optional connection object |
229
|
|
|
* |
230
|
|
|
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter |
231
|
|
|
*/ |
232
|
|
|
public function findPks($keys, ConnectionInterface $con = null) |
233
|
|
|
{ |
234
|
|
|
if (null === $con) { |
235
|
|
|
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName()); |
236
|
|
|
} |
237
|
|
|
$this->basePreSelect($con); |
238
|
|
|
$criteria = $this->isKeepQuery() ? clone $this : $this; |
239
|
|
|
$dataFetcher = $criteria |
240
|
|
|
->filterByPrimaryKeys($keys) |
241
|
|
|
->doSelect($con); |
242
|
|
|
|
243
|
|
|
return $criteria->getFormatter()->init($criteria)->format($dataFetcher); |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* Filter the query by primary key |
248
|
|
|
* |
249
|
|
|
* @param mixed $key Primary key to use for the query |
250
|
|
|
* |
251
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
252
|
|
|
*/ |
253
|
|
|
public function filterByPrimaryKey($key) |
254
|
|
|
{ |
255
|
|
|
|
256
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_ID, $key, Criteria::EQUAL); |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* Filter the query by a list of primary keys |
261
|
|
|
* |
262
|
|
|
* @param array $keys The list of primary key to use for the query |
263
|
|
|
* |
264
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
265
|
|
|
*/ |
266
|
|
|
public function filterByPrimaryKeys($keys) |
267
|
|
|
{ |
268
|
|
|
|
269
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_ID, $keys, Criteria::IN); |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* Filter the query on the id column |
274
|
|
|
* |
275
|
|
|
* Example usage: |
276
|
|
|
* <code> |
277
|
|
|
* $query->filterById(1234); // WHERE id = 1234 |
278
|
|
|
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34) |
279
|
|
|
* $query->filterById(array('min' => 12)); // WHERE id > 12 |
280
|
|
|
* </code> |
281
|
|
|
* |
282
|
|
|
* @param mixed $id The value to use as filter. |
283
|
|
|
* Use scalar values for equality. |
284
|
|
|
* Use array values for in_array() equivalent. |
285
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
286
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
287
|
|
|
* |
288
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
289
|
|
|
*/ |
290
|
|
|
public function filterById($id = null, $comparison = null) |
291
|
|
|
{ |
292
|
|
|
if (is_array($id)) { |
293
|
|
|
$useMinMax = false; |
294
|
|
|
if (isset($id['min'])) { |
295
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL); |
296
|
|
|
$useMinMax = true; |
297
|
|
|
} |
298
|
|
|
if (isset($id['max'])) { |
299
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL); |
300
|
|
|
$useMinMax = true; |
301
|
|
|
} |
302
|
|
|
if ($useMinMax) { |
303
|
|
|
return $this; |
304
|
|
|
} |
305
|
|
|
if (null === $comparison) { |
306
|
|
|
$comparison = Criteria::IN; |
307
|
|
|
} |
308
|
|
|
} |
309
|
|
|
|
310
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_ID, $id, $comparison); |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* Filter the query on the page_id column |
315
|
|
|
* |
316
|
|
|
* Example usage: |
317
|
|
|
* <code> |
318
|
|
|
* $query->filterByPageId(1234); // WHERE page_id = 1234 |
319
|
|
|
* $query->filterByPageId(array(12, 34)); // WHERE page_id IN (12, 34) |
320
|
|
|
* $query->filterByPageId(array('min' => 12)); // WHERE page_id > 12 |
321
|
|
|
* </code> |
322
|
|
|
* |
323
|
|
|
* @param mixed $pageId The value to use as filter. |
324
|
|
|
* Use scalar values for equality. |
325
|
|
|
* Use array values for in_array() equivalent. |
326
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
327
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
328
|
|
|
* |
329
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
330
|
|
|
*/ |
331
|
|
|
public function filterByPageId($pageId = null, $comparison = null) |
332
|
|
|
{ |
333
|
|
|
if (is_array($pageId)) { |
334
|
|
|
$useMinMax = false; |
335
|
|
|
if (isset($pageId['min'])) { |
336
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_PAGE_ID, $pageId['min'], Criteria::GREATER_EQUAL); |
337
|
|
|
$useMinMax = true; |
338
|
|
|
} |
339
|
|
|
if (isset($pageId['max'])) { |
340
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_PAGE_ID, $pageId['max'], Criteria::LESS_EQUAL); |
341
|
|
|
$useMinMax = true; |
342
|
|
|
} |
343
|
|
|
if ($useMinMax) { |
344
|
|
|
return $this; |
345
|
|
|
} |
346
|
|
|
if (null === $comparison) { |
347
|
|
|
$comparison = Criteria::IN; |
348
|
|
|
} |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_PAGE_ID, $pageId, $comparison); |
352
|
|
|
} |
353
|
|
|
|
354
|
|
|
/** |
355
|
|
|
* Filter the query on the active_from column |
356
|
|
|
* |
357
|
|
|
* Example usage: |
358
|
|
|
* <code> |
359
|
|
|
* $query->filterByActiveFrom(1234); // WHERE active_from = 1234 |
360
|
|
|
* $query->filterByActiveFrom(array(12, 34)); // WHERE active_from IN (12, 34) |
361
|
|
|
* $query->filterByActiveFrom(array('min' => 12)); // WHERE active_from > 12 |
362
|
|
|
* </code> |
363
|
|
|
* |
364
|
|
|
* @param mixed $activeFrom The value to use as filter. |
365
|
|
|
* Use scalar values for equality. |
366
|
|
|
* Use array values for in_array() equivalent. |
367
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
368
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
369
|
|
|
* |
370
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
371
|
|
|
*/ |
372
|
|
|
public function filterByActiveFrom($activeFrom = null, $comparison = null) |
373
|
|
|
{ |
374
|
|
|
if (is_array($activeFrom)) { |
375
|
|
|
$useMinMax = false; |
376
|
|
|
if (isset($activeFrom['min'])) { |
377
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_FROM, $activeFrom['min'], Criteria::GREATER_EQUAL); |
378
|
|
|
$useMinMax = true; |
379
|
|
|
} |
380
|
|
|
if (isset($activeFrom['max'])) { |
381
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_FROM, $activeFrom['max'], Criteria::LESS_EQUAL); |
382
|
|
|
$useMinMax = true; |
383
|
|
|
} |
384
|
|
|
if ($useMinMax) { |
385
|
|
|
return $this; |
386
|
|
|
} |
387
|
|
|
if (null === $comparison) { |
388
|
|
|
$comparison = Criteria::IN; |
389
|
|
|
} |
390
|
|
|
} |
391
|
|
|
|
392
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_FROM, $activeFrom, $comparison); |
393
|
|
|
} |
394
|
|
|
|
395
|
|
|
/** |
396
|
|
|
* Filter the query on the active_to column |
397
|
|
|
* |
398
|
|
|
* Example usage: |
399
|
|
|
* <code> |
400
|
|
|
* $query->filterByActiveTo(1234); // WHERE active_to = 1234 |
401
|
|
|
* $query->filterByActiveTo(array(12, 34)); // WHERE active_to IN (12, 34) |
402
|
|
|
* $query->filterByActiveTo(array('min' => 12)); // WHERE active_to > 12 |
403
|
|
|
* </code> |
404
|
|
|
* |
405
|
|
|
* @param mixed $activeTo The value to use as filter. |
406
|
|
|
* Use scalar values for equality. |
407
|
|
|
* Use array values for in_array() equivalent. |
408
|
|
|
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
409
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
410
|
|
|
* |
411
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
412
|
|
|
*/ |
413
|
|
|
public function filterByActiveTo($activeTo = null, $comparison = null) |
414
|
|
|
{ |
415
|
|
|
if (is_array($activeTo)) { |
416
|
|
|
$useMinMax = false; |
417
|
|
|
if (isset($activeTo['min'])) { |
418
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_TO, $activeTo['min'], Criteria::GREATER_EQUAL); |
419
|
|
|
$useMinMax = true; |
420
|
|
|
} |
421
|
|
|
if (isset($activeTo['max'])) { |
422
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_TO, $activeTo['max'], Criteria::LESS_EQUAL); |
423
|
|
|
$useMinMax = true; |
424
|
|
|
} |
425
|
|
|
if ($useMinMax) { |
426
|
|
|
return $this; |
427
|
|
|
} |
428
|
|
|
if (null === $comparison) { |
429
|
|
|
$comparison = Criteria::IN; |
430
|
|
|
} |
431
|
|
|
} |
432
|
|
|
|
433
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_ACTIVE_TO, $activeTo, $comparison); |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* Filter the query on the show_on column |
438
|
|
|
* |
439
|
|
|
* Example usage: |
440
|
|
|
* <code> |
441
|
|
|
* $query->filterByShowOn(true); // WHERE show_on = true |
442
|
|
|
* $query->filterByShowOn('yes'); // WHERE show_on = true |
443
|
|
|
* </code> |
444
|
|
|
* |
445
|
|
|
* @param boolean|string $showOn The value to use as filter. |
446
|
|
|
* Non-boolean arguments are converted using the following rules: |
447
|
|
|
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true |
448
|
|
|
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false |
449
|
|
|
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). |
450
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
451
|
|
|
* |
452
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
453
|
|
|
*/ |
454
|
|
View Code Duplication |
public function filterByShowOn($showOn = null, $comparison = null) |
455
|
|
|
{ |
456
|
|
|
if (is_string($showOn)) { |
457
|
|
|
$showOn = in_array(strtolower($showOn), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; |
|
|
|
|
458
|
|
|
} |
459
|
|
|
|
460
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_SHOW_ON, $showOn, $comparison); |
461
|
|
|
} |
462
|
|
|
|
463
|
|
|
/** |
464
|
|
|
* Filter the query on the permanent column |
465
|
|
|
* |
466
|
|
|
* Example usage: |
467
|
|
|
* <code> |
468
|
|
|
* $query->filterByPermanent(true); // WHERE permanent = true |
469
|
|
|
* $query->filterByPermanent('yes'); // WHERE permanent = true |
470
|
|
|
* </code> |
471
|
|
|
* |
472
|
|
|
* @param boolean|string $permanent The value to use as filter. |
473
|
|
|
* Non-boolean arguments are converted using the following rules: |
474
|
|
|
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true |
475
|
|
|
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false |
476
|
|
|
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). |
477
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
478
|
|
|
* |
479
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
480
|
|
|
*/ |
481
|
|
View Code Duplication |
public function filterByPermanent($permanent = null, $comparison = null) |
482
|
|
|
{ |
483
|
|
|
if (is_string($permanent)) { |
484
|
|
|
$permanent = in_array(strtolower($permanent), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; |
|
|
|
|
485
|
|
|
} |
486
|
|
|
|
487
|
|
|
return $this->addUsingAlias(PageLinkTableMap::COL_PERMANENT, $permanent, $comparison); |
488
|
|
|
} |
489
|
|
|
|
490
|
|
|
/** |
491
|
|
|
* Filter the query by a related \mod_link\models\PageLinkProduct object |
492
|
|
|
* |
493
|
|
|
* @param \mod_link\models\PageLinkProduct|ObjectCollection $pageLinkProduct the related object to use as filter |
494
|
|
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
495
|
|
|
* |
496
|
|
|
* @return ChildPageLinkQuery The current query, for fluid interface |
497
|
|
|
*/ |
498
|
|
View Code Duplication |
public function filterByPageLinkProduct($pageLinkProduct, $comparison = null) |
499
|
|
|
{ |
500
|
|
|
if ($pageLinkProduct instanceof \mod_link\models\PageLinkProduct) { |
501
|
|
|
return $this |
502
|
|
|
->addUsingAlias(PageLinkTableMap::COL_ID, $pageLinkProduct->getLinkId(), $comparison); |
503
|
|
|
} elseif ($pageLinkProduct instanceof ObjectCollection) { |
504
|
|
|
return $this |
505
|
|
|
->usePageLinkProductQuery() |
506
|
|
|
->filterByPrimaryKeys($pageLinkProduct->getPrimaryKeys()) |
507
|
|
|
->endUse(); |
508
|
|
|
} else { |
509
|
|
|
throw new PropelException('filterByPageLinkProduct() only accepts arguments of type \mod_link\models\PageLinkProduct or Collection'); |
510
|
|
|
} |
511
|
|
|
} |
512
|
|
|
|
513
|
|
|
/** |
514
|
|
|
* Adds a JOIN clause to the query using the PageLinkProduct relation |
515
|
|
|
* |
516
|
|
|
* @param string $relationAlias optional alias for the relation |
517
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
518
|
|
|
* |
519
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
520
|
|
|
*/ |
521
|
|
|
public function joinPageLinkProduct($relationAlias = null, $joinType = Criteria::INNER_JOIN) |
522
|
|
|
{ |
523
|
|
|
$tableMap = $this->getTableMap(); |
524
|
|
|
$relationMap = $tableMap->getRelation('PageLinkProduct'); |
525
|
|
|
|
526
|
|
|
// create a ModelJoin object for this join |
527
|
|
|
$join = new ModelJoin(); |
528
|
|
|
$join->setJoinType($joinType); |
529
|
|
|
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); |
530
|
|
|
if ($previousJoin = $this->getPreviousJoin()) { |
531
|
|
|
$join->setPreviousJoin($previousJoin); |
|
|
|
|
532
|
|
|
} |
533
|
|
|
|
534
|
|
|
// add the ModelJoin to the current object |
535
|
|
|
if ($relationAlias) { |
536
|
|
|
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); |
537
|
|
|
$this->addJoinObject($join, $relationAlias); |
538
|
|
|
} else { |
539
|
|
|
$this->addJoinObject($join, 'PageLinkProduct'); |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
return $this; |
543
|
|
|
} |
544
|
|
|
|
545
|
|
|
/** |
546
|
|
|
* Use the PageLinkProduct relation PageLinkProduct object |
547
|
|
|
* |
548
|
|
|
* @see useQuery() |
549
|
|
|
* |
550
|
|
|
* @param string $relationAlias optional alias for the relation, |
|
|
|
|
551
|
|
|
* to be used as main alias in the secondary query |
|
|
|
|
552
|
|
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' |
553
|
|
|
* |
554
|
|
|
* @return \mod_link\models\PageLinkProductQuery A secondary query class using the current class as primary query |
555
|
|
|
*/ |
556
|
|
|
public function usePageLinkProductQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) |
557
|
|
|
{ |
558
|
|
|
return $this |
559
|
|
|
->joinPageLinkProduct($relationAlias, $joinType) |
560
|
|
|
->useQuery($relationAlias ? $relationAlias : 'PageLinkProduct', '\mod_link\models\PageLinkProductQuery'); |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
/** |
564
|
|
|
* Exclude object from result |
565
|
|
|
* |
566
|
|
|
* @param ChildPageLink $pageLink Object to remove from the list of results |
567
|
|
|
* |
568
|
|
|
* @return $this|ChildPageLinkQuery The current query, for fluid interface |
|
|
|
|
569
|
|
|
*/ |
570
|
|
|
public function prune($pageLink = null) |
571
|
|
|
{ |
572
|
|
|
if ($pageLink) { |
573
|
|
|
$this->addUsingAlias(PageLinkTableMap::COL_ID, $pageLink->getId(), Criteria::NOT_EQUAL); |
574
|
|
|
} |
575
|
|
|
|
576
|
|
|
return $this; |
577
|
|
|
} |
578
|
|
|
|
579
|
|
|
/** |
580
|
|
|
* Deletes all rows from the page_link table. |
581
|
|
|
* |
582
|
|
|
* @param ConnectionInterface $con the connection to use |
583
|
|
|
* @return int The number of affected rows (if supported by underlying database driver). |
584
|
|
|
*/ |
585
|
|
|
public function doDeleteAll(ConnectionInterface $con = null) |
586
|
|
|
{ |
587
|
|
|
if (null === $con) { |
588
|
|
|
$con = Propel::getServiceContainer()->getWriteConnection(PageLinkTableMap::DATABASE_NAME); |
589
|
|
|
} |
590
|
|
|
|
591
|
|
|
// use transaction because $criteria could contain info |
592
|
|
|
// for more than one table or we could emulating ON DELETE CASCADE, etc. |
593
|
|
|
return $con->transaction(function () use ($con) { |
594
|
|
|
$affectedRows = 0; // initialize var to track total num of affected rows |
595
|
|
|
$affectedRows += parent::doDeleteAll($con); |
596
|
|
|
// Because this db requires some delete cascade/set null emulation, we have to |
597
|
|
|
// clear the cached instance *after* the emulation has happened (since |
598
|
|
|
// instances get re-added by the select statement contained therein). |
599
|
|
|
PageLinkTableMap::clearInstancePool(); |
600
|
|
|
PageLinkTableMap::clearRelatedInstancePool(); |
601
|
|
|
|
602
|
|
|
return $affectedRows; |
603
|
|
|
}); |
604
|
|
|
} |
605
|
|
|
|
606
|
|
|
/** |
607
|
|
|
* Performs a DELETE on the database based on the current ModelCriteria |
608
|
|
|
* |
609
|
|
|
* @param ConnectionInterface $con the connection to use |
610
|
|
|
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows |
611
|
|
|
* if supported by native driver or if emulated using Propel. |
612
|
|
|
* @throws PropelException Any exceptions caught during processing will be |
613
|
|
|
* rethrown wrapped into a PropelException. |
|
|
|
|
614
|
|
|
*/ |
615
|
|
|
public function delete(ConnectionInterface $con = null) |
616
|
|
|
{ |
617
|
|
|
if (null === $con) { |
618
|
|
|
$con = Propel::getServiceContainer()->getWriteConnection(PageLinkTableMap::DATABASE_NAME); |
619
|
|
|
} |
620
|
|
|
|
621
|
|
|
$criteria = $this; |
622
|
|
|
|
623
|
|
|
// Set the correct dbName |
624
|
|
|
$criteria->setDbName(PageLinkTableMap::DATABASE_NAME); |
625
|
|
|
|
626
|
|
|
// use transaction because $criteria could contain info |
627
|
|
|
// for more than one table or we could emulating ON DELETE CASCADE, etc. |
628
|
|
|
return $con->transaction(function () use ($con, $criteria) { |
629
|
|
|
$affectedRows = 0; // initialize var to track total num of affected rows |
630
|
|
|
|
631
|
|
|
PageLinkTableMap::removeInstanceFromPool($criteria); |
632
|
|
|
|
633
|
|
|
$affectedRows += ModelCriteria::delete($con); |
634
|
|
|
PageLinkTableMap::clearRelatedInstancePool(); |
635
|
|
|
|
636
|
|
|
return $affectedRows; |
637
|
|
|
}); |
638
|
|
|
} |
639
|
|
|
|
640
|
|
|
} // PageLinkQuery |
|
|
|
|
641
|
|
|
|