PageRenderTime 63ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/package/app/app/plugins/metadata/lib/model/om/BaseMetadataProfileField.php

https://bitbucket.org/pandaos/kaltura
PHP | 1466 lines | 729 code | 188 blank | 549 comment | 120 complexity | 98047fe00c086b798da0f5c675640abe MD5 | raw file
Possible License(s): AGPL-3.0, GPL-3.0, BSD-3-Clause, LGPL-2.1, GPL-2.0, LGPL-3.0, JSON, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'metadata_profile_field' table.
  4. *
  5. *
  6. *
  7. * @package plugins.metadata
  8. * @subpackage model.om
  9. */
  10. abstract class BaseMetadataProfileField extends BaseObject implements Persistent {
  11. /**
  12. * The Peer class.
  13. * Instance provides a convenient way of calling static methods on a class
  14. * that calling code may not be able to identify.
  15. * @var MetadataProfileFieldPeer
  16. */
  17. protected static $peer;
  18. /**
  19. * The value for the id field.
  20. * @var int
  21. */
  22. protected $id;
  23. /**
  24. * The value for the created_at field.
  25. * @var string
  26. */
  27. protected $created_at;
  28. /**
  29. * The value for the updated_at field.
  30. * @var string
  31. */
  32. protected $updated_at;
  33. /**
  34. * The value for the metadata_profile_id field.
  35. * @var int
  36. */
  37. protected $metadata_profile_id;
  38. /**
  39. * The value for the metadata_profile_version field.
  40. * @var int
  41. */
  42. protected $metadata_profile_version;
  43. /**
  44. * The value for the partner_id field.
  45. * @var int
  46. */
  47. protected $partner_id;
  48. /**
  49. * The value for the label field.
  50. * @var string
  51. */
  52. protected $label;
  53. /**
  54. * The value for the key field.
  55. * @var string
  56. */
  57. protected $key;
  58. /**
  59. * The value for the type field.
  60. * @var string
  61. */
  62. protected $type;
  63. /**
  64. * The value for the xpath field.
  65. * @var string
  66. */
  67. protected $xpath;
  68. /**
  69. * The value for the status field.
  70. * @var int
  71. */
  72. protected $status;
  73. /**
  74. * The value for the search_index field.
  75. * @var int
  76. */
  77. protected $search_index;
  78. /**
  79. * Flag to prevent endless save loop, if this object is referenced
  80. * by another object which falls in this transaction.
  81. * @var boolean
  82. */
  83. protected $alreadyInSave = false;
  84. /**
  85. * Flag to prevent endless validation loop, if this object is referenced
  86. * by another object which falls in this transaction.
  87. * @var boolean
  88. */
  89. protected $alreadyInValidation = false;
  90. /**
  91. * Store columns old values before the changes
  92. * @var array
  93. */
  94. protected $oldColumnsValues = array();
  95. /**
  96. * @return array
  97. */
  98. public function getColumnsOldValues()
  99. {
  100. return $this->oldColumnsValues;
  101. }
  102. /**
  103. * Get the [id] column value.
  104. *
  105. * @return int
  106. */
  107. public function getId()
  108. {
  109. return $this->id;
  110. }
  111. /**
  112. * Get the [optionally formatted] temporal [created_at] column value.
  113. *
  114. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  115. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  116. *
  117. * @param string $format The date/time format string (either date()-style or strftime()-style).
  118. * If format is NULL, then the raw unix timestamp integer will be returned.
  119. * @return mixed Formatted date/time value as string or (integer) unix timestamp (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
  120. * @throws PropelException - if unable to parse/validate the date/time value.
  121. */
  122. public function getCreatedAt($format = 'Y-m-d H:i:s')
  123. {
  124. if ($this->created_at === null) {
  125. return null;
  126. }
  127. if ($this->created_at === '0000-00-00 00:00:00') {
  128. // while technically this is not a default value of NULL,
  129. // this seems to be closest in meaning.
  130. return null;
  131. } else {
  132. try {
  133. $dt = new DateTime($this->created_at);
  134. } catch (Exception $x) {
  135. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
  136. }
  137. }
  138. if ($format === null) {
  139. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  140. return (int) $dt->format('U');
  141. } elseif (strpos($format, '%') !== false) {
  142. return strftime($format, $dt->format('U'));
  143. } else {
  144. return $dt->format($format);
  145. }
  146. }
  147. /**
  148. * Get the [optionally formatted] temporal [updated_at] column value.
  149. *
  150. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  151. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  152. *
  153. * @param string $format The date/time format string (either date()-style or strftime()-style).
  154. * If format is NULL, then the raw unix timestamp integer will be returned.
  155. * @return mixed Formatted date/time value as string or (integer) unix timestamp (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
  156. * @throws PropelException - if unable to parse/validate the date/time value.
  157. */
  158. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  159. {
  160. if ($this->updated_at === null) {
  161. return null;
  162. }
  163. if ($this->updated_at === '0000-00-00 00:00:00') {
  164. // while technically this is not a default value of NULL,
  165. // this seems to be closest in meaning.
  166. return null;
  167. } else {
  168. try {
  169. $dt = new DateTime($this->updated_at);
  170. } catch (Exception $x) {
  171. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
  172. }
  173. }
  174. if ($format === null) {
  175. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  176. return (int) $dt->format('U');
  177. } elseif (strpos($format, '%') !== false) {
  178. return strftime($format, $dt->format('U'));
  179. } else {
  180. return $dt->format($format);
  181. }
  182. }
  183. /**
  184. * Get the [metadata_profile_id] column value.
  185. *
  186. * @return int
  187. */
  188. public function getMetadataProfileId()
  189. {
  190. return $this->metadata_profile_id;
  191. }
  192. /**
  193. * Get the [metadata_profile_version] column value.
  194. *
  195. * @return int
  196. */
  197. public function getMetadataProfileVersion()
  198. {
  199. return $this->metadata_profile_version;
  200. }
  201. /**
  202. * Get the [partner_id] column value.
  203. *
  204. * @return int
  205. */
  206. public function getPartnerId()
  207. {
  208. return $this->partner_id;
  209. }
  210. /**
  211. * Get the [label] column value.
  212. *
  213. * @return string
  214. */
  215. public function getLabel()
  216. {
  217. return $this->label;
  218. }
  219. /**
  220. * Get the [key] column value.
  221. *
  222. * @return string
  223. */
  224. public function getKey()
  225. {
  226. return $this->key;
  227. }
  228. /**
  229. * Get the [type] column value.
  230. *
  231. * @return string
  232. */
  233. public function getType()
  234. {
  235. return $this->type;
  236. }
  237. /**
  238. * Get the [xpath] column value.
  239. *
  240. * @return string
  241. */
  242. public function getXpath()
  243. {
  244. return $this->xpath;
  245. }
  246. /**
  247. * Get the [status] column value.
  248. *
  249. * @return int
  250. */
  251. public function getStatus()
  252. {
  253. return $this->status;
  254. }
  255. /**
  256. * Get the [search_index] column value.
  257. *
  258. * @return int
  259. */
  260. public function getSearchIndex()
  261. {
  262. return $this->search_index;
  263. }
  264. /**
  265. * Set the value of [id] column.
  266. *
  267. * @param int $v new value
  268. * @return MetadataProfileField The current object (for fluent API support)
  269. */
  270. public function setId($v)
  271. {
  272. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::ID]))
  273. $this->oldColumnsValues[MetadataProfileFieldPeer::ID] = $this->id;
  274. if ($v !== null) {
  275. $v = (int) $v;
  276. }
  277. if ($this->id !== $v) {
  278. $this->id = $v;
  279. $this->modifiedColumns[] = MetadataProfileFieldPeer::ID;
  280. }
  281. return $this;
  282. } // setId()
  283. /**
  284. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  285. *
  286. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  287. * be treated as NULL for temporal objects.
  288. * @return MetadataProfileField The current object (for fluent API support)
  289. */
  290. public function setCreatedAt($v)
  291. {
  292. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  293. // -- which is unexpected, to say the least.
  294. if ($v === null || $v === '') {
  295. $dt = null;
  296. } elseif ($v instanceof DateTime) {
  297. $dt = $v;
  298. } else {
  299. // some string/numeric value passed; we normalize that so that we can
  300. // validate it.
  301. try {
  302. if (is_numeric($v)) { // if it's a unix timestamp
  303. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  304. // We have to explicitly specify and then change the time zone because of a
  305. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  306. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  307. } else {
  308. $dt = new DateTime($v);
  309. }
  310. } catch (Exception $x) {
  311. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  312. }
  313. }
  314. if ( $this->created_at !== null || $dt !== null ) {
  315. // (nested ifs are a little easier to read in this case)
  316. $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  317. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  318. if ( ($currNorm !== $newNorm) // normalized values don't match
  319. )
  320. {
  321. $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  322. $this->modifiedColumns[] = MetadataProfileFieldPeer::CREATED_AT;
  323. }
  324. } // if either are not null
  325. return $this;
  326. } // setCreatedAt()
  327. /**
  328. * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
  329. *
  330. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  331. * be treated as NULL for temporal objects.
  332. * @return MetadataProfileField The current object (for fluent API support)
  333. */
  334. public function setUpdatedAt($v)
  335. {
  336. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  337. // -- which is unexpected, to say the least.
  338. if ($v === null || $v === '') {
  339. $dt = null;
  340. } elseif ($v instanceof DateTime) {
  341. $dt = $v;
  342. } else {
  343. // some string/numeric value passed; we normalize that so that we can
  344. // validate it.
  345. try {
  346. if (is_numeric($v)) { // if it's a unix timestamp
  347. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  348. // We have to explicitly specify and then change the time zone because of a
  349. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  350. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  351. } else {
  352. $dt = new DateTime($v);
  353. }
  354. } catch (Exception $x) {
  355. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  356. }
  357. }
  358. if ( $this->updated_at !== null || $dt !== null ) {
  359. // (nested ifs are a little easier to read in this case)
  360. $currNorm = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  361. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  362. if ( ($currNorm !== $newNorm) // normalized values don't match
  363. )
  364. {
  365. $this->updated_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  366. $this->modifiedColumns[] = MetadataProfileFieldPeer::UPDATED_AT;
  367. }
  368. } // if either are not null
  369. return $this;
  370. } // setUpdatedAt()
  371. /**
  372. * Set the value of [metadata_profile_id] column.
  373. *
  374. * @param int $v new value
  375. * @return MetadataProfileField The current object (for fluent API support)
  376. */
  377. public function setMetadataProfileId($v)
  378. {
  379. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::METADATA_PROFILE_ID]))
  380. $this->oldColumnsValues[MetadataProfileFieldPeer::METADATA_PROFILE_ID] = $this->metadata_profile_id;
  381. if ($v !== null) {
  382. $v = (int) $v;
  383. }
  384. if ($this->metadata_profile_id !== $v) {
  385. $this->metadata_profile_id = $v;
  386. $this->modifiedColumns[] = MetadataProfileFieldPeer::METADATA_PROFILE_ID;
  387. }
  388. return $this;
  389. } // setMetadataProfileId()
  390. /**
  391. * Set the value of [metadata_profile_version] column.
  392. *
  393. * @param int $v new value
  394. * @return MetadataProfileField The current object (for fluent API support)
  395. */
  396. public function setMetadataProfileVersion($v)
  397. {
  398. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::METADATA_PROFILE_VERSION]))
  399. $this->oldColumnsValues[MetadataProfileFieldPeer::METADATA_PROFILE_VERSION] = $this->metadata_profile_version;
  400. if ($v !== null) {
  401. $v = (int) $v;
  402. }
  403. if ($this->metadata_profile_version !== $v) {
  404. $this->metadata_profile_version = $v;
  405. $this->modifiedColumns[] = MetadataProfileFieldPeer::METADATA_PROFILE_VERSION;
  406. }
  407. return $this;
  408. } // setMetadataProfileVersion()
  409. /**
  410. * Set the value of [partner_id] column.
  411. *
  412. * @param int $v new value
  413. * @return MetadataProfileField The current object (for fluent API support)
  414. */
  415. public function setPartnerId($v)
  416. {
  417. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::PARTNER_ID]))
  418. $this->oldColumnsValues[MetadataProfileFieldPeer::PARTNER_ID] = $this->partner_id;
  419. if ($v !== null) {
  420. $v = (int) $v;
  421. }
  422. if ($this->partner_id !== $v) {
  423. $this->partner_id = $v;
  424. $this->modifiedColumns[] = MetadataProfileFieldPeer::PARTNER_ID;
  425. }
  426. return $this;
  427. } // setPartnerId()
  428. /**
  429. * Set the value of [label] column.
  430. *
  431. * @param string $v new value
  432. * @return MetadataProfileField The current object (for fluent API support)
  433. */
  434. public function setLabel($v)
  435. {
  436. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::LABEL]))
  437. $this->oldColumnsValues[MetadataProfileFieldPeer::LABEL] = $this->label;
  438. if ($v !== null) {
  439. $v = (string) $v;
  440. }
  441. if ($this->label !== $v) {
  442. $this->label = $v;
  443. $this->modifiedColumns[] = MetadataProfileFieldPeer::LABEL;
  444. }
  445. return $this;
  446. } // setLabel()
  447. /**
  448. * Set the value of [key] column.
  449. *
  450. * @param string $v new value
  451. * @return MetadataProfileField The current object (for fluent API support)
  452. */
  453. public function setKey($v)
  454. {
  455. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::KEY]))
  456. $this->oldColumnsValues[MetadataProfileFieldPeer::KEY] = $this->key;
  457. if ($v !== null) {
  458. $v = (string) $v;
  459. }
  460. if ($this->key !== $v) {
  461. $this->key = $v;
  462. $this->modifiedColumns[] = MetadataProfileFieldPeer::KEY;
  463. }
  464. return $this;
  465. } // setKey()
  466. /**
  467. * Set the value of [type] column.
  468. *
  469. * @param string $v new value
  470. * @return MetadataProfileField The current object (for fluent API support)
  471. */
  472. public function setType($v)
  473. {
  474. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::TYPE]))
  475. $this->oldColumnsValues[MetadataProfileFieldPeer::TYPE] = $this->type;
  476. if ($v !== null) {
  477. $v = (string) $v;
  478. }
  479. if ($this->type !== $v) {
  480. $this->type = $v;
  481. $this->modifiedColumns[] = MetadataProfileFieldPeer::TYPE;
  482. }
  483. return $this;
  484. } // setType()
  485. /**
  486. * Set the value of [xpath] column.
  487. *
  488. * @param string $v new value
  489. * @return MetadataProfileField The current object (for fluent API support)
  490. */
  491. public function setXpath($v)
  492. {
  493. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::XPATH]))
  494. $this->oldColumnsValues[MetadataProfileFieldPeer::XPATH] = $this->xpath;
  495. if ($v !== null) {
  496. $v = (string) $v;
  497. }
  498. if ($this->xpath !== $v) {
  499. $this->xpath = $v;
  500. $this->modifiedColumns[] = MetadataProfileFieldPeer::XPATH;
  501. }
  502. return $this;
  503. } // setXpath()
  504. /**
  505. * Set the value of [status] column.
  506. *
  507. * @param int $v new value
  508. * @return MetadataProfileField The current object (for fluent API support)
  509. */
  510. public function setStatus($v)
  511. {
  512. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::STATUS]))
  513. $this->oldColumnsValues[MetadataProfileFieldPeer::STATUS] = $this->status;
  514. if ($v !== null) {
  515. $v = (int) $v;
  516. }
  517. if ($this->status !== $v) {
  518. $this->status = $v;
  519. $this->modifiedColumns[] = MetadataProfileFieldPeer::STATUS;
  520. }
  521. return $this;
  522. } // setStatus()
  523. /**
  524. * Set the value of [search_index] column.
  525. *
  526. * @param int $v new value
  527. * @return MetadataProfileField The current object (for fluent API support)
  528. */
  529. public function setSearchIndex($v)
  530. {
  531. if(!isset($this->oldColumnsValues[MetadataProfileFieldPeer::SEARCH_INDEX]))
  532. $this->oldColumnsValues[MetadataProfileFieldPeer::SEARCH_INDEX] = $this->search_index;
  533. if ($v !== null) {
  534. $v = (int) $v;
  535. }
  536. if ($this->search_index !== $v) {
  537. $this->search_index = $v;
  538. $this->modifiedColumns[] = MetadataProfileFieldPeer::SEARCH_INDEX;
  539. }
  540. return $this;
  541. } // setSearchIndex()
  542. /**
  543. * Indicates whether the columns in this object are only set to default values.
  544. *
  545. * This method can be used in conjunction with isModified() to indicate whether an object is both
  546. * modified _and_ has some values set which are non-default.
  547. *
  548. * @return boolean Whether the columns in this object are only been set with default values.
  549. */
  550. public function hasOnlyDefaultValues()
  551. {
  552. // otherwise, everything was equal, so return TRUE
  553. return true;
  554. } // hasOnlyDefaultValues()
  555. /**
  556. * Hydrates (populates) the object variables with values from the database resultset.
  557. *
  558. * An offset (0-based "start column") is specified so that objects can be hydrated
  559. * with a subset of the columns in the resultset rows. This is needed, for example,
  560. * for results of JOIN queries where the resultset row includes columns from two or
  561. * more tables.
  562. *
  563. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  564. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  565. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  566. * @return int next starting column
  567. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  568. */
  569. public function hydrate($row, $startcol = 0, $rehydrate = false)
  570. {
  571. try {
  572. $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
  573. $this->created_at = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
  574. $this->updated_at = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
  575. $this->metadata_profile_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
  576. $this->metadata_profile_version = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
  577. $this->partner_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
  578. $this->label = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
  579. $this->key = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
  580. $this->type = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
  581. $this->xpath = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
  582. $this->status = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null;
  583. $this->search_index = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
  584. $this->resetModified();
  585. $this->setNew(false);
  586. if ($rehydrate) {
  587. $this->ensureConsistency();
  588. }
  589. // FIXME - using NUM_COLUMNS may be clearer.
  590. return $startcol + 12; // 12 = MetadataProfileFieldPeer::NUM_COLUMNS - MetadataProfileFieldPeer::NUM_LAZY_LOAD_COLUMNS).
  591. } catch (Exception $e) {
  592. throw new PropelException("Error populating MetadataProfileField object", $e);
  593. }
  594. }
  595. /**
  596. * Checks and repairs the internal consistency of the object.
  597. *
  598. * This method is executed after an already-instantiated object is re-hydrated
  599. * from the database. It exists to check any foreign keys to make sure that
  600. * the objects related to the current object are correct based on foreign key.
  601. *
  602. * You can override this method in the stub class, but you should always invoke
  603. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  604. * in case your model changes.
  605. *
  606. * @throws PropelException
  607. */
  608. public function ensureConsistency()
  609. {
  610. } // ensureConsistency
  611. /**
  612. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  613. *
  614. * This will only work if the object has been saved and has a valid primary key set.
  615. *
  616. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  617. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  618. * @return void
  619. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  620. */
  621. public function reload($deep = false, PropelPDO $con = null)
  622. {
  623. if ($this->isDeleted()) {
  624. throw new PropelException("Cannot reload a deleted object.");
  625. }
  626. if ($this->isNew()) {
  627. throw new PropelException("Cannot reload an unsaved object.");
  628. }
  629. if ($con === null) {
  630. $con = Propel::getConnection(MetadataProfileFieldPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  631. }
  632. // We don't need to alter the object instance pool; we're just modifying this instance
  633. // already in the pool.
  634. MetadataProfileFieldPeer::setUseCriteriaFilter(false);
  635. $stmt = MetadataProfileFieldPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  636. MetadataProfileFieldPeer::setUseCriteriaFilter(true);
  637. $row = $stmt->fetch(PDO::FETCH_NUM);
  638. $stmt->closeCursor();
  639. if (!$row) {
  640. throw new PropelException('Cannot find matching row in the database to reload object values.');
  641. }
  642. $this->hydrate($row, 0, true); // rehydrate
  643. if ($deep) { // also de-associate any related objects?
  644. } // if (deep)
  645. }
  646. /**
  647. * Removes this object from datastore and sets delete attribute.
  648. *
  649. * @param PropelPDO $con
  650. * @return void
  651. * @throws PropelException
  652. * @see BaseObject::setDeleted()
  653. * @see BaseObject::isDeleted()
  654. */
  655. public function delete(PropelPDO $con = null)
  656. {
  657. if ($this->isDeleted()) {
  658. throw new PropelException("This object has already been deleted.");
  659. }
  660. if ($con === null) {
  661. $con = Propel::getConnection(MetadataProfileFieldPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  662. }
  663. $con->beginTransaction();
  664. try {
  665. $ret = $this->preDelete($con);
  666. if ($ret) {
  667. MetadataProfileFieldPeer::doDelete($this, $con);
  668. $this->postDelete($con);
  669. $this->setDeleted(true);
  670. $con->commit();
  671. } else {
  672. $con->commit();
  673. }
  674. } catch (PropelException $e) {
  675. $con->rollBack();
  676. throw $e;
  677. }
  678. }
  679. /**
  680. * Persists this object to the database.
  681. *
  682. * If the object is new, it inserts it; otherwise an update is performed.
  683. * All modified related objects will also be persisted in the doSave()
  684. * method. This method wraps all precipitate database operations in a
  685. * single transaction.
  686. *
  687. * @param PropelPDO $con
  688. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  689. * @throws PropelException
  690. * @see doSave()
  691. */
  692. public function save(PropelPDO $con = null)
  693. {
  694. if ($this->isDeleted()) {
  695. throw new PropelException("You cannot save an object that has been deleted.");
  696. }
  697. if ($con === null) {
  698. $con = Propel::getConnection(MetadataProfileFieldPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  699. }
  700. $con->beginTransaction();
  701. $isInsert = $this->isNew();
  702. try {
  703. $ret = $this->preSave($con);
  704. if ($isInsert) {
  705. $ret = $ret && $this->preInsert($con);
  706. } else {
  707. $ret = $ret && $this->preUpdate($con);
  708. }
  709. if ($ret) {
  710. $affectedRows = $this->doSave($con);
  711. if ($isInsert) {
  712. $this->postInsert($con);
  713. } else {
  714. $this->postUpdate($con);
  715. }
  716. $this->postSave($con);
  717. MetadataProfileFieldPeer::addInstanceToPool($this);
  718. } else {
  719. $affectedRows = 0;
  720. }
  721. $con->commit();
  722. return $affectedRows;
  723. } catch (PropelException $e) {
  724. $con->rollBack();
  725. throw $e;
  726. }
  727. }
  728. /**
  729. * Performs the work of inserting or updating the row in the database.
  730. *
  731. * If the object is new, it inserts it; otherwise an update is performed.
  732. * All related objects are also updated in this method.
  733. *
  734. * @param PropelPDO $con
  735. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  736. * @throws PropelException
  737. * @see save()
  738. */
  739. protected function doSave(PropelPDO $con)
  740. {
  741. $affectedRows = 0; // initialize var to track total num of affected rows
  742. if (!$this->alreadyInSave) {
  743. $this->alreadyInSave = true;
  744. if ($this->isNew() ) {
  745. $this->modifiedColumns[] = MetadataProfileFieldPeer::ID;
  746. }
  747. // If this object has been modified, then save it to the database.
  748. if ($this->isModified()) {
  749. if ($this->isNew()) {
  750. $pk = MetadataProfileFieldPeer::doInsert($this, $con);
  751. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  752. // should always be true here (even though technically
  753. // BasePeer::doInsert() can insert multiple rows).
  754. $this->setId($pk); //[IMV] update autoincrement primary key
  755. $this->setNew(false);
  756. } else {
  757. $affectedRows += MetadataProfileFieldPeer::doUpdate($this, $con);
  758. }
  759. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  760. }
  761. $this->alreadyInSave = false;
  762. }
  763. return $affectedRows;
  764. } // doSave()
  765. /**
  766. * Override in order to use the query cache.
  767. * Cache invalidation keys are used to determine when cached queries are valid.
  768. * Before returning a query result from the cache, the time of the cached query
  769. * is compared to the time saved in the invalidation key.
  770. * A cached query will only be used if it's newer than the matching invalidation key.
  771. *
  772. * @return array Array of keys that will should be updated when this object is modified.
  773. */
  774. public function getCacheInvalidationKeys()
  775. {
  776. return array();
  777. }
  778. /**
  779. * Code to be run before persisting the object
  780. * @param PropelPDO $con
  781. * @return bloolean
  782. */
  783. public function preSave(PropelPDO $con = null)
  784. {
  785. return parent::preSave($con);
  786. }
  787. /**
  788. * Code to be run after persisting the object
  789. * @param PropelPDO $con
  790. */
  791. public function postSave(PropelPDO $con = null)
  792. {
  793. $this->oldColumnsValues = array();
  794. }
  795. /**
  796. * Code to be run before inserting to database
  797. * @param PropelPDO $con
  798. * @return boolean
  799. */
  800. public function preInsert(PropelPDO $con = null)
  801. {
  802. $this->setCreatedAt(time());
  803. $this->setUpdatedAt(time());
  804. return true;
  805. }
  806. /**
  807. * Code to be run after inserting to database
  808. * @param PropelPDO $con
  809. */
  810. public function postInsert(PropelPDO $con = null)
  811. {
  812. kQueryCache::invalidateQueryCache($this);
  813. kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
  814. if($this->copiedFrom)
  815. kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
  816. }
  817. /**
  818. * Code to be run after updating the object in database
  819. * @param PropelPDO $con
  820. */
  821. public function postUpdate(PropelPDO $con = null)
  822. {
  823. if ($this->alreadyInSave)
  824. {
  825. return;
  826. }
  827. if($this->isModified())
  828. {
  829. kQueryCache::invalidateQueryCache($this);
  830. kEventsManager::raiseEvent(new kObjectChangedEvent($this, $this->tempModifiedColumns));
  831. }
  832. $this->tempModifiedColumns = array();
  833. }
  834. /**
  835. * Saves the modified columns temporarily while saving
  836. * @var array
  837. */
  838. private $tempModifiedColumns = array();
  839. /**
  840. * Returns whether the object has been modified.
  841. *
  842. * @return boolean True if the object has been modified.
  843. */
  844. public function isModified()
  845. {
  846. if(!empty($this->tempModifiedColumns))
  847. return true;
  848. return !empty($this->modifiedColumns);
  849. }
  850. /**
  851. * Has specified column been modified?
  852. *
  853. * @param string $col
  854. * @return boolean True if $col has been modified.
  855. */
  856. public function isColumnModified($col)
  857. {
  858. if(in_array($col, $this->tempModifiedColumns))
  859. return true;
  860. return in_array($col, $this->modifiedColumns);
  861. }
  862. /**
  863. * Code to be run before updating the object in database
  864. * @param PropelPDO $con
  865. * @return boolean
  866. */
  867. public function preUpdate(PropelPDO $con = null)
  868. {
  869. if ($this->alreadyInSave)
  870. {
  871. return true;
  872. }
  873. if($this->isModified())
  874. $this->setUpdatedAt(time());
  875. $this->tempModifiedColumns = $this->modifiedColumns;
  876. return true;
  877. }
  878. /**
  879. * Array of ValidationFailed objects.
  880. * @var array ValidationFailed[]
  881. */
  882. protected $validationFailures = array();
  883. /**
  884. * Gets any ValidationFailed objects that resulted from last call to validate().
  885. *
  886. *
  887. * @return array ValidationFailed[]
  888. * @see validate()
  889. */
  890. public function getValidationFailures()
  891. {
  892. return $this->validationFailures;
  893. }
  894. /**
  895. * Validates the objects modified field values and all objects related to this table.
  896. *
  897. * If $columns is either a column name or an array of column names
  898. * only those columns are validated.
  899. *
  900. * @param mixed $columns Column name or an array of column names.
  901. * @return boolean Whether all columns pass validation.
  902. * @see doValidate()
  903. * @see getValidationFailures()
  904. */
  905. public function validate($columns = null)
  906. {
  907. $res = $this->doValidate($columns);
  908. if ($res === true) {
  909. $this->validationFailures = array();
  910. return true;
  911. } else {
  912. $this->validationFailures = $res;
  913. return false;
  914. }
  915. }
  916. /**
  917. * This function performs the validation work for complex object models.
  918. *
  919. * In addition to checking the current object, all related objects will
  920. * also be validated. If all pass then <code>true</code> is returned; otherwise
  921. * an aggreagated array of ValidationFailed objects will be returned.
  922. *
  923. * @param array $columns Array of column names to validate.
  924. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  925. */
  926. protected function doValidate($columns = null)
  927. {
  928. if (!$this->alreadyInValidation) {
  929. $this->alreadyInValidation = true;
  930. $retval = null;
  931. $failureMap = array();
  932. if (($retval = MetadataProfileFieldPeer::doValidate($this, $columns)) !== true) {
  933. $failureMap = array_merge($failureMap, $retval);
  934. }
  935. $this->alreadyInValidation = false;
  936. }
  937. return (!empty($failureMap) ? $failureMap : true);
  938. }
  939. /**
  940. * Retrieves a field from the object by name passed in as a string.
  941. *
  942. * @param string $name name
  943. * @param string $type The type of fieldname the $name is of:
  944. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  945. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  946. * @return mixed Value of field.
  947. */
  948. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  949. {
  950. $pos = MetadataProfileFieldPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  951. $field = $this->getByPosition($pos);
  952. return $field;
  953. }
  954. /**
  955. * Retrieves a field from the object by Position as specified in the xml schema.
  956. * Zero-based.
  957. *
  958. * @param int $pos position in xml schema
  959. * @return mixed Value of field at $pos
  960. */
  961. public function getByPosition($pos)
  962. {
  963. switch($pos) {
  964. case 0:
  965. return $this->getId();
  966. break;
  967. case 1:
  968. return $this->getCreatedAt();
  969. break;
  970. case 2:
  971. return $this->getUpdatedAt();
  972. break;
  973. case 3:
  974. return $this->getMetadataProfileId();
  975. break;
  976. case 4:
  977. return $this->getMetadataProfileVersion();
  978. break;
  979. case 5:
  980. return $this->getPartnerId();
  981. break;
  982. case 6:
  983. return $this->getLabel();
  984. break;
  985. case 7:
  986. return $this->getKey();
  987. break;
  988. case 8:
  989. return $this->getType();
  990. break;
  991. case 9:
  992. return $this->getXpath();
  993. break;
  994. case 10:
  995. return $this->getStatus();
  996. break;
  997. case 11:
  998. return $this->getSearchIndex();
  999. break;
  1000. default:
  1001. return null;
  1002. break;
  1003. } // switch()
  1004. }
  1005. /**
  1006. * Exports the object as an array.
  1007. *
  1008. * You can specify the key type of the array by passing one of the class
  1009. * type constants.
  1010. *
  1011. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1012. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  1013. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  1014. * @return an associative array containing the field names (as keys) and field values
  1015. */
  1016. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  1017. {
  1018. $keys = MetadataProfileFieldPeer::getFieldNames($keyType);
  1019. $result = array(
  1020. $keys[0] => $this->getId(),
  1021. $keys[1] => $this->getCreatedAt(),
  1022. $keys[2] => $this->getUpdatedAt(),
  1023. $keys[3] => $this->getMetadataProfileId(),
  1024. $keys[4] => $this->getMetadataProfileVersion(),
  1025. $keys[5] => $this->getPartnerId(),
  1026. $keys[6] => $this->getLabel(),
  1027. $keys[7] => $this->getKey(),
  1028. $keys[8] => $this->getType(),
  1029. $keys[9] => $this->getXpath(),
  1030. $keys[10] => $this->getStatus(),
  1031. $keys[11] => $this->getSearchIndex(),
  1032. );
  1033. return $result;
  1034. }
  1035. /**
  1036. * Sets a field from the object by name passed in as a string.
  1037. *
  1038. * @param string $name peer name
  1039. * @param mixed $value field value
  1040. * @param string $type The type of fieldname the $name is of:
  1041. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1042. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1043. * @return void
  1044. */
  1045. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  1046. {
  1047. $pos = MetadataProfileFieldPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1048. return $this->setByPosition($pos, $value);
  1049. }
  1050. /**
  1051. * Sets a field from the object by Position as specified in the xml schema.
  1052. * Zero-based.
  1053. *
  1054. * @param int $pos position in xml schema
  1055. * @param mixed $value field value
  1056. * @return void
  1057. */
  1058. public function setByPosition($pos, $value)
  1059. {
  1060. switch($pos) {
  1061. case 0:
  1062. $this->setId($value);
  1063. break;
  1064. case 1:
  1065. $this->setCreatedAt($value);
  1066. break;
  1067. case 2:
  1068. $this->setUpdatedAt($value);
  1069. break;
  1070. case 3:
  1071. $this->setMetadataProfileId($value);
  1072. break;
  1073. case 4:
  1074. $this->setMetadataProfileVersion($value);
  1075. break;
  1076. case 5:
  1077. $this->setPartnerId($value);
  1078. break;
  1079. case 6:
  1080. $this->setLabel($value);
  1081. break;
  1082. case 7:
  1083. $this->setKey($value);
  1084. break;
  1085. case 8:
  1086. $this->setType($value);
  1087. break;
  1088. case 9:
  1089. $this->setXpath($value);
  1090. break;
  1091. case 10:
  1092. $this->setStatus($value);
  1093. break;
  1094. case 11:
  1095. $this->setSearchIndex($value);
  1096. break;
  1097. } // switch()
  1098. }
  1099. /**
  1100. * Populates the object using an array.
  1101. *
  1102. * This is particularly useful when populating an object from one of the
  1103. * request arrays (e.g. $_POST). This method goes through the column
  1104. * names, checking to see whether a matching key exists in populated
  1105. * array. If so the setByName() method is called for that column.
  1106. *
  1107. * You can specify the key type of the array by additionally passing one
  1108. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  1109. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  1110. * The default key type is the column's phpname (e.g. 'AuthorId')
  1111. *
  1112. * @param array $arr An array to populate the object from.
  1113. * @param string $keyType The type of keys the array uses.
  1114. * @return void
  1115. */
  1116. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  1117. {
  1118. $keys = MetadataProfileFieldPeer::getFieldNames($keyType);
  1119. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  1120. if (array_key_exists($keys[1], $arr)) $this->setCreatedAt($arr[$keys[1]]);
  1121. if (array_key_exists($keys[2], $arr)) $this->setUpdatedAt($arr[$keys[2]]);
  1122. if (array_key_exists($keys[3], $arr)) $this->setMetadataProfileId($arr[$keys[3]]);
  1123. if (array_key_exists($keys[4], $arr)) $this->setMetadataProfileVersion($arr[$keys[4]]);
  1124. if (array_key_exists($keys[5], $arr)) $this->setPartnerId($arr[$keys[5]]);
  1125. if (array_key_exists($keys[6], $arr)) $this->setLabel($arr[$keys[6]]);
  1126. if (array_key_exists($keys[7], $arr)) $this->setKey($arr[$keys[7]]);
  1127. if (array_key_exists($keys[8], $arr)) $this->setType($arr[$keys[8]]);
  1128. if (array_key_exists($keys[9], $arr)) $this->setXpath($arr[$keys[9]]);
  1129. if (array_key_exists($keys[10], $arr)) $this->setStatus($arr[$keys[10]]);
  1130. if (array_key_exists($keys[11], $arr)) $this->setSearchIndex($arr[$keys[11]]);
  1131. }
  1132. /**
  1133. * Build a Criteria object containing the values of all modified columns in this object.
  1134. *
  1135. * @return Criteria The Criteria object containing all modified values.
  1136. */
  1137. public function buildCriteria()
  1138. {
  1139. $criteria = new Criteria(MetadataProfileFieldPeer::DATABASE_NAME);
  1140. if ($this->isColumnModified(MetadataProfileFieldPeer::ID)) $criteria->add(MetadataProfileFieldPeer::ID, $this->id);
  1141. if ($this->isColumnModified(MetadataProfileFieldPeer::CREATED_AT)) $criteria->add(MetadataProfileFieldPeer::CREATED_AT, $this->created_at);
  1142. if ($this->isColumnModified(MetadataProfileFieldPeer::UPDATED_AT)) $criteria->add(MetadataProfileFieldPeer::UPDATED_AT, $this->updated_at);
  1143. if ($this->isColumnModified(MetadataProfileFieldPeer::METADATA_PROFILE_ID)) $criteria->add(MetadataProfileFieldPeer::METADATA_PROFILE_ID, $this->metadata_profile_id);
  1144. if ($this->isColumnModified(MetadataProfileFieldPeer::METADATA_PROFILE_VERSION)) $criteria->add(MetadataProfileFieldPeer::METADATA_PROFILE_VERSION, $this->metadata_profile_version);
  1145. if ($this->isColumnModified(MetadataProfileFieldPeer::PARTNER_ID)) $criteria->add(MetadataProfileFieldPeer::PARTNER_ID, $this->partner_id);
  1146. if ($this->isColumnModified(MetadataProfileFieldPeer::LABEL)) $criteria->add(MetadataProfileFieldPeer::LABEL, $this->label);
  1147. if ($this->isColumnModified(MetadataProfileFieldPeer::KEY)) $criteria->add(MetadataProfileFieldPeer::KEY, $this->key);
  1148. if ($this->isColumnModified(MetadataProfileFieldPeer::TYPE)) $criteria->add(MetadataProfileFieldPeer::TYPE, $this->type);
  1149. if ($this->isColumnModified(MetadataProfileFieldPeer::XPATH)) $criteria->add(MetadataProfileFieldPeer::XPATH, $this->xpath);
  1150. if ($this->isColumnModified(MetadataProfileFieldPeer::STATUS)) $criteria->add(MetadataProfileFieldPeer::STATUS, $this->status);
  1151. if ($this->isColumnModified(MetadataProfileFieldPeer::SEARCH_INDEX)) $criteria->add(MetadataProfileFieldPeer::SEARCH_INDEX, $this->search_index);
  1152. return $criteria;
  1153. }
  1154. /**
  1155. * Builds a Criteria object containing the primary key for this object.
  1156. *
  1157. * Unlike buildCriteria() this method includes the primary key values regardless
  1158. * of whether or not they have been modified.
  1159. *
  1160. * @return Criteria The Criteria object containing value(s) for primary key(s).
  1161. */
  1162. public function buildPkeyCriteria()
  1163. {
  1164. $criteria = new Criteria(MetadataProfileFieldPeer::DATABASE_NAME);
  1165. $criteria->add(MetadataProfileFieldPeer::ID, $this->id);
  1166. return $criteria;
  1167. }
  1168. /**
  1169. * Returns the primary key for this object (row).
  1170. * @return int
  1171. */
  1172. public function getPrimaryKey()
  1173. {
  1174. return $this->getId();
  1175. }
  1176. /**
  1177. * Generic method to set the primary key (id column).
  1178. *
  1179. * @param int $key Primary key.
  1180. * @return void
  1181. */
  1182. public function setPrimaryKey($key)
  1183. {
  1184. $this->setId($key);
  1185. }
  1186. /**
  1187. * Sets contents of passed object to values from current object.
  1188. *
  1189. * If desired, this method can also make copies of all associated (fkey referrers)
  1190. * objects.
  1191. *
  1192. * @param object $copyObj An object of MetadataProfileField (or compatible) type.
  1193. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1194. * @throws PropelException
  1195. */
  1196. public function copyInto($copyObj, $deepCopy = false)
  1197. {
  1198. $copyObj->setCreatedAt($this->created_at);
  1199. $copyObj->setUpdatedAt($this->updated_at);
  1200. $copyObj->setMetadataProfileId($this->metadata_profile_id);
  1201. $copyObj->setMetadataProfileVersion($this->metadata_profile_version);
  1202. $copyObj->setPartnerId($this->partner_id);
  1203. $copyObj->setLabel($this->label);
  1204. $copyObj->setKey($this->key);
  1205. $copyObj->setType($this->type);
  1206. $copyObj->setXpath($this->xpath);
  1207. $copyObj->setStatus($this->status);
  1208. $copyObj->setSearchIndex($this->search_index);
  1209. $copyObj->setNew(true);
  1210. $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
  1211. }
  1212. /**
  1213. * Makes a copy of this object that will be inserted as a new row in table when saved.
  1214. * It creates a new object filling in the simple attributes, but skipping any primary
  1215. * keys that are defined for the table.
  1216. *
  1217. * If desired, this method can also make copies of all associated (fkey referrers)
  1218. * objects.
  1219. *
  1220. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1221. * @return MetadataProfileField Clone of current object.
  1222. * @throws PropelException
  1223. */
  1224. public function copy($deepCopy = false)
  1225. {
  1226. // we use get_class(), because this might be a subclass
  1227. $clazz = get_class($this);
  1228. $copyObj = new $clazz();
  1229. $this->copyInto($copyObj, $deepCopy);
  1230. $copyObj->setCopiedFrom($this);
  1231. return $copyObj;
  1232. }
  1233. /**
  1234. * Stores the source object that this object copied from
  1235. *
  1236. * @var MetadataProfileField Clone of current object.
  1237. */
  1238. protected $copiedFrom = null;
  1239. /**
  1240. * Stores the source object that this object copied from
  1241. *
  1242. * @param MetadataProfileField $copiedFrom Clone of current object.
  1243. */
  1244. public function setCopiedFrom(MetadataProfileField $copiedFrom)
  1245. {
  1246. $this->copiedFrom = $copiedFrom;
  1247. }
  1248. /**
  1249. * Returns a peer instance associated with this om.
  1250. *
  1251. * Since Peer classes are not to have any instance attributes, this method returns the
  1252. * same instance for all member of this class. The method could therefore
  1253. * be static, but this would prevent one from overriding the behavior.
  1254. *
  1255. * @return MetadataProfileFieldPeer
  1256. */
  1257. public function getPeer()
  1258. {
  1259. if (self::$peer === null) {
  1260. self::$peer = new MetadataProfileFieldPeer();
  1261. }
  1262. return self::$peer;
  1263. }
  1264. /**
  1265. * Resets all collections of referencing foreign keys.
  1266. *
  1267. * This method is a user-space workaround for PHP's inability to garbage collect objects
  1268. * with circular references. This is currently necessary when using Propel in certain
  1269. * daemon or large-volumne/high-memory operations.
  1270. *
  1271. * @param boolean $deep Whether to also clear the references on all associated objects.
  1272. */
  1273. public function clearAllReferences($deep = false)
  1274. {
  1275. if ($deep) {
  1276. } // if ($deep)
  1277. }
  1278. } // BaseMetadataProfileField