BaseCcStreamSetting.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'cc_stream_setting' table.
  4. *
  5. *
  6. *
  7. * @package propel.generator.airtime.om
  8. */
  9. abstract class BaseCcStreamSetting extends BaseObject implements Persistent
  10. {
  11. /**
  12. * Peer class name
  13. */
  14. const PEER = 'CcStreamSettingPeer';
  15. /**
  16. * The Peer class.
  17. * Instance provides a convenient way of calling static methods on a class
  18. * that calling code may not be able to identify.
  19. * @var CcStreamSettingPeer
  20. */
  21. protected static $peer;
  22. /**
  23. * The value for the keyname field.
  24. * @var string
  25. */
  26. protected $keyname;
  27. /**
  28. * The value for the value field.
  29. * @var string
  30. */
  31. protected $value;
  32. /**
  33. * The value for the type field.
  34. * @var string
  35. */
  36. protected $type;
  37. /**
  38. * Flag to prevent endless save loop, if this object is referenced
  39. * by another object which falls in this transaction.
  40. * @var boolean
  41. */
  42. protected $alreadyInSave = false;
  43. /**
  44. * Flag to prevent endless validation loop, if this object is referenced
  45. * by another object which falls in this transaction.
  46. * @var boolean
  47. */
  48. protected $alreadyInValidation = false;
  49. /**
  50. * Get the [keyname] column value.
  51. *
  52. * @return string
  53. */
  54. public function getDbKeyName()
  55. {
  56. return $this->keyname;
  57. }
  58. /**
  59. * Get the [value] column value.
  60. *
  61. * @return string
  62. */
  63. public function getDbValue()
  64. {
  65. return $this->value;
  66. }
  67. /**
  68. * Get the [type] column value.
  69. *
  70. * @return string
  71. */
  72. public function getDbType()
  73. {
  74. return $this->type;
  75. }
  76. /**
  77. * Set the value of [keyname] column.
  78. *
  79. * @param string $v new value
  80. * @return CcStreamSetting The current object (for fluent API support)
  81. */
  82. public function setDbKeyName($v)
  83. {
  84. if ($v !== null) {
  85. $v = (string) $v;
  86. }
  87. if ($this->keyname !== $v) {
  88. $this->keyname = $v;
  89. $this->modifiedColumns[] = CcStreamSettingPeer::KEYNAME;
  90. }
  91. return $this;
  92. } // setDbKeyName()
  93. /**
  94. * Set the value of [value] column.
  95. *
  96. * @param string $v new value
  97. * @return CcStreamSetting The current object (for fluent API support)
  98. */
  99. public function setDbValue($v)
  100. {
  101. if ($v !== null) {
  102. $v = (string) $v;
  103. }
  104. if ($this->value !== $v) {
  105. $this->value = $v;
  106. $this->modifiedColumns[] = CcStreamSettingPeer::VALUE;
  107. }
  108. return $this;
  109. } // setDbValue()
  110. /**
  111. * Set the value of [type] column.
  112. *
  113. * @param string $v new value
  114. * @return CcStreamSetting The current object (for fluent API support)
  115. */
  116. public function setDbType($v)
  117. {
  118. if ($v !== null) {
  119. $v = (string) $v;
  120. }
  121. if ($this->type !== $v) {
  122. $this->type = $v;
  123. $this->modifiedColumns[] = CcStreamSettingPeer::TYPE;
  124. }
  125. return $this;
  126. } // setDbType()
  127. /**
  128. * Indicates whether the columns in this object are only set to default values.
  129. *
  130. * This method can be used in conjunction with isModified() to indicate whether an object is both
  131. * modified _and_ has some values set which are non-default.
  132. *
  133. * @return boolean Whether the columns in this object are only been set with default values.
  134. */
  135. public function hasOnlyDefaultValues()
  136. {
  137. // otherwise, everything was equal, so return TRUE
  138. return true;
  139. } // hasOnlyDefaultValues()
  140. /**
  141. * Hydrates (populates) the object variables with values from the database resultset.
  142. *
  143. * An offset (0-based "start column") is specified so that objects can be hydrated
  144. * with a subset of the columns in the resultset rows. This is needed, for example,
  145. * for results of JOIN queries where the resultset row includes columns from two or
  146. * more tables.
  147. *
  148. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  149. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  150. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  151. * @return int next starting column
  152. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  153. */
  154. public function hydrate($row, $startcol = 0, $rehydrate = false)
  155. {
  156. try {
  157. $this->keyname = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
  158. $this->value = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
  159. $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
  160. $this->resetModified();
  161. $this->setNew(false);
  162. if ($rehydrate) {
  163. $this->ensureConsistency();
  164. }
  165. return $startcol + 3; // 3 = CcStreamSettingPeer::NUM_COLUMNS - CcStreamSettingPeer::NUM_LAZY_LOAD_COLUMNS).
  166. } catch (Exception $e) {
  167. throw new PropelException("Error populating CcStreamSetting object", $e);
  168. }
  169. }
  170. /**
  171. * Checks and repairs the internal consistency of the object.
  172. *
  173. * This method is executed after an already-instantiated object is re-hydrated
  174. * from the database. It exists to check any foreign keys to make sure that
  175. * the objects related to the current object are correct based on foreign key.
  176. *
  177. * You can override this method in the stub class, but you should always invoke
  178. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  179. * in case your model changes.
  180. *
  181. * @throws PropelException
  182. */
  183. public function ensureConsistency()
  184. {
  185. } // ensureConsistency
  186. /**
  187. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  188. *
  189. * This will only work if the object has been saved and has a valid primary key set.
  190. *
  191. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  192. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  193. * @return void
  194. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  195. */
  196. public function reload($deep = false, PropelPDO $con = null)
  197. {
  198. if ($this->isDeleted()) {
  199. throw new PropelException("Cannot reload a deleted object.");
  200. }
  201. if ($this->isNew()) {
  202. throw new PropelException("Cannot reload an unsaved object.");
  203. }
  204. if ($con === null) {
  205. $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  206. }
  207. // We don't need to alter the object instance pool; we're just modifying this instance
  208. // already in the pool.
  209. $stmt = CcStreamSettingPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  210. $row = $stmt->fetch(PDO::FETCH_NUM);
  211. $stmt->closeCursor();
  212. if (!$row) {
  213. throw new PropelException('Cannot find matching row in the database to reload object values.');
  214. }
  215. $this->hydrate($row, 0, true); // rehydrate
  216. if ($deep) { // also de-associate any related objects?
  217. } // if (deep)
  218. }
  219. /**
  220. * Removes this object from datastore and sets delete attribute.
  221. *
  222. * @param PropelPDO $con
  223. * @return void
  224. * @throws PropelException
  225. * @see BaseObject::setDeleted()
  226. * @see BaseObject::isDeleted()
  227. */
  228. public function delete(PropelPDO $con = null)
  229. {
  230. if ($this->isDeleted()) {
  231. throw new PropelException("This object has already been deleted.");
  232. }
  233. if ($con === null) {
  234. $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  235. }
  236. $con->beginTransaction();
  237. try {
  238. $ret = $this->preDelete($con);
  239. if ($ret) {
  240. CcStreamSettingQuery::create()
  241. ->filterByPrimaryKey($this->getPrimaryKey())
  242. ->delete($con);
  243. $this->postDelete($con);
  244. $con->commit();
  245. $this->setDeleted(true);
  246. } else {
  247. $con->commit();
  248. }
  249. } catch (PropelException $e) {
  250. $con->rollBack();
  251. throw $e;
  252. }
  253. }
  254. /**
  255. * Persists this object to the database.
  256. *
  257. * If the object is new, it inserts it; otherwise an update is performed.
  258. * All modified related objects will also be persisted in the doSave()
  259. * method. This method wraps all precipitate database operations in a
  260. * single transaction.
  261. *
  262. * @param PropelPDO $con
  263. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  264. * @throws PropelException
  265. * @see doSave()
  266. */
  267. public function save(PropelPDO $con = null)
  268. {
  269. if ($this->isDeleted()) {
  270. throw new PropelException("You cannot save an object that has been deleted.");
  271. }
  272. if ($con === null) {
  273. $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  274. }
  275. $con->beginTransaction();
  276. $isInsert = $this->isNew();
  277. try {
  278. $ret = $this->preSave($con);
  279. if ($isInsert) {
  280. $ret = $ret && $this->preInsert($con);
  281. } else {
  282. $ret = $ret && $this->preUpdate($con);
  283. }
  284. if ($ret) {
  285. $affectedRows = $this->doSave($con);
  286. if ($isInsert) {
  287. $this->postInsert($con);
  288. } else {
  289. $this->postUpdate($con);
  290. }
  291. $this->postSave($con);
  292. CcStreamSettingPeer::addInstanceToPool($this);
  293. } else {
  294. $affectedRows = 0;
  295. }
  296. $con->commit();
  297. return $affectedRows;
  298. } catch (PropelException $e) {
  299. $con->rollBack();
  300. throw $e;
  301. }
  302. }
  303. /**
  304. * Performs the work of inserting or updating the row in the database.
  305. *
  306. * If the object is new, it inserts it; otherwise an update is performed.
  307. * All related objects are also updated in this method.
  308. *
  309. * @param PropelPDO $con
  310. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  311. * @throws PropelException
  312. * @see save()
  313. */
  314. protected function doSave(PropelPDO $con)
  315. {
  316. $affectedRows = 0; // initialize var to track total num of affected rows
  317. if (!$this->alreadyInSave) {
  318. $this->alreadyInSave = true;
  319. // If this object has been modified, then save it to the database.
  320. if ($this->isModified()) {
  321. if ($this->isNew()) {
  322. $criteria = $this->buildCriteria();
  323. $pk = BasePeer::doInsert($criteria, $con);
  324. $affectedRows = 1;
  325. $this->setNew(false);
  326. } else {
  327. $affectedRows = CcStreamSettingPeer::doUpdate($this, $con);
  328. }
  329. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  330. }
  331. $this->alreadyInSave = false;
  332. }
  333. return $affectedRows;
  334. } // doSave()
  335. /**
  336. * Array of ValidationFailed objects.
  337. * @var array ValidationFailed[]
  338. */
  339. protected $validationFailures = array();
  340. /**
  341. * Gets any ValidationFailed objects that resulted from last call to validate().
  342. *
  343. *
  344. * @return array ValidationFailed[]
  345. * @see validate()
  346. */
  347. public function getValidationFailures()
  348. {
  349. return $this->validationFailures;
  350. }
  351. /**
  352. * Validates the objects modified field values and all objects related to this table.
  353. *
  354. * If $columns is either a column name or an array of column names
  355. * only those columns are validated.
  356. *
  357. * @param mixed $columns Column name or an array of column names.
  358. * @return boolean Whether all columns pass validation.
  359. * @see doValidate()
  360. * @see getValidationFailures()
  361. */
  362. public function validate($columns = null)
  363. {
  364. $res = $this->doValidate($columns);
  365. if ($res === true) {
  366. $this->validationFailures = array();
  367. return true;
  368. } else {
  369. $this->validationFailures = $res;
  370. return false;
  371. }
  372. }
  373. /**
  374. * This function performs the validation work for complex object models.
  375. *
  376. * In addition to checking the current object, all related objects will
  377. * also be validated. If all pass then <code>true</code> is returned; otherwise
  378. * an aggreagated array of ValidationFailed objects will be returned.
  379. *
  380. * @param array $columns Array of column names to validate.
  381. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  382. */
  383. protected function doValidate($columns = null)
  384. {
  385. if (!$this->alreadyInValidation) {
  386. $this->alreadyInValidation = true;
  387. $retval = null;
  388. $failureMap = array();
  389. if (($retval = CcStreamSettingPeer::doValidate($this, $columns)) !== true) {
  390. $failureMap = array_merge($failureMap, $retval);
  391. }
  392. $this->alreadyInValidation = false;
  393. }
  394. return (!empty($failureMap) ? $failureMap : true);
  395. }
  396. /**
  397. * Retrieves a field from the object by name passed in as a string.
  398. *
  399. * @param string $name name
  400. * @param string $type The type of fieldname the $name is of:
  401. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  402. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  403. * @return mixed Value of field.
  404. */
  405. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  406. {
  407. $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  408. $field = $this->getByPosition($pos);
  409. return $field;
  410. }
  411. /**
  412. * Retrieves a field from the object by Position as specified in the xml schema.
  413. * Zero-based.
  414. *
  415. * @param int $pos position in xml schema
  416. * @return mixed Value of field at $pos
  417. */
  418. public function getByPosition($pos)
  419. {
  420. switch($pos) {
  421. case 0:
  422. return $this->getDbKeyName();
  423. break;
  424. case 1:
  425. return $this->getDbValue();
  426. break;
  427. case 2:
  428. return $this->getDbType();
  429. break;
  430. default:
  431. return null;
  432. break;
  433. } // switch()
  434. }
  435. /**
  436. * Exports the object as an array.
  437. *
  438. * You can specify the key type of the array by passing one of the class
  439. * type constants.
  440. *
  441. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  442. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  443. * Defaults to BasePeer::TYPE_PHPNAME.
  444. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  445. *
  446. * @return array an associative array containing the field names (as keys) and field values
  447. */
  448. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  449. {
  450. $keys = CcStreamSettingPeer::getFieldNames($keyType);
  451. $result = array(
  452. $keys[0] => $this->getDbKeyName(),
  453. $keys[1] => $this->getDbValue(),
  454. $keys[2] => $this->getDbType(),
  455. );
  456. return $result;
  457. }
  458. /**
  459. * Sets a field from the object by name passed in as a string.
  460. *
  461. * @param string $name peer name
  462. * @param mixed $value field value
  463. * @param string $type The type of fieldname the $name is of:
  464. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  465. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  466. * @return void
  467. */
  468. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  469. {
  470. $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  471. return $this->setByPosition($pos, $value);
  472. }
  473. /**
  474. * Sets a field from the object by Position as specified in the xml schema.
  475. * Zero-based.
  476. *
  477. * @param int $pos position in xml schema
  478. * @param mixed $value field value
  479. * @return void
  480. */
  481. public function setByPosition($pos, $value)
  482. {
  483. switch($pos) {
  484. case 0:
  485. $this->setDbKeyName($value);
  486. break;
  487. case 1:
  488. $this->setDbValue($value);
  489. break;
  490. case 2:
  491. $this->setDbType($value);
  492. break;
  493. } // switch()
  494. }
  495. /**
  496. * Populates the object using an array.
  497. *
  498. * This is particularly useful when populating an object from one of the
  499. * request arrays (e.g. $_POST). This method goes through the column
  500. * names, checking to see whether a matching key exists in populated
  501. * array. If so the setByName() method is called for that column.
  502. *
  503. * You can specify the key type of the array by additionally passing one
  504. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  505. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  506. * The default key type is the column's phpname (e.g. 'AuthorId')
  507. *
  508. * @param array $arr An array to populate the object from.
  509. * @param string $keyType The type of keys the array uses.
  510. * @return void
  511. */
  512. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  513. {
  514. $keys = CcStreamSettingPeer::getFieldNames($keyType);
  515. if (array_key_exists($keys[0], $arr)) $this->setDbKeyName($arr[$keys[0]]);
  516. if (array_key_exists($keys[1], $arr)) $this->setDbValue($arr[$keys[1]]);
  517. if (array_key_exists($keys[2], $arr)) $this->setDbType($arr[$keys[2]]);
  518. }
  519. /**
  520. * Build a Criteria object containing the values of all modified columns in this object.
  521. *
  522. * @return Criteria The Criteria object containing all modified values.
  523. */
  524. public function buildCriteria()
  525. {
  526. $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME);
  527. if ($this->isColumnModified(CcStreamSettingPeer::KEYNAME)) $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname);
  528. if ($this->isColumnModified(CcStreamSettingPeer::VALUE)) $criteria->add(CcStreamSettingPeer::VALUE, $this->value);
  529. if ($this->isColumnModified(CcStreamSettingPeer::TYPE)) $criteria->add(CcStreamSettingPeer::TYPE, $this->type);
  530. return $criteria;
  531. }
  532. /**
  533. * Builds a Criteria object containing the primary key for this object.
  534. *
  535. * Unlike buildCriteria() this method includes the primary key values regardless
  536. * of whether or not they have been modified.
  537. *
  538. * @return Criteria The Criteria object containing value(s) for primary key(s).
  539. */
  540. public function buildPkeyCriteria()
  541. {
  542. $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME);
  543. $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname);
  544. return $criteria;
  545. }
  546. /**
  547. * Returns the primary key for this object (row).
  548. * @return string
  549. */
  550. public function getPrimaryKey()
  551. {
  552. return $this->getDbKeyName();
  553. }
  554. /**
  555. * Generic method to set the primary key (keyname column).
  556. *
  557. * @param string $key Primary key.
  558. * @return void
  559. */
  560. public function setPrimaryKey($key)
  561. {
  562. $this->setDbKeyName($key);
  563. }
  564. /**
  565. * Returns true if the primary key for this object is null.
  566. * @return boolean
  567. */
  568. public function isPrimaryKeyNull()
  569. {
  570. return null === $this->getDbKeyName();
  571. }
  572. /**
  573. * Sets contents of passed object to values from current object.
  574. *
  575. * If desired, this method can also make copies of all associated (fkey referrers)
  576. * objects.
  577. *
  578. * @param object $copyObj An object of CcStreamSetting (or compatible) type.
  579. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  580. * @throws PropelException
  581. */
  582. public function copyInto($copyObj, $deepCopy = false)
  583. {
  584. $copyObj->setDbKeyName($this->keyname);
  585. $copyObj->setDbValue($this->value);
  586. $copyObj->setDbType($this->type);
  587. $copyObj->setNew(true);
  588. }
  589. /**
  590. * Makes a copy of this object that will be inserted as a new row in table when saved.
  591. * It creates a new object filling in the simple attributes, but skipping any primary
  592. * keys that are defined for the table.
  593. *
  594. * If desired, this method can also make copies of all associated (fkey referrers)
  595. * objects.
  596. *
  597. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  598. * @return CcStreamSetting Clone of current object.
  599. * @throws PropelException
  600. */
  601. public function copy($deepCopy = false)
  602. {
  603. // we use get_class(), because this might be a subclass
  604. $clazz = get_class($this);
  605. $copyObj = new $clazz();
  606. $this->copyInto($copyObj, $deepCopy);
  607. return $copyObj;
  608. }
  609. /**
  610. * Returns a peer instance associated with this om.
  611. *
  612. * Since Peer classes are not to have any instance attributes, this method returns the
  613. * same instance for all member of this class. The method could therefore
  614. * be static, but this would prevent one from overriding the behavior.
  615. *
  616. * @return CcStreamSettingPeer
  617. */
  618. public function getPeer()
  619. {
  620. if (self::$peer === null) {
  621. self::$peer = new CcStreamSettingPeer();
  622. }
  623. return self::$peer;
  624. }
  625. /**
  626. * Clears the current object and sets all attributes to their default values
  627. */
  628. public function clear()
  629. {
  630. $this->keyname = null;
  631. $this->value = null;
  632. $this->type = null;
  633. $this->alreadyInSave = false;
  634. $this->alreadyInValidation = false;
  635. $this->clearAllReferences();
  636. $this->resetModified();
  637. $this->setNew(true);
  638. $this->setDeleted(false);
  639. }
  640. /**
  641. * Resets all collections of referencing foreign keys.
  642. *
  643. * This method is a user-space workaround for PHP's inability to garbage collect objects
  644. * with circular references. This is currently necessary when using Propel in certain
  645. * daemon or large-volumne/high-memory operations.
  646. *
  647. * @param boolean $deep Whether to also clear the references on all associated objects.
  648. */
  649. public function clearAllReferences($deep = false)
  650. {
  651. if ($deep) {
  652. } // if ($deep)
  653. }
  654. /**
  655. * Catches calls to virtual methods
  656. */
  657. public function __call($name, $params)
  658. {
  659. if (preg_match('/get(\w+)/', $name, $matches)) {
  660. $virtualColumn = $matches[1];
  661. if ($this->hasVirtualColumn($virtualColumn)) {
  662. return $this->getVirtualColumn($virtualColumn);
  663. }
  664. // no lcfirst in php<5.3...
  665. $virtualColumn[0] = strtolower($virtualColumn[0]);
  666. if ($this->hasVirtualColumn($virtualColumn)) {
  667. return $this->getVirtualColumn($virtualColumn);
  668. }
  669. }
  670. throw new PropelException('Call to undefined method: ' . $name);
  671. }
  672. } // BaseCcStreamSetting