1 | <?php |
---|
2 | |
---|
3 | |
---|
4 | abstract class BaseTblspacefilePeer { |
---|
5 | |
---|
6 | |
---|
7 | const DATABASE_NAME = 'propel'; |
---|
8 | |
---|
9 | |
---|
10 | const TABLE_NAME = 'tblspacefile'; |
---|
11 | |
---|
12 | |
---|
13 | const CLASS_DEFAULT = 'lib.model.Tblspacefile'; |
---|
14 | |
---|
15 | |
---|
16 | const NUM_COLUMNS = 7; |
---|
17 | |
---|
18 | |
---|
19 | const NUM_LAZY_LOAD_COLUMNS = 0; |
---|
20 | |
---|
21 | |
---|
22 | const FILE_ID = 'tblspacefile.FILE_ID'; |
---|
23 | |
---|
24 | |
---|
25 | const FILE_RESOURCE = 'tblspacefile.FILE_RESOURCE'; |
---|
26 | |
---|
27 | |
---|
28 | const FILE_CATEGORY = 'tblspacefile.FILE_CATEGORY'; |
---|
29 | |
---|
30 | |
---|
31 | const FILE_USER = 'tblspacefile.FILE_USER'; |
---|
32 | |
---|
33 | |
---|
34 | const FILE_NAME = 'tblspacefile.FILE_NAME'; |
---|
35 | |
---|
36 | |
---|
37 | const FILE_TYPE = 'tblspacefile.FILE_TYPE'; |
---|
38 | |
---|
39 | |
---|
40 | const FILE_DATE = 'tblspacefile.FILE_DATE'; |
---|
41 | |
---|
42 | |
---|
43 | public static $instances = array(); |
---|
44 | |
---|
45 | |
---|
46 | private static $mapBuilder = null; |
---|
47 | |
---|
48 | |
---|
49 | private static $fieldNames = array ( |
---|
50 | BasePeer::TYPE_PHPNAME => array ('FileId', 'FileResource', 'FileCategory', 'FileUser', 'FileName', 'FileType', 'FileDate', ), |
---|
51 | BasePeer::TYPE_STUDLYPHPNAME => array ('fileId', 'fileResource', 'fileCategory', 'fileUser', 'fileName', 'fileType', 'fileDate', ), |
---|
52 | BasePeer::TYPE_COLNAME => array (self::FILE_ID, self::FILE_RESOURCE, self::FILE_CATEGORY, self::FILE_USER, self::FILE_NAME, self::FILE_TYPE, self::FILE_DATE, ), |
---|
53 | BasePeer::TYPE_FIELDNAME => array ('file_id', 'file_resource', 'file_category', 'file_user', 'file_name', 'file_type', 'file_date', ), |
---|
54 | BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) |
---|
55 | ); |
---|
56 | |
---|
57 | |
---|
58 | private static $fieldKeys = array ( |
---|
59 | BasePeer::TYPE_PHPNAME => array ('FileId' => 0, 'FileResource' => 1, 'FileCategory' => 2, 'FileUser' => 3, 'FileName' => 4, 'FileType' => 5, 'FileDate' => 6, ), |
---|
60 | BasePeer::TYPE_STUDLYPHPNAME => array ('fileId' => 0, 'fileResource' => 1, 'fileCategory' => 2, 'fileUser' => 3, 'fileName' => 4, 'fileType' => 5, 'fileDate' => 6, ), |
---|
61 | BasePeer::TYPE_COLNAME => array (self::FILE_ID => 0, self::FILE_RESOURCE => 1, self::FILE_CATEGORY => 2, self::FILE_USER => 3, self::FILE_NAME => 4, self::FILE_TYPE => 5, self::FILE_DATE => 6, ), |
---|
62 | BasePeer::TYPE_FIELDNAME => array ('file_id' => 0, 'file_resource' => 1, 'file_category' => 2, 'file_user' => 3, 'file_name' => 4, 'file_type' => 5, 'file_date' => 6, ), |
---|
63 | BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) |
---|
64 | ); |
---|
65 | |
---|
66 | |
---|
67 | public static function getMapBuilder() |
---|
68 | { |
---|
69 | if (self::$mapBuilder === null) { |
---|
70 | self::$mapBuilder = new TblspacefileMapBuilder(); |
---|
71 | } |
---|
72 | return self::$mapBuilder; |
---|
73 | } |
---|
74 | |
---|
75 | static public function translateFieldName($name, $fromType, $toType) |
---|
76 | { |
---|
77 | $toNames = self::getFieldNames($toType); |
---|
78 | $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null; |
---|
79 | if ($key === null) { |
---|
80 | throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true)); |
---|
81 | } |
---|
82 | return $toNames[$key]; |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | static public function getFieldNames($type = BasePeer::TYPE_PHPNAME) |
---|
88 | { |
---|
89 | if (!array_key_exists($type, self::$fieldNames)) { |
---|
90 | throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.'); |
---|
91 | } |
---|
92 | return self::$fieldNames[$type]; |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | public static function alias($alias, $column) |
---|
97 | { |
---|
98 | return str_replace(TblspacefilePeer::TABLE_NAME.'.', $alias.'.', $column); |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | public static function addSelectColumns(Criteria $criteria) |
---|
103 | { |
---|
104 | |
---|
105 | $criteria->addSelectColumn(TblspacefilePeer::FILE_ID); |
---|
106 | |
---|
107 | $criteria->addSelectColumn(TblspacefilePeer::FILE_RESOURCE); |
---|
108 | |
---|
109 | $criteria->addSelectColumn(TblspacefilePeer::FILE_CATEGORY); |
---|
110 | |
---|
111 | $criteria->addSelectColumn(TblspacefilePeer::FILE_USER); |
---|
112 | |
---|
113 | $criteria->addSelectColumn(TblspacefilePeer::FILE_NAME); |
---|
114 | |
---|
115 | $criteria->addSelectColumn(TblspacefilePeer::FILE_TYPE); |
---|
116 | |
---|
117 | $criteria->addSelectColumn(TblspacefilePeer::FILE_DATE); |
---|
118 | |
---|
119 | } |
---|
120 | |
---|
121 | |
---|
122 | public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null) |
---|
123 | { |
---|
124 | $criteria = clone $criteria; |
---|
125 | |
---|
126 | $criteria->setPrimaryTableName(TblspacefilePeer::TABLE_NAME); |
---|
127 | |
---|
128 | if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { |
---|
129 | $criteria->setDistinct(); |
---|
130 | } |
---|
131 | |
---|
132 | if (!$criteria->hasSelectClause()) { |
---|
133 | TblspacefilePeer::addSelectColumns($criteria); |
---|
134 | } |
---|
135 | |
---|
136 | $criteria->clearOrderByColumns(); $criteria->setDbName(self::DATABASE_NAME); |
---|
137 | if ($con === null) { |
---|
138 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
139 | } |
---|
140 | $stmt = BasePeer::doCount($criteria, $con); |
---|
141 | |
---|
142 | if ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
143 | $count = (int) $row[0]; |
---|
144 | } else { |
---|
145 | $count = 0; } |
---|
146 | $stmt->closeCursor(); |
---|
147 | return $count; |
---|
148 | } |
---|
149 | |
---|
150 | public static function doSelectOne(Criteria $criteria, PropelPDO $con = null) |
---|
151 | { |
---|
152 | $critcopy = clone $criteria; |
---|
153 | $critcopy->setLimit(1); |
---|
154 | $objects = TblspacefilePeer::doSelect($critcopy, $con); |
---|
155 | if ($objects) { |
---|
156 | return $objects[0]; |
---|
157 | } |
---|
158 | return null; |
---|
159 | } |
---|
160 | |
---|
161 | public static function doSelect(Criteria $criteria, PropelPDO $con = null) |
---|
162 | { |
---|
163 | return TblspacefilePeer::populateObjects(TblspacefilePeer::doSelectStmt($criteria, $con)); |
---|
164 | } |
---|
165 | |
---|
166 | public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null) |
---|
167 | { |
---|
168 | if ($con === null) { |
---|
169 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
170 | } |
---|
171 | |
---|
172 | if (!$criteria->hasSelectClause()) { |
---|
173 | $criteria = clone $criteria; |
---|
174 | TblspacefilePeer::addSelectColumns($criteria); |
---|
175 | } |
---|
176 | |
---|
177 | $criteria->setDbName(self::DATABASE_NAME); |
---|
178 | |
---|
179 | return BasePeer::doSelect($criteria, $con); |
---|
180 | } |
---|
181 | |
---|
182 | public static function addInstanceToPool(Tblspacefile $obj, $key = null) |
---|
183 | { |
---|
184 | if (Propel::isInstancePoolingEnabled()) { |
---|
185 | if ($key === null) { |
---|
186 | $key = (string) $obj->getFileId(); |
---|
187 | } self::$instances[$key] = $obj; |
---|
188 | } |
---|
189 | } |
---|
190 | |
---|
191 | |
---|
192 | public static function removeInstanceFromPool($value) |
---|
193 | { |
---|
194 | if (Propel::isInstancePoolingEnabled() && $value !== null) { |
---|
195 | if (is_object($value) && $value instanceof Tblspacefile) { |
---|
196 | $key = (string) $value->getFileId(); |
---|
197 | } elseif (is_scalar($value)) { |
---|
198 | $key = (string) $value; |
---|
199 | } else { |
---|
200 | $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or Tblspacefile object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); |
---|
201 | throw $e; |
---|
202 | } |
---|
203 | |
---|
204 | unset(self::$instances[$key]); |
---|
205 | } |
---|
206 | } |
---|
207 | |
---|
208 | public static function getInstanceFromPool($key) |
---|
209 | { |
---|
210 | if (Propel::isInstancePoolingEnabled()) { |
---|
211 | if (isset(self::$instances[$key])) { |
---|
212 | return self::$instances[$key]; |
---|
213 | } |
---|
214 | } |
---|
215 | return null; } |
---|
216 | |
---|
217 | |
---|
218 | public static function clearInstancePool() |
---|
219 | { |
---|
220 | self::$instances = array(); |
---|
221 | } |
---|
222 | |
---|
223 | |
---|
224 | public static function getPrimaryKeyHashFromRow($row, $startcol = 0) |
---|
225 | { |
---|
226 | if ($row[$startcol + 0] === null) { |
---|
227 | return null; |
---|
228 | } |
---|
229 | return (string) $row[$startcol + 0]; |
---|
230 | } |
---|
231 | |
---|
232 | |
---|
233 | public static function populateObjects(PDOStatement $stmt) |
---|
234 | { |
---|
235 | $results = array(); |
---|
236 | |
---|
237 | $cls = TblspacefilePeer::getOMClass(); |
---|
238 | $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); |
---|
239 | while ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
240 | $key = TblspacefilePeer::getPrimaryKeyHashFromRow($row, 0); |
---|
241 | if (null !== ($obj = TblspacefilePeer::getInstanceFromPool($key))) { |
---|
242 | $results[] = $obj; |
---|
243 | } else { |
---|
244 | |
---|
245 | $obj = new $cls(); |
---|
246 | $obj->hydrate($row); |
---|
247 | $results[] = $obj; |
---|
248 | TblspacefilePeer::addInstanceToPool($obj, $key); |
---|
249 | } } |
---|
250 | $stmt->closeCursor(); |
---|
251 | return $results; |
---|
252 | } |
---|
253 | |
---|
254 | |
---|
255 | public static function doCountJoinTblspaceresource(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) |
---|
256 | { |
---|
257 | $criteria = clone $criteria; |
---|
258 | |
---|
259 | $criteria->setPrimaryTableName(TblspacefilePeer::TABLE_NAME); |
---|
260 | |
---|
261 | if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { |
---|
262 | $criteria->setDistinct(); |
---|
263 | } |
---|
264 | |
---|
265 | if (!$criteria->hasSelectClause()) { |
---|
266 | TblspacefilePeer::addSelectColumns($criteria); |
---|
267 | } |
---|
268 | |
---|
269 | $criteria->clearOrderByColumns(); |
---|
270 | $criteria->setDbName(self::DATABASE_NAME); |
---|
271 | |
---|
272 | if ($con === null) { |
---|
273 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
274 | } |
---|
275 | |
---|
276 | $criteria->addJoin(array(TblspacefilePeer::FILE_RESOURCE,), array(TblspaceresourcePeer::RES_ID,), $join_behavior); |
---|
277 | $stmt = BasePeer::doCount($criteria, $con); |
---|
278 | |
---|
279 | if ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
280 | $count = (int) $row[0]; |
---|
281 | } else { |
---|
282 | $count = 0; } |
---|
283 | $stmt->closeCursor(); |
---|
284 | return $count; |
---|
285 | } |
---|
286 | |
---|
287 | |
---|
288 | |
---|
289 | public static function doSelectJoinTblspaceresource(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) |
---|
290 | { |
---|
291 | $c = clone $c; |
---|
292 | |
---|
293 | if ($c->getDbName() == Propel::getDefaultDB()) { |
---|
294 | $c->setDbName(self::DATABASE_NAME); |
---|
295 | } |
---|
296 | |
---|
297 | TblspacefilePeer::addSelectColumns($c); |
---|
298 | $startcol = (TblspacefilePeer::NUM_COLUMNS - TblspacefilePeer::NUM_LAZY_LOAD_COLUMNS); |
---|
299 | TblspaceresourcePeer::addSelectColumns($c); |
---|
300 | |
---|
301 | $c->addJoin(array(TblspacefilePeer::FILE_RESOURCE,), array(TblspaceresourcePeer::RES_ID,), $join_behavior); |
---|
302 | $stmt = BasePeer::doSelect($c, $con); |
---|
303 | $results = array(); |
---|
304 | |
---|
305 | while ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
306 | $key1 = TblspacefilePeer::getPrimaryKeyHashFromRow($row, 0); |
---|
307 | if (null !== ($obj1 = TblspacefilePeer::getInstanceFromPool($key1))) { |
---|
308 | } else { |
---|
309 | |
---|
310 | $omClass = TblspacefilePeer::getOMClass(); |
---|
311 | |
---|
312 | $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); |
---|
313 | $obj1 = new $cls(); |
---|
314 | $obj1->hydrate($row); |
---|
315 | TblspacefilePeer::addInstanceToPool($obj1, $key1); |
---|
316 | } |
---|
317 | $key2 = TblspaceresourcePeer::getPrimaryKeyHashFromRow($row, $startcol); |
---|
318 | if ($key2 !== null) { |
---|
319 | $obj2 = TblspaceresourcePeer::getInstanceFromPool($key2); |
---|
320 | if (!$obj2) { |
---|
321 | |
---|
322 | $omClass = TblspaceresourcePeer::getOMClass(); |
---|
323 | |
---|
324 | $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); |
---|
325 | $obj2 = new $cls(); |
---|
326 | $obj2->hydrate($row, $startcol); |
---|
327 | TblspaceresourcePeer::addInstanceToPool($obj2, $key2); |
---|
328 | } |
---|
329 | $obj2->addTblspacefile($obj1); |
---|
330 | |
---|
331 | } |
---|
332 | $results[] = $obj1; |
---|
333 | } |
---|
334 | $stmt->closeCursor(); |
---|
335 | return $results; |
---|
336 | } |
---|
337 | |
---|
338 | |
---|
339 | |
---|
340 | public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) |
---|
341 | { |
---|
342 | $criteria = clone $criteria; |
---|
343 | |
---|
344 | $criteria->setPrimaryTableName(TblspacefilePeer::TABLE_NAME); |
---|
345 | |
---|
346 | if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { |
---|
347 | $criteria->setDistinct(); |
---|
348 | } |
---|
349 | |
---|
350 | if (!$criteria->hasSelectClause()) { |
---|
351 | TblspacefilePeer::addSelectColumns($criteria); |
---|
352 | } |
---|
353 | |
---|
354 | $criteria->clearOrderByColumns(); |
---|
355 | $criteria->setDbName(self::DATABASE_NAME); |
---|
356 | |
---|
357 | if ($con === null) { |
---|
358 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
359 | } |
---|
360 | |
---|
361 | $criteria->addJoin(array(TblspacefilePeer::FILE_RESOURCE,), array(TblspaceresourcePeer::RES_ID,), $join_behavior); |
---|
362 | $stmt = BasePeer::doCount($criteria, $con); |
---|
363 | |
---|
364 | if ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
365 | $count = (int) $row[0]; |
---|
366 | } else { |
---|
367 | $count = 0; } |
---|
368 | $stmt->closeCursor(); |
---|
369 | return $count; |
---|
370 | } |
---|
371 | |
---|
372 | |
---|
373 | public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) |
---|
374 | { |
---|
375 | $c = clone $c; |
---|
376 | |
---|
377 | if ($c->getDbName() == Propel::getDefaultDB()) { |
---|
378 | $c->setDbName(self::DATABASE_NAME); |
---|
379 | } |
---|
380 | |
---|
381 | TblspacefilePeer::addSelectColumns($c); |
---|
382 | $startcol2 = (TblspacefilePeer::NUM_COLUMNS - TblspacefilePeer::NUM_LAZY_LOAD_COLUMNS); |
---|
383 | |
---|
384 | TblspaceresourcePeer::addSelectColumns($c); |
---|
385 | $startcol3 = $startcol2 + (TblspaceresourcePeer::NUM_COLUMNS - TblspaceresourcePeer::NUM_LAZY_LOAD_COLUMNS); |
---|
386 | |
---|
387 | $c->addJoin(array(TblspacefilePeer::FILE_RESOURCE,), array(TblspaceresourcePeer::RES_ID,), $join_behavior); |
---|
388 | $stmt = BasePeer::doSelect($c, $con); |
---|
389 | $results = array(); |
---|
390 | |
---|
391 | while ($row = $stmt->fetch(PDO::FETCH_NUM)) { |
---|
392 | $key1 = TblspacefilePeer::getPrimaryKeyHashFromRow($row, 0); |
---|
393 | if (null !== ($obj1 = TblspacefilePeer::getInstanceFromPool($key1))) { |
---|
394 | } else { |
---|
395 | $omClass = TblspacefilePeer::getOMClass(); |
---|
396 | |
---|
397 | $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); |
---|
398 | $obj1 = new $cls(); |
---|
399 | $obj1->hydrate($row); |
---|
400 | TblspacefilePeer::addInstanceToPool($obj1, $key1); |
---|
401 | } |
---|
402 | |
---|
403 | $key2 = TblspaceresourcePeer::getPrimaryKeyHashFromRow($row, $startcol2); |
---|
404 | if ($key2 !== null) { |
---|
405 | $obj2 = TblspaceresourcePeer::getInstanceFromPool($key2); |
---|
406 | if (!$obj2) { |
---|
407 | |
---|
408 | $omClass = TblspaceresourcePeer::getOMClass(); |
---|
409 | |
---|
410 | |
---|
411 | $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); |
---|
412 | $obj2 = new $cls(); |
---|
413 | $obj2->hydrate($row, $startcol2); |
---|
414 | TblspaceresourcePeer::addInstanceToPool($obj2, $key2); |
---|
415 | } |
---|
416 | $obj2->addTblspacefile($obj1); |
---|
417 | } |
---|
418 | $results[] = $obj1; |
---|
419 | } |
---|
420 | $stmt->closeCursor(); |
---|
421 | return $results; |
---|
422 | } |
---|
423 | |
---|
424 | |
---|
425 | public static function getTableMap() |
---|
426 | { |
---|
427 | return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME); |
---|
428 | } |
---|
429 | |
---|
430 | |
---|
431 | public static function getOMClass() |
---|
432 | { |
---|
433 | return TblspacefilePeer::CLASS_DEFAULT; |
---|
434 | } |
---|
435 | |
---|
436 | |
---|
437 | public static function doInsert($values, PropelPDO $con = null) |
---|
438 | { |
---|
439 | if ($con === null) { |
---|
440 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
441 | } |
---|
442 | |
---|
443 | if ($values instanceof Criteria) { |
---|
444 | $criteria = clone $values; } else { |
---|
445 | $criteria = $values->buildCriteria(); } |
---|
446 | |
---|
447 | if ($criteria->containsKey(TblspacefilePeer::FILE_ID) && $criteria->keyContainsValue(TblspacefilePeer::FILE_ID) ) { |
---|
448 | throw new PropelException('Cannot insert a value for auto-increment primary key ('.TblspacefilePeer::FILE_ID.')'); |
---|
449 | } |
---|
450 | |
---|
451 | |
---|
452 | $criteria->setDbName(self::DATABASE_NAME); |
---|
453 | |
---|
454 | try { |
---|
455 | $con->beginTransaction(); |
---|
456 | $pk = BasePeer::doInsert($criteria, $con); |
---|
457 | $con->commit(); |
---|
458 | } catch(PropelException $e) { |
---|
459 | $con->rollBack(); |
---|
460 | throw $e; |
---|
461 | } |
---|
462 | |
---|
463 | return $pk; |
---|
464 | } |
---|
465 | |
---|
466 | |
---|
467 | public static function doUpdate($values, PropelPDO $con = null) |
---|
468 | { |
---|
469 | if ($con === null) { |
---|
470 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
471 | } |
---|
472 | |
---|
473 | $selectCriteria = new Criteria(self::DATABASE_NAME); |
---|
474 | |
---|
475 | if ($values instanceof Criteria) { |
---|
476 | $criteria = clone $values; |
---|
477 | $comparison = $criteria->getComparison(TblspacefilePeer::FILE_ID); |
---|
478 | $selectCriteria->add(TblspacefilePeer::FILE_ID, $criteria->remove(TblspacefilePeer::FILE_ID), $comparison); |
---|
479 | |
---|
480 | } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); } |
---|
481 | |
---|
482 | $criteria->setDbName(self::DATABASE_NAME); |
---|
483 | |
---|
484 | return BasePeer::doUpdate($selectCriteria, $criteria, $con); |
---|
485 | } |
---|
486 | |
---|
487 | |
---|
488 | public static function doDeleteAll($con = null) |
---|
489 | { |
---|
490 | if ($con === null) { |
---|
491 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
492 | } |
---|
493 | $affectedRows = 0; try { |
---|
494 | $con->beginTransaction(); |
---|
495 | $affectedRows += BasePeer::doDeleteAll(TblspacefilePeer::TABLE_NAME, $con); |
---|
496 | $con->commit(); |
---|
497 | return $affectedRows; |
---|
498 | } catch (PropelException $e) { |
---|
499 | $con->rollBack(); |
---|
500 | throw $e; |
---|
501 | } |
---|
502 | } |
---|
503 | |
---|
504 | |
---|
505 | public static function doDelete($values, PropelPDO $con = null) |
---|
506 | { |
---|
507 | if ($con === null) { |
---|
508 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); |
---|
509 | } |
---|
510 | |
---|
511 | if ($values instanceof Criteria) { |
---|
512 | TblspacefilePeer::clearInstancePool(); |
---|
513 | |
---|
514 | $criteria = clone $values; |
---|
515 | } elseif ($values instanceof Tblspacefile) { |
---|
516 | TblspacefilePeer::removeInstanceFromPool($values); |
---|
517 | $criteria = $values->buildPkeyCriteria(); |
---|
518 | } else { |
---|
519 | |
---|
520 | |
---|
521 | |
---|
522 | $criteria = new Criteria(self::DATABASE_NAME); |
---|
523 | $criteria->add(TblspacefilePeer::FILE_ID, (array) $values, Criteria::IN); |
---|
524 | |
---|
525 | foreach ((array) $values as $singleval) { |
---|
526 | TblspacefilePeer::removeInstanceFromPool($singleval); |
---|
527 | } |
---|
528 | } |
---|
529 | |
---|
530 | $criteria->setDbName(self::DATABASE_NAME); |
---|
531 | |
---|
532 | $affectedRows = 0; |
---|
533 | try { |
---|
534 | $con->beginTransaction(); |
---|
535 | |
---|
536 | $affectedRows += BasePeer::doDelete($criteria, $con); |
---|
537 | |
---|
538 | $con->commit(); |
---|
539 | return $affectedRows; |
---|
540 | } catch (PropelException $e) { |
---|
541 | $con->rollBack(); |
---|
542 | throw $e; |
---|
543 | } |
---|
544 | } |
---|
545 | |
---|
546 | |
---|
547 | public static function doValidate(Tblspacefile $obj, $cols = null) |
---|
548 | { |
---|
549 | $columns = array(); |
---|
550 | |
---|
551 | if ($cols) { |
---|
552 | $dbMap = Propel::getDatabaseMap(TblspacefilePeer::DATABASE_NAME); |
---|
553 | $tableMap = $dbMap->getTable(TblspacefilePeer::TABLE_NAME); |
---|
554 | |
---|
555 | if (! is_array($cols)) { |
---|
556 | $cols = array($cols); |
---|
557 | } |
---|
558 | |
---|
559 | foreach ($cols as $colName) { |
---|
560 | if ($tableMap->containsColumn($colName)) { |
---|
561 | $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); |
---|
562 | $columns[$colName] = $obj->$get(); |
---|
563 | } |
---|
564 | } |
---|
565 | } else { |
---|
566 | |
---|
567 | } |
---|
568 | |
---|
569 | $res = BasePeer::doValidate(TblspacefilePeer::DATABASE_NAME, TblspacefilePeer::TABLE_NAME, $columns); |
---|
570 | if ($res !== true) { |
---|
571 | $request = sfContext::getInstance()->getRequest(); |
---|
572 | foreach ($res as $failed) { |
---|
573 | $col = TblspacefilePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME); |
---|
574 | $request->setError($col, $failed->getMessage()); |
---|
575 | } |
---|
576 | } |
---|
577 | |
---|
578 | return $res; |
---|
579 | } |
---|
580 | |
---|
581 | |
---|
582 | public static function retrieveByPK($pk, PropelPDO $con = null) |
---|
583 | { |
---|
584 | |
---|
585 | if (null !== ($obj = TblspacefilePeer::getInstanceFromPool((string) $pk))) { |
---|
586 | return $obj; |
---|
587 | } |
---|
588 | |
---|
589 | if ($con === null) { |
---|
590 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
591 | } |
---|
592 | |
---|
593 | $criteria = new Criteria(TblspacefilePeer::DATABASE_NAME); |
---|
594 | $criteria->add(TblspacefilePeer::FILE_ID, $pk); |
---|
595 | |
---|
596 | $v = TblspacefilePeer::doSelect($criteria, $con); |
---|
597 | |
---|
598 | return !empty($v) > 0 ? $v[0] : null; |
---|
599 | } |
---|
600 | |
---|
601 | |
---|
602 | public static function retrieveByPKs($pks, PropelPDO $con = null) |
---|
603 | { |
---|
604 | if ($con === null) { |
---|
605 | $con = Propel::getConnection(TblspacefilePeer::DATABASE_NAME, Propel::CONNECTION_READ); |
---|
606 | } |
---|
607 | |
---|
608 | $objs = null; |
---|
609 | if (empty($pks)) { |
---|
610 | $objs = array(); |
---|
611 | } else { |
---|
612 | $criteria = new Criteria(TblspacefilePeer::DATABASE_NAME); |
---|
613 | $criteria->add(TblspacefilePeer::FILE_ID, $pks, Criteria::IN); |
---|
614 | $objs = TblspacefilePeer::doSelect($criteria, $con); |
---|
615 | } |
---|
616 | return $objs; |
---|
617 | } |
---|
618 | |
---|
619 | } |
---|
620 | |
---|
621 | Propel::getDatabaseMap(BaseTblspacefilePeer::DATABASE_NAME)->addTableBuilder(BaseTblspacefilePeer::TABLE_NAME, BaseTblspacefilePeer::getMapBuilder()); |
---|
622 | |
---|