PageRenderTime 71ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 1ms

/package/app/app/alpha/lib/model/om/Baseentry.php

https://bitbucket.org/pandaos/kaltura
PHP | 6741 lines | 3672 code | 902 blank | 2167 comment | 813 complexity | aebc03c1b4b10b6864d75749fbddb5b3 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 'entry' table.
  4. *
  5. *
  6. *
  7. * @package Core
  8. * @subpackage model.om
  9. */
  10. abstract class Baseentry 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 entryPeer
  16. */
  17. protected static $peer;
  18. /**
  19. * The value for the id field.
  20. * @var string
  21. */
  22. protected $id;
  23. /**
  24. * The value for the kshow_id field.
  25. * @var string
  26. */
  27. protected $kshow_id;
  28. /**
  29. * The value for the kuser_id field.
  30. * @var int
  31. */
  32. protected $kuser_id;
  33. /**
  34. * The value for the name field.
  35. * @var string
  36. */
  37. protected $name;
  38. /**
  39. * The value for the type field.
  40. * @var int
  41. */
  42. protected $type;
  43. /**
  44. * The value for the media_type field.
  45. * @var int
  46. */
  47. protected $media_type;
  48. /**
  49. * The value for the data field.
  50. * @var string
  51. */
  52. protected $data;
  53. /**
  54. * The value for the thumbnail field.
  55. * @var string
  56. */
  57. protected $thumbnail;
  58. /**
  59. * The value for the views field.
  60. * Note: this column has a database default value of: 0
  61. * @var int
  62. */
  63. protected $views;
  64. /**
  65. * The value for the votes field.
  66. * Note: this column has a database default value of: 0
  67. * @var int
  68. */
  69. protected $votes;
  70. /**
  71. * The value for the comments field.
  72. * Note: this column has a database default value of: 0
  73. * @var int
  74. */
  75. protected $comments;
  76. /**
  77. * The value for the favorites field.
  78. * Note: this column has a database default value of: 0
  79. * @var int
  80. */
  81. protected $favorites;
  82. /**
  83. * The value for the total_rank field.
  84. * Note: this column has a database default value of: 0
  85. * @var int
  86. */
  87. protected $total_rank;
  88. /**
  89. * The value for the rank field.
  90. * Note: this column has a database default value of: 0
  91. * @var int
  92. */
  93. protected $rank;
  94. /**
  95. * The value for the tags field.
  96. * @var string
  97. */
  98. protected $tags;
  99. /**
  100. * The value for the anonymous field.
  101. * @var int
  102. */
  103. protected $anonymous;
  104. /**
  105. * The value for the status field.
  106. * @var int
  107. */
  108. protected $status;
  109. /**
  110. * The value for the source field.
  111. * @var int
  112. */
  113. protected $source;
  114. /**
  115. * The value for the source_id field.
  116. * @var string
  117. */
  118. protected $source_id;
  119. /**
  120. * The value for the source_link field.
  121. * @var string
  122. */
  123. protected $source_link;
  124. /**
  125. * The value for the license_type field.
  126. * @var int
  127. */
  128. protected $license_type;
  129. /**
  130. * The value for the credit field.
  131. * @var string
  132. */
  133. protected $credit;
  134. /**
  135. * The value for the length_in_msecs field.
  136. * Note: this column has a database default value of: 0
  137. * @var int
  138. */
  139. protected $length_in_msecs;
  140. /**
  141. * The value for the created_at field.
  142. * @var string
  143. */
  144. protected $created_at;
  145. /**
  146. * The value for the updated_at field.
  147. * @var string
  148. */
  149. protected $updated_at;
  150. /**
  151. * The value for the partner_id field.
  152. * Note: this column has a database default value of: 0
  153. * @var int
  154. */
  155. protected $partner_id;
  156. /**
  157. * The value for the display_in_search field.
  158. * @var int
  159. */
  160. protected $display_in_search;
  161. /**
  162. * The value for the subp_id field.
  163. * Note: this column has a database default value of: 0
  164. * @var int
  165. */
  166. protected $subp_id;
  167. /**
  168. * The value for the custom_data field.
  169. * @var string
  170. */
  171. protected $custom_data;
  172. /**
  173. * The value for the search_text field.
  174. * @var string
  175. */
  176. protected $search_text;
  177. /**
  178. * The value for the screen_name field.
  179. * @var string
  180. */
  181. protected $screen_name;
  182. /**
  183. * The value for the site_url field.
  184. * @var string
  185. */
  186. protected $site_url;
  187. /**
  188. * The value for the permissions field.
  189. * Note: this column has a database default value of: 1
  190. * @var int
  191. */
  192. protected $permissions;
  193. /**
  194. * The value for the group_id field.
  195. * @var string
  196. */
  197. protected $group_id;
  198. /**
  199. * The value for the plays field.
  200. * Note: this column has a database default value of: 0
  201. * @var int
  202. */
  203. protected $plays;
  204. /**
  205. * The value for the partner_data field.
  206. * @var string
  207. */
  208. protected $partner_data;
  209. /**
  210. * The value for the int_id field.
  211. * @var int
  212. */
  213. protected $int_id;
  214. /**
  215. * The value for the indexed_custom_data_1 field.
  216. * @var int
  217. */
  218. protected $indexed_custom_data_1;
  219. /**
  220. * The value for the description field.
  221. * @var string
  222. */
  223. protected $description;
  224. /**
  225. * The value for the media_date field.
  226. * @var string
  227. */
  228. protected $media_date;
  229. /**
  230. * The value for the admin_tags field.
  231. * @var string
  232. */
  233. protected $admin_tags;
  234. /**
  235. * The value for the moderation_status field.
  236. * @var int
  237. */
  238. protected $moderation_status;
  239. /**
  240. * The value for the moderation_count field.
  241. * @var int
  242. */
  243. protected $moderation_count;
  244. /**
  245. * The value for the modified_at field.
  246. * @var string
  247. */
  248. protected $modified_at;
  249. /**
  250. * The value for the puser_id field.
  251. * @var string
  252. */
  253. protected $puser_id;
  254. /**
  255. * The value for the access_control_id field.
  256. * @var int
  257. */
  258. protected $access_control_id;
  259. /**
  260. * The value for the conversion_profile_id field.
  261. * @var int
  262. */
  263. protected $conversion_profile_id;
  264. /**
  265. * The value for the categories field.
  266. * @var string
  267. */
  268. protected $categories;
  269. /**
  270. * The value for the categories_ids field.
  271. * @var string
  272. */
  273. protected $categories_ids;
  274. /**
  275. * The value for the start_date field.
  276. * @var string
  277. */
  278. protected $start_date;
  279. /**
  280. * The value for the end_date field.
  281. * @var string
  282. */
  283. protected $end_date;
  284. /**
  285. * The value for the search_text_discrete field.
  286. * @var string
  287. */
  288. protected $search_text_discrete;
  289. /**
  290. * The value for the flavor_params_ids field.
  291. * @var string
  292. */
  293. protected $flavor_params_ids;
  294. /**
  295. * The value for the available_from field.
  296. * @var string
  297. */
  298. protected $available_from;
  299. /**
  300. * @var kshow
  301. */
  302. protected $akshow;
  303. /**
  304. * @var kuser
  305. */
  306. protected $akuser;
  307. /**
  308. * @var accessControl
  309. */
  310. protected $aaccessControl;
  311. /**
  312. * @var conversionProfile2
  313. */
  314. protected $aconversionProfile2;
  315. /**
  316. * @var array kvote[] Collection to store aggregation of kvote objects.
  317. */
  318. protected $collkvotes;
  319. /**
  320. * @var Criteria The criteria used to select the current contents of collkvotes.
  321. */
  322. private $lastkvoteCriteria = null;
  323. /**
  324. * @var array conversion[] Collection to store aggregation of conversion objects.
  325. */
  326. protected $collconversions;
  327. /**
  328. * @var Criteria The criteria used to select the current contents of collconversions.
  329. */
  330. private $lastconversionCriteria = null;
  331. /**
  332. * @var array WidgetLog[] Collection to store aggregation of WidgetLog objects.
  333. */
  334. protected $collWidgetLogs;
  335. /**
  336. * @var Criteria The criteria used to select the current contents of collWidgetLogs.
  337. */
  338. private $lastWidgetLogCriteria = null;
  339. /**
  340. * @var array moderationFlag[] Collection to store aggregation of moderationFlag objects.
  341. */
  342. protected $collmoderationFlags;
  343. /**
  344. * @var Criteria The criteria used to select the current contents of collmoderationFlags.
  345. */
  346. private $lastmoderationFlagCriteria = null;
  347. /**
  348. * @var array roughcutEntry[] Collection to store aggregation of roughcutEntry objects.
  349. */
  350. protected $collroughcutEntrysRelatedByRoughcutId;
  351. /**
  352. * @var Criteria The criteria used to select the current contents of collroughcutEntrysRelatedByRoughcutId.
  353. */
  354. private $lastroughcutEntryRelatedByRoughcutIdCriteria = null;
  355. /**
  356. * @var array roughcutEntry[] Collection to store aggregation of roughcutEntry objects.
  357. */
  358. protected $collroughcutEntrysRelatedByEntryId;
  359. /**
  360. * @var Criteria The criteria used to select the current contents of collroughcutEntrysRelatedByEntryId.
  361. */
  362. private $lastroughcutEntryRelatedByEntryIdCriteria = null;
  363. /**
  364. * @var array widget[] Collection to store aggregation of widget objects.
  365. */
  366. protected $collwidgets;
  367. /**
  368. * @var Criteria The criteria used to select the current contents of collwidgets.
  369. */
  370. private $lastwidgetCriteria = null;
  371. /**
  372. * @var array assetParamsOutput[] Collection to store aggregation of assetParamsOutput objects.
  373. */
  374. protected $collassetParamsOutputs;
  375. /**
  376. * @var Criteria The criteria used to select the current contents of collassetParamsOutputs.
  377. */
  378. private $lastassetParamsOutputCriteria = null;
  379. /**
  380. * @var array asset[] Collection to store aggregation of asset objects.
  381. */
  382. protected $collassets;
  383. /**
  384. * @var Criteria The criteria used to select the current contents of collassets.
  385. */
  386. private $lastassetCriteria = null;
  387. /**
  388. * Flag to prevent endless save loop, if this object is referenced
  389. * by another object which falls in this transaction.
  390. * @var boolean
  391. */
  392. protected $alreadyInSave = false;
  393. /**
  394. * Flag to indicate if save action actually affected the db.
  395. * @var boolean
  396. */
  397. protected $objectSaved = false;
  398. /**
  399. * Flag to prevent endless validation loop, if this object is referenced
  400. * by another object which falls in this transaction.
  401. * @var boolean
  402. */
  403. protected $alreadyInValidation = false;
  404. /**
  405. * Store columns old values before the changes
  406. * @var array
  407. */
  408. protected $oldColumnsValues = array();
  409. /**
  410. * @return array
  411. */
  412. public function getColumnsOldValues()
  413. {
  414. return $this->oldColumnsValues;
  415. }
  416. /**
  417. * Applies default values to this object.
  418. * This method should be called from the object's constructor (or
  419. * equivalent initialization method).
  420. * @see __construct()
  421. */
  422. public function applyDefaultValues()
  423. {
  424. $this->views = 0;
  425. $this->votes = 0;
  426. $this->comments = 0;
  427. $this->favorites = 0;
  428. $this->total_rank = 0;
  429. $this->rank = 0;
  430. $this->length_in_msecs = 0;
  431. $this->partner_id = 0;
  432. $this->subp_id = 0;
  433. $this->permissions = 1;
  434. $this->plays = 0;
  435. }
  436. /**
  437. * Initializes internal state of Baseentry object.
  438. * @see applyDefaults()
  439. */
  440. public function __construct()
  441. {
  442. parent::__construct();
  443. $this->applyDefaultValues();
  444. }
  445. /**
  446. * Get the [id] column value.
  447. *
  448. * @return string
  449. */
  450. public function getId()
  451. {
  452. return $this->id;
  453. }
  454. /**
  455. * Get the [kshow_id] column value.
  456. *
  457. * @return string
  458. */
  459. public function getKshowId()
  460. {
  461. return $this->kshow_id;
  462. }
  463. /**
  464. * Get the [kuser_id] column value.
  465. *
  466. * @return int
  467. */
  468. public function getKuserId()
  469. {
  470. return $this->kuser_id;
  471. }
  472. /**
  473. * Get the [name] column value.
  474. *
  475. * @return string
  476. */
  477. public function getName()
  478. {
  479. return $this->name;
  480. }
  481. /**
  482. * Get the [type] column value.
  483. *
  484. * @return int
  485. */
  486. public function getType()
  487. {
  488. return $this->type;
  489. }
  490. /**
  491. * Get the [media_type] column value.
  492. *
  493. * @return int
  494. */
  495. public function getMediaType()
  496. {
  497. return $this->media_type;
  498. }
  499. /**
  500. * Get the [data] column value.
  501. *
  502. * @return string
  503. */
  504. public function getData()
  505. {
  506. return $this->data;
  507. }
  508. /**
  509. * Get the [thumbnail] column value.
  510. *
  511. * @return string
  512. */
  513. public function getThumbnail()
  514. {
  515. return $this->thumbnail;
  516. }
  517. /**
  518. * Get the [views] column value.
  519. *
  520. * @return int
  521. */
  522. public function getViews()
  523. {
  524. return $this->views;
  525. }
  526. /**
  527. * Get the [votes] column value.
  528. *
  529. * @return int
  530. */
  531. public function getVotes()
  532. {
  533. return $this->votes;
  534. }
  535. /**
  536. * Get the [comments] column value.
  537. *
  538. * @return int
  539. */
  540. public function getComments()
  541. {
  542. return $this->comments;
  543. }
  544. /**
  545. * Get the [favorites] column value.
  546. *
  547. * @return int
  548. */
  549. public function getFavorites()
  550. {
  551. return $this->favorites;
  552. }
  553. /**
  554. * Get the [total_rank] column value.
  555. *
  556. * @return int
  557. */
  558. public function getTotalRank()
  559. {
  560. return $this->total_rank;
  561. }
  562. /**
  563. * Get the [rank] column value.
  564. *
  565. * @return int
  566. */
  567. public function getRank()
  568. {
  569. return $this->rank;
  570. }
  571. /**
  572. * Get the [tags] column value.
  573. *
  574. * @return string
  575. */
  576. public function getTags()
  577. {
  578. return $this->tags;
  579. }
  580. /**
  581. * Get the [anonymous] column value.
  582. *
  583. * @return int
  584. */
  585. public function getAnonymous()
  586. {
  587. return $this->anonymous;
  588. }
  589. /**
  590. * Get the [status] column value.
  591. *
  592. * @return int
  593. */
  594. public function getStatus()
  595. {
  596. return $this->status;
  597. }
  598. /**
  599. * Get the [source] column value.
  600. *
  601. * @return int
  602. */
  603. public function getSource()
  604. {
  605. return $this->source;
  606. }
  607. /**
  608. * Get the [source_id] column value.
  609. *
  610. * @return string
  611. */
  612. public function getSourceId()
  613. {
  614. return $this->source_id;
  615. }
  616. /**
  617. * Get the [source_link] column value.
  618. *
  619. * @return string
  620. */
  621. public function getSourceLink()
  622. {
  623. return $this->source_link;
  624. }
  625. /**
  626. * Get the [license_type] column value.
  627. *
  628. * @return int
  629. */
  630. public function getLicenseType()
  631. {
  632. return $this->license_type;
  633. }
  634. /**
  635. * Get the [credit] column value.
  636. *
  637. * @return string
  638. */
  639. public function getCredit()
  640. {
  641. return $this->credit;
  642. }
  643. /**
  644. * Get the [length_in_msecs] column value.
  645. *
  646. * @return int
  647. */
  648. public function getLengthInMsecs()
  649. {
  650. return $this->length_in_msecs;
  651. }
  652. /**
  653. * Get the [optionally formatted] temporal [created_at] column value.
  654. *
  655. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  656. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  657. *
  658. * @param string $format The date/time format string (either date()-style or strftime()-style).
  659. * If format is NULL, then the raw unix timestamp integer will be returned.
  660. * @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
  661. * @throws PropelException - if unable to parse/validate the date/time value.
  662. */
  663. public function getCreatedAt($format = 'Y-m-d H:i:s')
  664. {
  665. if ($this->created_at === null) {
  666. return null;
  667. }
  668. if ($this->created_at === '0000-00-00 00:00:00') {
  669. // while technically this is not a default value of NULL,
  670. // this seems to be closest in meaning.
  671. return null;
  672. } else {
  673. try {
  674. $dt = new DateTime($this->created_at);
  675. } catch (Exception $x) {
  676. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
  677. }
  678. }
  679. if ($format === null) {
  680. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  681. return (int) $dt->format('U');
  682. } elseif (strpos($format, '%') !== false) {
  683. return strftime($format, $dt->format('U'));
  684. } else {
  685. return $dt->format($format);
  686. }
  687. }
  688. /**
  689. * Get the [optionally formatted] temporal [updated_at] column value.
  690. *
  691. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  692. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  693. *
  694. * @param string $format The date/time format string (either date()-style or strftime()-style).
  695. * If format is NULL, then the raw unix timestamp integer will be returned.
  696. * @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
  697. * @throws PropelException - if unable to parse/validate the date/time value.
  698. */
  699. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  700. {
  701. if ($this->updated_at === null) {
  702. return null;
  703. }
  704. if ($this->updated_at === '0000-00-00 00:00:00') {
  705. // while technically this is not a default value of NULL,
  706. // this seems to be closest in meaning.
  707. return null;
  708. } else {
  709. try {
  710. $dt = new DateTime($this->updated_at);
  711. } catch (Exception $x) {
  712. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
  713. }
  714. }
  715. if ($format === null) {
  716. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  717. return (int) $dt->format('U');
  718. } elseif (strpos($format, '%') !== false) {
  719. return strftime($format, $dt->format('U'));
  720. } else {
  721. return $dt->format($format);
  722. }
  723. }
  724. /**
  725. * Get the [partner_id] column value.
  726. *
  727. * @return int
  728. */
  729. public function getPartnerId()
  730. {
  731. return $this->partner_id;
  732. }
  733. /**
  734. * Get the [display_in_search] column value.
  735. *
  736. * @return int
  737. */
  738. public function getDisplayInSearch()
  739. {
  740. return $this->display_in_search;
  741. }
  742. /**
  743. * Get the [subp_id] column value.
  744. *
  745. * @return int
  746. */
  747. public function getSubpId()
  748. {
  749. return $this->subp_id;
  750. }
  751. /**
  752. * Get the [custom_data] column value.
  753. *
  754. * @return string
  755. */
  756. public function getCustomData()
  757. {
  758. return $this->custom_data;
  759. }
  760. /**
  761. * Get the [search_text] column value.
  762. *
  763. * @return string
  764. */
  765. public function getSearchText()
  766. {
  767. return $this->search_text;
  768. }
  769. /**
  770. * Get the [screen_name] column value.
  771. *
  772. * @return string
  773. */
  774. public function getScreenName()
  775. {
  776. return $this->screen_name;
  777. }
  778. /**
  779. * Get the [site_url] column value.
  780. *
  781. * @return string
  782. */
  783. public function getSiteUrl()
  784. {
  785. return $this->site_url;
  786. }
  787. /**
  788. * Get the [permissions] column value.
  789. *
  790. * @return int
  791. */
  792. public function getPermissions()
  793. {
  794. return $this->permissions;
  795. }
  796. /**
  797. * Get the [group_id] column value.
  798. *
  799. * @return string
  800. */
  801. public function getGroupId()
  802. {
  803. return $this->group_id;
  804. }
  805. /**
  806. * Get the [plays] column value.
  807. *
  808. * @return int
  809. */
  810. public function getPlays()
  811. {
  812. return $this->plays;
  813. }
  814. /**
  815. * Get the [partner_data] column value.
  816. *
  817. * @return string
  818. */
  819. public function getPartnerData()
  820. {
  821. return $this->partner_data;
  822. }
  823. /**
  824. * Get the [int_id] column value.
  825. *
  826. * @return int
  827. */
  828. public function getIntId()
  829. {
  830. return $this->int_id;
  831. }
  832. /**
  833. * Get the [indexed_custom_data_1] column value.
  834. *
  835. * @return int
  836. */
  837. public function getIndexedCustomData1()
  838. {
  839. return $this->indexed_custom_data_1;
  840. }
  841. /**
  842. * Get the [description] column value.
  843. *
  844. * @return string
  845. */
  846. public function getDescription()
  847. {
  848. return $this->description;
  849. }
  850. /**
  851. * Get the [optionally formatted] temporal [media_date] column value.
  852. *
  853. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  854. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  855. *
  856. * @param string $format The date/time format string (either date()-style or strftime()-style).
  857. * If format is NULL, then the raw unix timestamp integer will be returned.
  858. * @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
  859. * @throws PropelException - if unable to parse/validate the date/time value.
  860. */
  861. public function getMediaDate($format = 'Y-m-d H:i:s')
  862. {
  863. if ($this->media_date === null) {
  864. return null;
  865. }
  866. if ($this->media_date === '0000-00-00 00:00:00') {
  867. // while technically this is not a default value of NULL,
  868. // this seems to be closest in meaning.
  869. return null;
  870. } else {
  871. try {
  872. $dt = new DateTime($this->media_date);
  873. } catch (Exception $x) {
  874. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->media_date, true), $x);
  875. }
  876. }
  877. if ($format === null) {
  878. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  879. return (int) $dt->format('U');
  880. } elseif (strpos($format, '%') !== false) {
  881. return strftime($format, $dt->format('U'));
  882. } else {
  883. return $dt->format($format);
  884. }
  885. }
  886. /**
  887. * Get the [admin_tags] column value.
  888. *
  889. * @return string
  890. */
  891. public function getAdminTags()
  892. {
  893. return $this->admin_tags;
  894. }
  895. /**
  896. * Get the [moderation_status] column value.
  897. *
  898. * @return int
  899. */
  900. public function getModerationStatus()
  901. {
  902. return $this->moderation_status;
  903. }
  904. /**
  905. * Get the [moderation_count] column value.
  906. *
  907. * @return int
  908. */
  909. public function getModerationCount()
  910. {
  911. return $this->moderation_count;
  912. }
  913. /**
  914. * Get the [optionally formatted] temporal [modified_at] column value.
  915. *
  916. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  917. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  918. *
  919. * @param string $format The date/time format string (either date()-style or strftime()-style).
  920. * If format is NULL, then the raw unix timestamp integer will be returned.
  921. * @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
  922. * @throws PropelException - if unable to parse/validate the date/time value.
  923. */
  924. public function getModifiedAt($format = 'Y-m-d H:i:s')
  925. {
  926. if ($this->modified_at === null) {
  927. return null;
  928. }
  929. if ($this->modified_at === '0000-00-00 00:00:00') {
  930. // while technically this is not a default value of NULL,
  931. // this seems to be closest in meaning.
  932. return null;
  933. } else {
  934. try {
  935. $dt = new DateTime($this->modified_at);
  936. } catch (Exception $x) {
  937. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->modified_at, true), $x);
  938. }
  939. }
  940. if ($format === null) {
  941. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  942. return (int) $dt->format('U');
  943. } elseif (strpos($format, '%') !== false) {
  944. return strftime($format, $dt->format('U'));
  945. } else {
  946. return $dt->format($format);
  947. }
  948. }
  949. /**
  950. * Get the [puser_id] column value.
  951. *
  952. * @return string
  953. */
  954. public function getPuserId()
  955. {
  956. return $this->puser_id;
  957. }
  958. /**
  959. * Get the [access_control_id] column value.
  960. *
  961. * @return int
  962. */
  963. public function getAccessControlId()
  964. {
  965. return $this->access_control_id;
  966. }
  967. /**
  968. * Get the [conversion_profile_id] column value.
  969. *
  970. * @return int
  971. */
  972. public function getConversionProfileId()
  973. {
  974. return $this->conversion_profile_id;
  975. }
  976. /**
  977. * Get the [categories] column value.
  978. *
  979. * @return string
  980. */
  981. public function getCategories()
  982. {
  983. return $this->categories;
  984. }
  985. /**
  986. * Get the [categories_ids] column value.
  987. *
  988. * @return string
  989. */
  990. public function getCategoriesIds()
  991. {
  992. return $this->categories_ids;
  993. }
  994. /**
  995. * Get the [optionally formatted] temporal [start_date] column value.
  996. *
  997. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  998. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  999. *
  1000. * @param string $format The date/time format string (either date()-style or strftime()-style).
  1001. * If format is NULL, then the raw unix timestamp integer will be returned.
  1002. * @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
  1003. * @throws PropelException - if unable to parse/validate the date/time value.
  1004. */
  1005. public function getStartDate($format = 'Y-m-d H:i:s')
  1006. {
  1007. if ($this->start_date === null) {
  1008. return null;
  1009. }
  1010. if ($this->start_date === '0000-00-00 00:00:00') {
  1011. // while technically this is not a default value of NULL,
  1012. // this seems to be closest in meaning.
  1013. return null;
  1014. } else {
  1015. try {
  1016. $dt = new DateTime($this->start_date);
  1017. } catch (Exception $x) {
  1018. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_date, true), $x);
  1019. }
  1020. }
  1021. if ($format === null) {
  1022. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  1023. return (int) $dt->format('U');
  1024. } elseif (strpos($format, '%') !== false) {
  1025. return strftime($format, $dt->format('U'));
  1026. } else {
  1027. return $dt->format($format);
  1028. }
  1029. }
  1030. /**
  1031. * Get the [optionally formatted] temporal [end_date] column value.
  1032. *
  1033. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  1034. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  1035. *
  1036. * @param string $format The date/time format string (either date()-style or strftime()-style).
  1037. * If format is NULL, then the raw unix timestamp integer will be returned.
  1038. * @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
  1039. * @throws PropelException - if unable to parse/validate the date/time value.
  1040. */
  1041. public function getEndDate($format = 'Y-m-d H:i:s')
  1042. {
  1043. if ($this->end_date === null) {
  1044. return null;
  1045. }
  1046. if ($this->end_date === '0000-00-00 00:00:00') {
  1047. // while technically this is not a default value of NULL,
  1048. // this seems to be closest in meaning.
  1049. return null;
  1050. } else {
  1051. try {
  1052. $dt = new DateTime($this->end_date);
  1053. } catch (Exception $x) {
  1054. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->end_date, true), $x);
  1055. }
  1056. }
  1057. if ($format === null) {
  1058. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  1059. return (int) $dt->format('U');
  1060. } elseif (strpos($format, '%') !== false) {
  1061. return strftime($format, $dt->format('U'));
  1062. } else {
  1063. return $dt->format($format);
  1064. }
  1065. }
  1066. /**
  1067. * Get the [search_text_discrete] column value.
  1068. *
  1069. * @return string
  1070. */
  1071. public function getSearchTextDiscrete()
  1072. {
  1073. return $this->search_text_discrete;
  1074. }
  1075. /**
  1076. * Get the [flavor_params_ids] column value.
  1077. *
  1078. * @return string
  1079. */
  1080. public function getFlavorParamsIds()
  1081. {
  1082. return $this->flavor_params_ids;
  1083. }
  1084. /**
  1085. * Get the [optionally formatted] temporal [available_from] column value.
  1086. *
  1087. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  1088. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  1089. *
  1090. * @param string $format The date/time format string (either date()-style or strftime()-style).
  1091. * If format is NULL, then the raw unix timestamp integer will be returned.
  1092. * @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
  1093. * @throws PropelException - if unable to parse/validate the date/time value.
  1094. */
  1095. public function getAvailableFrom($format = 'Y-m-d H:i:s')
  1096. {
  1097. if ($this->available_from === null) {
  1098. return null;
  1099. }
  1100. if ($this->available_from === '0000-00-00 00:00:00') {
  1101. // while technically this is not a default value of NULL,
  1102. // this seems to be closest in meaning.
  1103. return null;
  1104. } else {
  1105. try {
  1106. $dt = new DateTime($this->available_from);
  1107. } catch (Exception $x) {
  1108. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->available_from, true), $x);
  1109. }
  1110. }
  1111. if ($format === null) {
  1112. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  1113. return (int) $dt->format('U');
  1114. } elseif (strpos($format, '%') !== false) {
  1115. return strftime($format, $dt->format('U'));
  1116. } else {
  1117. return $dt->format($format);
  1118. }
  1119. }
  1120. /**
  1121. * Set the value of [id] column.
  1122. *
  1123. * @param string $v new value
  1124. * @return entry The current object (for fluent API support)
  1125. */
  1126. public function setId($v)
  1127. {
  1128. if(!isset($this->oldColumnsValues[entryPeer::ID]))
  1129. $this->oldColumnsValues[entryPeer::ID] = $this->id;
  1130. if ($v !== null) {
  1131. $v = (string) $v;
  1132. }
  1133. if ($this->id !== $v) {
  1134. $this->id = $v;
  1135. $this->modifiedColumns[] = entryPeer::ID;
  1136. }
  1137. return $this;
  1138. } // setId()
  1139. /**
  1140. * Set the value of [kshow_id] column.
  1141. *
  1142. * @param string $v new value
  1143. * @return entry The current object (for fluent API support)
  1144. */
  1145. public function setKshowId($v)
  1146. {
  1147. if(!isset($this->oldColumnsValues[entryPeer::KSHOW_ID]))
  1148. $this->oldColumnsValues[entryPeer::KSHOW_ID] = $this->kshow_id;
  1149. if ($v !== null) {
  1150. $v = (string) $v;
  1151. }
  1152. if ($this->kshow_id !== $v) {
  1153. $this->kshow_id = $v;
  1154. $this->modifiedColumns[] = entryPeer::KSHOW_ID;
  1155. }
  1156. if ($this->akshow !== null && $this->akshow->getId() !== $v) {
  1157. $this->akshow = null;
  1158. }
  1159. return $this;
  1160. } // setKshowId()
  1161. /**
  1162. * Set the value of [kuser_id] column.
  1163. *
  1164. * @param int $v new value
  1165. * @return entry The current object (for fluent API support)
  1166. */
  1167. public function setKuserId($v)
  1168. {
  1169. if(!isset($this->oldColumnsValues[entryPeer::KUSER_ID]))
  1170. $this->oldColumnsValues[entryPeer::KUSER_ID] = $this->kuser_id;
  1171. if ($v !== null) {
  1172. $v = (int) $v;
  1173. }
  1174. if ($this->kuser_id !== $v) {
  1175. $this->kuser_id = $v;
  1176. $this->modifiedColumns[] = entryPeer::KUSER_ID;
  1177. }
  1178. if ($this->akuser !== null && $this->akuser->getId() !== $v) {
  1179. $this->akuser = null;
  1180. }
  1181. return $this;
  1182. } // setKuserId()
  1183. /**
  1184. * Set the value of [name] column.
  1185. *
  1186. * @param string $v new value
  1187. * @return entry The current object (for fluent API support)
  1188. */
  1189. public function setName($v)
  1190. {
  1191. if(!isset($this->oldColumnsValues[entryPeer::NAME]))
  1192. $this->oldColumnsValues[entryPeer::NAME] = $this->name;
  1193. if ($v !== null) {
  1194. $v = (string) $v;
  1195. }
  1196. if ($this->name !== $v) {
  1197. $this->name = $v;
  1198. $this->modifiedColumns[] = entryPeer::NAME;
  1199. }
  1200. return $this;
  1201. } // setName()
  1202. /**
  1203. * Set the value of [type] column.
  1204. *
  1205. * @param int $v new value
  1206. * @return entry The current object (for fluent API support)
  1207. */
  1208. public function setType($v)
  1209. {
  1210. if(!isset($this->oldColumnsValues[entryPeer::TYPE]))
  1211. $this->oldColumnsValues[entryPeer::TYPE] = $this->type;
  1212. if ($v !== null) {
  1213. $v = (int) $v;
  1214. }
  1215. if ($this->type !== $v) {
  1216. $this->type = $v;
  1217. $this->modifiedColumns[] = entryPeer::TYPE;
  1218. }
  1219. return $this;
  1220. } // setType()
  1221. /**
  1222. * Set the value of [media_type] column.
  1223. *
  1224. * @param int $v new value
  1225. * @return entry The current object (for fluent API support)
  1226. */
  1227. public function setMediaType($v)
  1228. {
  1229. if(!isset($this->oldColumnsValues[entryPeer::MEDIA_TYPE]))
  1230. $this->oldColumnsValues[entryPeer::MEDIA_TYPE] = $this->media_type;
  1231. if ($v !== null) {
  1232. $v = (int) $v;
  1233. }
  1234. if ($this->media_type !== $v) {
  1235. $this->media_type = $v;
  1236. $this->modifiedColumns[] = entryPeer::MEDIA_TYPE;
  1237. }
  1238. return $this;
  1239. } // setMediaType()
  1240. /**
  1241. * Set the value of [data] column.
  1242. *
  1243. * @param string $v new value
  1244. * @return entry The current object (for fluent API support)
  1245. */
  1246. public function setData($v)
  1247. {
  1248. if(!isset($this->oldColumnsValues[entryPeer::DATA]))
  1249. $this->oldColumnsValues[entryPeer::DATA] = $this->data;
  1250. if ($v !== null) {
  1251. $v = (string) $v;
  1252. }
  1253. if ($this->data !== $v) {
  1254. $this->data = $v;
  1255. $this->modifiedColumns[] = entryPeer::DATA;
  1256. }
  1257. return $this;
  1258. } // setData()
  1259. /**
  1260. * Set the value of [thumbnail] column.
  1261. *
  1262. * @param string $v new value
  1263. * @return entry The current object (for fluent API support)
  1264. */
  1265. public function setThumbnail($v)
  1266. {
  1267. if(!isset($this->oldColumnsValues[entryPeer::THUMBNAIL]))
  1268. $this->oldColumnsValues[entryPeer::THUMBNAIL] = $this->thumbnail;
  1269. if ($v !== null) {
  1270. $v = (string) $v;
  1271. }
  1272. if ($this->thumbnail !== $v) {
  1273. $this->thumbnail = $v;
  1274. $this->modifiedColumns[] = entryPeer::THUMBNAIL;
  1275. }
  1276. return $this;
  1277. } // setThumbnail()
  1278. /**
  1279. * Set the value of [views] column.
  1280. *
  1281. * @param int $v new value
  1282. * @return entry The current object (for fluent API support)
  1283. */
  1284. public function setViews($v)
  1285. {
  1286. if(!isset($this->oldColumnsValues[entryPeer::VIEWS]))
  1287. $this->oldColumnsValues[entryPeer::VIEWS] = $this->views;
  1288. if ($v !== null) {
  1289. $v = (int) $v;
  1290. }
  1291. if ($this->views !== $v || $this->isNew()) {
  1292. $this->views = $v;
  1293. $this->modifiedColumns[] = entryPeer::VIEWS;
  1294. }
  1295. return $this;
  1296. } // setViews()
  1297. /**
  1298. * Set the value of [votes] column.
  1299. *
  1300. * @param int $v new value
  1301. * @return entry The current object (for fluent API support)
  1302. */
  1303. public function setVotes($v)
  1304. {
  1305. if(!isset($this->oldColumnsValues[entryPeer::VOTES]))
  1306. $this->oldColumnsValues[entryPeer::VOTES] = $this->votes;
  1307. if ($v !== null) {
  1308. $v = (int) $v;
  1309. }
  1310. if ($this->votes !== $v || $this->isNew()) {
  1311. $this->votes = $v;
  1312. $this->modifiedColumns[] = entryPeer::VOTES;
  1313. }
  1314. return $this;
  1315. } // setVotes()
  1316. /**
  1317. * Set the value of [comments] column.
  1318. *
  1319. * @param int $v new value
  1320. * @return entry The current object (for fluent API support)
  1321. */
  1322. public function setComments($v)
  1323. {
  1324. if(!isset($this->oldColumnsValues[entryPeer::COMMENTS]))
  1325. $this->oldColumnsValues[entryPeer::COMMENTS] = $this->comments;
  1326. if ($v !== null) {
  1327. $v = (int) $v;
  1328. }
  1329. if ($this->comments !== $v || $this->isNew()) {
  1330. $this->comments = $v;
  1331. $this->modifiedColumns[] = entryPeer::COMMENTS;
  1332. }
  1333. return $this;
  1334. } // setComments()
  1335. /**
  1336. * Set the value of [favorites] column.
  1337. *
  1338. * @param int $v new value
  1339. * @return entry The current object (for fluent API support)
  1340. */
  1341. public function setFavorites($v)
  1342. {
  1343. if(!isset($this->oldColumnsValues[entryPeer::FAVORITES]))
  1344. $this->oldColumnsValues[entryPeer::FAVORITES] = $this->favorites;
  1345. if ($v !== null) {
  1346. $v = (int) $v;
  1347. }
  1348. if ($this->favorites !== $v || $this->isNew()) {
  1349. $this->favorites = $v;
  1350. $this->modifiedColumns[] = entryPeer::FAVORITES;
  1351. }
  1352. return $this;
  1353. } // setFavorites()
  1354. /**
  1355. * Set the value of [total_rank] column.
  1356. *
  1357. * @param int $v new value
  1358. * @return entry The current object (for fluent API support)
  1359. */
  1360. public function setTotalRank($v)
  1361. {
  1362. if(!isset($this->oldColumnsValues[entryPeer::TOTAL_RANK]))
  1363. $this->oldColumnsValues[entryPeer::TOTAL_RANK] = $this->total_rank;
  1364. if ($v !== null) {
  1365. $v = (int) $v;
  1366. }
  1367. if ($this->total_rank !== $v || $this->isNew()) {
  1368. $this->total_rank = $v;
  1369. $this->modifiedColumns[] = entryPeer::TOTAL_RANK;
  1370. }
  1371. return $this;
  1372. } // setTotalRank()
  1373. /**
  1374. * Set the value of [rank] column.
  1375. *
  1376. * @param int $v new value
  1377. * @return entry The current object (for fluent API support)
  1378. */
  1379. public function setRank($v)
  1380. {
  1381. if(!isset($this->oldColumnsValues[entryPeer::RANK]))
  1382. $this->oldColumnsValues[entryPeer::RANK] = $this->rank;
  1383. if ($v !== null) {
  1384. $v = (int) $v;
  1385. }
  1386. if ($this->rank !== $v || $this->isNew()) {
  1387. $this->rank = $v;
  1388. $this->modifiedColumns[] = entryPeer::RANK;
  1389. }
  1390. return $this;
  1391. } // setRank()
  1392. /**
  1393. * Set the value of [tags] column.
  1394. *
  1395. * @param string $v new value
  1396. * @return entry The current object (for fluent API support)
  1397. */
  1398. public function setTags($v)
  1399. {
  1400. if(!isset($this->oldColumnsValues[entryPeer::TAGS]))
  1401. $this->oldColumnsValues[entryPeer::TAGS] = $this->tags;
  1402. if ($v !== null) {
  1403. $v = (string) $v;
  1404. }
  1405. if ($this->tags !== $v) {
  1406. $this->tags = $v;
  1407. $this->modifiedColumns[] = entryPeer::TAGS;
  1408. }
  1409. return $this;
  1410. } // setTags()
  1411. /**
  1412. * Set the value of [anonymous] column.
  1413. *
  1414. * @param int $v new value
  1415. * @return entry The current object (for fluent API support)
  1416. */
  1417. public function setAnonymous($v)
  1418. {
  1419. if(!isset($this->oldColumnsValues[entryPeer::ANONYMOUS]))
  1420. $this->oldColumnsValues[entryPeer::ANONYMOUS] = $this->anonymous;
  1421. if ($v !== null) {
  1422. $v = (int) $v;
  1423. }
  1424. if ($this->anonymous !== $v) {
  1425. $this->anonymous = $v;
  1426. $this->modifiedColumns[] = entryPeer::ANONYMOUS;
  1427. }
  1428. return $this;
  1429. } // setAnonymous()
  1430. /**
  1431. * Set the value of [status] column.
  1432. *
  1433. * @param int $v new value
  1434. * @return entry The current object (for fluent API support)
  1435. */
  1436. public function setStatus($v)
  1437. {
  1438. if(!isset($this->oldColumnsValues[entryPeer::STATUS]))
  1439. $this->oldColumnsValues[entryPeer::STATUS] = $this->status;
  1440. if ($v !== null) {
  1441. $v = (int) $v;
  1442. }
  1443. if ($this->status !== $v) {
  1444. $this->status = $v;
  1445. $this->modifiedColumns[] = entryPeer::STATUS;
  1446. }
  1447. return $this;
  1448. } // setStatus()
  1449. /**
  1450. * Set the value of [source] column.
  1451. *
  1452. * @param int $v new value
  1453. * @return entry The current object (for fluent API support)
  1454. */
  1455. public function setSource($v)
  1456. {
  1457. if(!isset($this->oldColumnsValues[entryPeer::SOURCE]))
  1458. $this->oldColumnsValues[entryPeer::SOURCE] = $this->source;
  1459. if ($v !== null) {
  1460. $v = (int) $v;
  1461. }
  1462. if ($this->source !== $v) {
  1463. $this->source = $v;
  1464. $this->modifiedColumns[] = entryPeer::SOURCE;
  1465. }
  1466. return $this;
  1467. } // setSource()
  1468. /**
  1469. * Set the value of [source_id] column.
  1470. *
  1471. * @param string $v new value
  1472. * @return entry The current object (for fluent API support)
  1473. */
  1474. public function setSourceId($v)
  1475. {
  1476. if(!isset($this->oldColumnsValues[entryPeer::SOURCE_ID]))
  1477. $this->oldColumnsValues[entryPeer::SOURCE_ID] = $this->source_id;
  1478. if ($v !== null) {
  1479. $v = (string) $v;
  1480. }
  1481. if ($this->source_id !== $v) {
  1482. $this->source_id = $v;
  1483. $this->modifiedColumns[] = entryPeer::SOURCE_ID;
  1484. }
  1485. return $this;
  1486. } // setSourceId()
  1487. /**
  1488. * Set the value of [source_link] column.
  1489. *
  1490. * @param string $v new value
  1491. * @return entry The current object (for fluent API support)
  1492. */
  1493. public function setSourceLink($v)
  1494. {
  1495. if(!isset($this->oldColumnsValues[entryPeer::SOURCE_LINK]))
  1496. $this->oldColumnsValues[entryPeer::SOURCE_LINK] = $this->source_link;
  1497. if ($v !== null) {
  1498. $v = (string) $v;
  1499. }
  1500. if ($this->source_link !== $v) {
  1501. $this->source_link = $v;
  1502. $this->modifiedColumns[] = entryPeer::SOURCE_LINK;
  1503. }
  1504. return $this;
  1505. } // setSourceLink()
  1506. /**
  1507. * Set the value of [license_type] column.
  1508. *
  1509. * @param int $v new value
  1510. * @return entry The current object (for fluent API support)
  1511. */
  1512. public function setLicenseType($v)
  1513. {
  1514. if(!isset($this->oldColumnsValues[entryPeer::LICENSE_TYPE]))
  1515. $this->oldColumnsValues[entryPeer::LICENSE_TYPE] = $this->license_type;
  1516. if ($v !== null) {
  1517. $v = (int) $v;
  1518. }
  1519. if ($this->license_type !== $v) {
  1520. $this->license_type = $v;
  1521. $this->modifiedColumns[] = entryPeer::LICENSE_TYPE;
  1522. }
  1523. return $this;
  1524. } // setLicenseType()
  1525. /**
  1526. * Set the value of [credit] column.
  1527. *
  1528. * @param string $v new value
  1529. * @return entry The current object (for fluent API support)
  1530. */
  1531. public function setCredit($v)
  1532. {
  1533. if(!isset($this->oldColumnsValues[entryPeer::CREDIT]))
  1534. $this->oldColumnsValues[entryPeer::CREDIT] = $this->credit;
  1535. if ($v !== null) {
  1536. $v = (string) $v;
  1537. }
  1538. if ($this->credit !== $v) {
  1539. $this->credit = $v;
  1540. $this->modifiedColumns[] = entryPeer::CREDIT;
  1541. }
  1542. return $this;
  1543. } // setCredit()
  1544. /**
  1545. * Set the value of [length_in_msecs] column.
  1546. *
  1547. * @param int $v new value
  1548. * @return entry The current object (for fluent API support)
  1549. */
  1550. public function setLengthInMsecs($v)
  1551. {
  1552. if(!isset($this->oldColumnsValues[entryPeer::LENGTH_IN_MSECS]))
  1553. $this->oldColumnsValues[entryPeer::LENGTH_IN_MSECS] = $this->length_in_msecs;
  1554. if ($v !== null) {
  1555. $v = (int) $v;
  1556. }
  1557. if ($this->length_in_msecs !== $v || $this->isNew()) {
  1558. $this->length_in_msecs = $v;
  1559. $this->modifiedColumns[] = entryPeer::LENGTH_IN_MSECS;
  1560. }
  1561. return $this;
  1562. } // setLengthInMsecs()
  1563. /**
  1564. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  1565. *
  1566. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1567. * be treated as NULL for temporal objects.
  1568. * @return entry The current object (for fluent API support)
  1569. */
  1570. public function setCreatedAt($v)
  1571. {
  1572. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1573. // -- which is unexpected, to say the least.
  1574. if ($v === null || $v === '') {
  1575. $dt = null;
  1576. } elseif ($v instanceof DateTime) {
  1577. $dt = $v;
  1578. } else {
  1579. // some string/numeric value passed; we normalize that so that we can
  1580. // validate it.
  1581. try {
  1582. if (is_numeric($v)) { // if it's a unix timestamp
  1583. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1584. // We have to explicitly specify and then change the time zone because of a
  1585. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1586. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1587. } else {
  1588. $dt = new DateTime($v);
  1589. }
  1590. } catch (Exception $x) {
  1591. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1592. }
  1593. }
  1594. if ( $this->created_at !== null || $dt !== null ) {
  1595. // (nested ifs are a little easier to read in this case)
  1596. $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1597. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1598. if ( ($currNorm !== $newNorm) // normalized values don't match
  1599. )
  1600. {
  1601. $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1602. $this->modifiedColumns[] = entryPeer::CREATED_AT;
  1603. }
  1604. } // if either are not null
  1605. return $this;
  1606. } // setCreatedAt()
  1607. /**
  1608. * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
  1609. *
  1610. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1611. * be treated as NULL for temporal objects.
  1612. * @return entry The current object (for fluent API support)
  1613. */
  1614. public function setUpdatedAt($v)
  1615. {
  1616. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1617. // -- which is unexpected, to say the least.
  1618. if ($v === null || $v === '') {
  1619. $dt = null;
  1620. } elseif ($v instanceof DateTime) {
  1621. $dt = $v;
  1622. } else {
  1623. // some string/numeric value passed; we normalize that so that we can
  1624. // validate it.
  1625. try {
  1626. if (is_numeric($v)) { // if it's a unix timestamp
  1627. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1628. // We have to explicitly specify and then change the time zone because of a
  1629. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1630. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1631. } else {
  1632. $dt = new DateTime($v);
  1633. }
  1634. } catch (Exception $x) {
  1635. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1636. }
  1637. }
  1638. if ( $this->updated_at !== null || $dt !== null ) {
  1639. // (nested ifs are a little easier to read in this case)
  1640. $currNorm = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1641. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1642. if ( ($currNorm !== $newNorm) // normalized values don't match
  1643. )
  1644. {
  1645. $this->updated_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1646. $this->modifiedColumns[] = entryPeer::UPDATED_AT;
  1647. }
  1648. } // if either are not null
  1649. return $this;
  1650. } // setUpdatedAt()
  1651. /**
  1652. * Set the value of [partner_id] column.
  1653. *
  1654. * @param int $v new value
  1655. * @return entry The current object (for fluent API support)
  1656. */
  1657. public function setPartnerId($v)
  1658. {
  1659. if(!isset($this->oldColumnsValues[entryPeer::PARTNER_ID]))
  1660. $this->oldColumnsValues[entryPeer::PARTNER_ID] = $this->partner_id;
  1661. if ($v !== null) {
  1662. $v = (int) $v;
  1663. }
  1664. if ($this->partner_id !== $v || $this->isNew()) {
  1665. $this->partner_id = $v;
  1666. $this->modifiedColumns[] = entryPeer::PARTNER_ID;
  1667. }
  1668. return $this;
  1669. } // setPartnerId()
  1670. /**
  1671. * Set the value of [display_in_search] column.
  1672. *
  1673. * @param int $v new value
  1674. * @return entry The current object (for fluent API support)
  1675. */
  1676. public function setDisplayInSearch($v)
  1677. {
  1678. if(!isset($this->oldColumnsValues[entryPeer::DISPLAY_IN_SEARCH]))
  1679. $this->oldColumnsValues[entryPeer::DISPLAY_IN_SEARCH] = $this->display_in_search;
  1680. if ($v !== null) {
  1681. $v = (int) $v;
  1682. }
  1683. if ($this->display_in_search !== $v) {
  1684. $this->display_in_search = $v;
  1685. $this->modifiedColumns[] = entryPeer::DISPLAY_IN_SEARCH;
  1686. }
  1687. return $this;
  1688. } // setDisplayInSearch()
  1689. /**
  1690. * Set the value of [subp_id] column.
  1691. *
  1692. * @param int $v new value
  1693. * @return entry The current object (for fluent API support)
  1694. */
  1695. public function setSubpId($v)
  1696. {
  1697. if(!isset($this->oldColumnsValues[entryPeer::SUBP_ID]))
  1698. $this->oldColumnsValues[entryPeer::SUBP_ID] = $this->subp_id;
  1699. if ($v !== null) {
  1700. $v = (int) $v;
  1701. }
  1702. if ($this->subp_id !== $v || $this->isNew()) {
  1703. $this->subp_id = $v;
  1704. $this->modifiedColumns[] = entryPeer::SUBP_ID;
  1705. }
  1706. return $this;
  1707. } // setSubpId()
  1708. /**
  1709. * Set the value of [custom_data] column.
  1710. *
  1711. * @param string $v new value
  1712. * @return entry The current object (for fluent API support)
  1713. */
  1714. public function setCustomData($v)
  1715. {
  1716. if ($v !== null) {
  1717. $v = (string) $v;
  1718. }
  1719. if ($this->custom_data !== $v) {
  1720. $this->custom_data = $v;
  1721. $this->modifiedColumns[] = entryPeer::CUSTOM_DATA;
  1722. }
  1723. return $this;
  1724. } // setCustomData()
  1725. /**
  1726. * Set the value of [search_text] column.
  1727. *
  1728. * @param string $v new value
  1729. * @return entry The current object (for fluent API support)
  1730. */
  1731. public function setSearchText($v)
  1732. {
  1733. if(!isset($this->oldColumnsValues[entryPeer::SEARCH_TEXT]))
  1734. $this->oldColumnsValues[entryPeer::SEARCH_TEXT] = $this->search_text;
  1735. if ($v !== null) {
  1736. $v = (string) $v;
  1737. }
  1738. if ($this->search_text !== $v) {
  1739. $this->search_text = $v;
  1740. $this->modifiedColumns[] = entryPeer::SEARCH_TEXT;
  1741. }
  1742. return $this;
  1743. } // setSearchText()
  1744. /**
  1745. * Set the value of [screen_name] column.
  1746. *
  1747. * @param string $v new value
  1748. * @return entry The current object (for fluent API support)
  1749. */
  1750. public function setScreenName($v)
  1751. {
  1752. if(!isset($this->oldColumnsValues[entryPeer::SCREEN_NAME]))
  1753. $this->oldColumnsValues[entryPeer::SCREEN_NAME] = $this->screen_name;
  1754. if ($v !== null) {
  1755. $v = (string) $v;
  1756. }
  1757. if ($this->screen_name !== $v) {
  1758. $this->screen_name = $v;
  1759. $this->modifiedColumns[] = entryPeer::SCREEN_NAME;
  1760. }
  1761. return $this;
  1762. } // setScreenName()
  1763. /**
  1764. * Set the value of [site_url] column.
  1765. *
  1766. * @param string $v new value
  1767. * @return entry The current object (for fluent API support)
  1768. */
  1769. public function setSiteUrl($v)
  1770. {
  1771. if(!isset($this->oldColumnsValues[entryPeer::SITE_URL]))
  1772. $this->oldColumnsValues[entryPeer::SITE_URL] = $this->site_url;
  1773. if ($v !== null) {
  1774. $v = (string) $v;
  1775. }
  1776. if ($this->site_url !== $v) {
  1777. $this->site_url = $v;
  1778. $this->modifiedColumns[] = entryPeer::SITE_URL;
  1779. }
  1780. return $this;
  1781. } // setSiteUrl()
  1782. /**
  1783. * Set the value of [permissions] column.
  1784. *
  1785. * @param int $v new value
  1786. * @return entry The current object (for fluent API support)
  1787. */
  1788. public function setPermissions($v)
  1789. {
  1790. if(!isset($this->oldColumnsValues[entryPeer::PERMISSIONS]))
  1791. $this->oldColumnsValues[entryPeer::PERMISSIONS] = $this->permissions;
  1792. if ($v !== null) {
  1793. $v = (int) $v;
  1794. }
  1795. if ($this->permissions !== $v || $this->isNew()) {
  1796. $this->permissions = $v;
  1797. $this->modifiedColumns[] = entryPeer::PERMISSIONS;
  1798. }
  1799. return $this;
  1800. } // setPermissions()
  1801. /**
  1802. * Set the value of [group_id] column.
  1803. *
  1804. * @param string $v new value
  1805. * @return entry The current object (for fluent API support)
  1806. */
  1807. public function setGroupId($v)
  1808. {
  1809. if(!isset($this->oldColumnsValues[entryPeer::GROUP_ID]))
  1810. $this->oldColumnsValues[entryPeer::GROUP_ID] = $this->group_id;
  1811. if ($v !== null) {
  1812. $v = (string) $v;
  1813. }
  1814. if ($this->group_id !== $v) {
  1815. $this->group_id = $v;
  1816. $this->modifiedColumns[] = entryPeer::GROUP_ID;
  1817. }
  1818. return $this;
  1819. } // setGroupId()
  1820. /**
  1821. * Set the value of [plays] column.
  1822. *
  1823. * @param int $v new value
  1824. * @return entry The current object (for fluent API support)
  1825. */
  1826. public function setPlays($v)
  1827. {
  1828. if(!isset($this->oldColumnsValues[entryPeer::PLAYS]))
  1829. $this->oldColumnsValues[entryPeer::PLAYS] = $this->plays;
  1830. if ($v !== null) {
  1831. $v = (int) $v;
  1832. }
  1833. if ($this->plays !== $v || $this->isNew()) {
  1834. $this->plays = $v;
  1835. $this->modifiedColumns[] = entryPeer::PLAYS;
  1836. }
  1837. return $this;
  1838. } // setPlays()
  1839. /**
  1840. * Set the value of [partner_data] column.
  1841. *
  1842. * @param string $v new value
  1843. * @return entry The current object (for fluent API support)
  1844. */
  1845. public function setPartnerData($v)
  1846. {
  1847. if(!isset($this->oldColumnsValues[entryPeer::PARTNER_DATA]))
  1848. $this->oldColumnsValues[entryPeer::PARTNER_DATA] = $this->partner_data;
  1849. if ($v !== null) {
  1850. $v = (string) $v;
  1851. }
  1852. if ($this->partner_data !== $v) {
  1853. $this->partner_data = $v;
  1854. $this->modifiedColumns[] = entryPeer::PARTNER_DATA;
  1855. }
  1856. return $this;
  1857. } // setPartnerData()
  1858. /**
  1859. * Set the value of [int_id] column.
  1860. *
  1861. * @param int $v new value
  1862. * @return entry The current object (for fluent API support)
  1863. */
  1864. public function setIntId($v)
  1865. {
  1866. if(!isset($this->oldColumnsValues[entryPeer::INT_ID]))
  1867. $this->oldColumnsValues[entryPeer::INT_ID] = $this->int_id;
  1868. if ($v !== null) {
  1869. $v = (int) $v;
  1870. }
  1871. if ($this->int_id !== $v) {
  1872. $this->int_id = $v;
  1873. $this->modifiedColumns[] = entryPeer::INT_ID;
  1874. }
  1875. return $this;
  1876. } // setIntId()
  1877. /**
  1878. * Set the value of [indexed_custom_data_1] column.
  1879. *
  1880. * @param int $v new value
  1881. * @return entry The current object (for fluent API support)
  1882. */
  1883. public function setIndexedCustomData1($v)
  1884. {
  1885. if(!isset($this->oldColumnsValues[entryPeer::INDEXED_CUSTOM_DATA_1]))
  1886. $this->oldColumnsValues[entryPeer::INDEXED_CUSTOM_DATA_1] = $this->indexed_custom_data_1;
  1887. if ($v !== null) {
  1888. $v = (int) $v;
  1889. }
  1890. if ($this->indexed_custom_data_1 !== $v) {
  1891. $this->indexed_custom_data_1 = $v;
  1892. $this->modifiedColumns[] = entryPeer::INDEXED_CUSTOM_DATA_1;
  1893. }
  1894. return $this;
  1895. } // setIndexedCustomData1()
  1896. /**
  1897. * Set the value of [description] column.
  1898. *
  1899. * @param string $v new value
  1900. * @return entry The current object (for fluent API support)
  1901. */
  1902. public function setDescription($v)
  1903. {
  1904. if(!isset($this->oldColumnsValues[entryPeer::DESCRIPTION]))
  1905. $this->oldColumnsValues[entryPeer::DESCRIPTION] = $this->description;
  1906. if ($v !== null) {
  1907. $v = (string) $v;
  1908. }
  1909. if ($this->description !== $v) {
  1910. $this->description = $v;
  1911. $this->modifiedColumns[] = entryPeer::DESCRIPTION;
  1912. }
  1913. return $this;
  1914. } // setDescription()
  1915. /**
  1916. * Sets the value of [media_date] column to a normalized version of the date/time value specified.
  1917. *
  1918. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1919. * be treated as NULL for temporal objects.
  1920. * @return entry The current object (for fluent API support)
  1921. */
  1922. public function setMediaDate($v)
  1923. {
  1924. if(!isset($this->oldColumnsValues[entryPeer::MEDIA_DATE]))
  1925. $this->oldColumnsValues[entryPeer::MEDIA_DATE] = $this->media_date;
  1926. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1927. // -- which is unexpected, to say the least.
  1928. if ($v === null || $v === '') {
  1929. $dt = null;
  1930. } elseif ($v instanceof DateTime) {
  1931. $dt = $v;
  1932. } else {
  1933. // some string/numeric value passed; we normalize that so that we can
  1934. // validate it.
  1935. try {
  1936. if (is_numeric($v)) { // if it's a unix timestamp
  1937. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1938. // We have to explicitly specify and then change the time zone because of a
  1939. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1940. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1941. } else {
  1942. $dt = new DateTime($v);
  1943. }
  1944. } catch (Exception $x) {
  1945. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1946. }
  1947. }
  1948. if ( $this->media_date !== null || $dt !== null ) {
  1949. // (nested ifs are a little easier to read in this case)
  1950. $currNorm = ($this->media_date !== null && $tmpDt = new DateTime($this->media_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1951. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1952. if ( ($currNorm !== $newNorm) // normalized values don't match
  1953. )
  1954. {
  1955. $this->media_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1956. $this->modifiedColumns[] = entryPeer::MEDIA_DATE;
  1957. }
  1958. } // if either are not null
  1959. return $this;
  1960. } // setMediaDate()
  1961. /**
  1962. * Set the value of [admin_tags] column.
  1963. *
  1964. * @param string $v new value
  1965. * @return entry The current object (for fluent API support)
  1966. */
  1967. public function setAdminTags($v)
  1968. {
  1969. if(!isset($this->oldColumnsValues[entryPeer::ADMIN_TAGS]))
  1970. $this->oldColumnsValues[entryPeer::ADMIN_TAGS] = $this->admin_tags;
  1971. if ($v !== null) {
  1972. $v = (string) $v;
  1973. }
  1974. if ($this->admin_tags !== $v) {
  1975. $this->admin_tags = $v;
  1976. $this->modifiedColumns[] = entryPeer::ADMIN_TAGS;
  1977. }
  1978. return $this;
  1979. } // setAdminTags()
  1980. /**
  1981. * Set the value of [moderation_status] column.
  1982. *
  1983. * @param int $v new value
  1984. * @return entry The current object (for fluent API support)
  1985. */
  1986. public function setModerationStatus($v)
  1987. {
  1988. if(!isset($this->oldColumnsValues[entryPeer::MODERATION_STATUS]))
  1989. $this->oldColumnsValues[entryPeer::MODERATION_STATUS] = $this->moderation_status;
  1990. if ($v !== null) {
  1991. $v = (int) $v;
  1992. }
  1993. if ($this->moderation_status !== $v) {
  1994. $this->moderation_status = $v;
  1995. $this->modifiedColumns[] = entryPeer::MODERATION_STATUS;
  1996. }
  1997. return $this;
  1998. } // setModerationStatus()
  1999. /**
  2000. * Set the value of [moderation_count] column.
  2001. *
  2002. * @param int $v new value
  2003. * @return entry The current object (for fluent API support)
  2004. */
  2005. public function setModerationCount($v)
  2006. {
  2007. if(!isset($this->oldColumnsValues[entryPeer::MODERATION_COUNT]))
  2008. $this->oldColumnsValues[entryPeer::MODERATION_COUNT] = $this->moderation_count;
  2009. if ($v !== null) {
  2010. $v = (int) $v;
  2011. }
  2012. if ($this->moderation_count !== $v) {
  2013. $this->moderation_count = $v;
  2014. $this->modifiedColumns[] = entryPeer::MODERATION_COUNT;
  2015. }
  2016. return $this;
  2017. } // setModerationCount()
  2018. /**
  2019. * Sets the value of [modified_at] column to a normalized version of the date/time value specified.
  2020. *
  2021. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  2022. * be treated as NULL for temporal objects.
  2023. * @return entry The current object (for fluent API support)
  2024. */
  2025. public function setModifiedAt($v)
  2026. {
  2027. if(!isset($this->oldColumnsValues[entryPeer::MODIFIED_AT]))
  2028. $this->oldColumnsValues[entryPeer::MODIFIED_AT] = $this->modified_at;
  2029. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  2030. // -- which is unexpected, to say the least.
  2031. if ($v === null || $v === '') {
  2032. $dt = null;
  2033. } elseif ($v instanceof DateTime) {
  2034. $dt = $v;
  2035. } else {
  2036. // some string/numeric value passed; we normalize that so that we can
  2037. // validate it.
  2038. try {
  2039. if (is_numeric($v)) { // if it's a unix timestamp
  2040. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  2041. // We have to explicitly specify and then change the time zone because of a
  2042. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  2043. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  2044. } else {
  2045. $dt = new DateTime($v);
  2046. }
  2047. } catch (Exception $x) {
  2048. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  2049. }
  2050. }
  2051. if ( $this->modified_at !== null || $dt !== null ) {
  2052. // (nested ifs are a little easier to read in this case)
  2053. $currNorm = ($this->modified_at !== null && $tmpDt = new DateTime($this->modified_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  2054. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  2055. if ( ($currNorm !== $newNorm) // normalized values don't match
  2056. )
  2057. {
  2058. $this->modified_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  2059. $this->modifiedColumns[] = entryPeer::MODIFIED_AT;
  2060. }
  2061. } // if either are not null
  2062. return $this;
  2063. } // setModifiedAt()
  2064. /**
  2065. * Set the value of [puser_id] column.
  2066. *
  2067. * @param string $v new value
  2068. * @return entry The current object (for fluent API support)
  2069. */
  2070. public function setPuserId($v)
  2071. {
  2072. if(!isset($this->oldColumnsValues[entryPeer::PUSER_ID]))
  2073. $this->oldColumnsValues[entryPeer::PUSER_ID] = $this->puser_id;
  2074. if ($v !== null) {
  2075. $v = (string) $v;
  2076. }
  2077. if ($this->puser_id !== $v) {
  2078. $this->puser_id = $v;
  2079. $this->modifiedColumns[] = entryPeer::PUSER_ID;
  2080. }
  2081. return $this;
  2082. } // setPuserId()
  2083. /**
  2084. * Set the value of [access_control_id] column.
  2085. *
  2086. * @param int $v new value
  2087. * @return entry The current object (for fluent API support)
  2088. */
  2089. public function setAccessControlId($v)
  2090. {
  2091. if(!isset($this->oldColumnsValues[entryPeer::ACCESS_CONTROL_ID]))
  2092. $this->oldColumnsValues[entryPeer::ACCESS_CONTROL_ID] = $this->access_control_id;
  2093. if ($v !== null) {
  2094. $v = (int) $v;
  2095. }
  2096. if ($this->access_control_id !== $v) {
  2097. $this->access_control_id = $v;
  2098. $this->modifiedColumns[] = entryPeer::ACCESS_CONTROL_ID;
  2099. }
  2100. if ($this->aaccessControl !== null && $this->aaccessControl->getId() !== $v) {
  2101. $this->aaccessControl = null;
  2102. }
  2103. return $this;
  2104. } // setAccessControlId()
  2105. /**
  2106. * Set the value of [conversion_profile_id] column.
  2107. *
  2108. * @param int $v new value
  2109. * @return entry The current object (for fluent API support)
  2110. */
  2111. public function setConversionProfileId($v)
  2112. {
  2113. if(!isset($this->oldColumnsValues[entryPeer::CONVERSION_PROFILE_ID]))
  2114. $this->oldColumnsValues[entryPeer::CONVERSION_PROFILE_ID] = $this->conversion_profile_id;
  2115. if ($v !== null) {
  2116. $v = (int) $v;
  2117. }
  2118. if ($this->conversion_profile_id !== $v) {
  2119. $this->conversion_profile_id = $v;
  2120. $this->modifiedColumns[] = entryPeer::CONVERSION_PROFILE_ID;
  2121. }
  2122. if ($this->aconversionProfile2 !== null && $this->aconversionProfile2->getId() !== $v) {
  2123. $this->aconversionProfile2 = null;
  2124. }
  2125. return $this;
  2126. } // setConversionProfileId()
  2127. /**
  2128. * Set the value of [categories] column.
  2129. *
  2130. * @param string $v new value
  2131. * @return entry The current object (for fluent API support)
  2132. */
  2133. public function setCategories($v)
  2134. {
  2135. if(!isset($this->oldColumnsValues[entryPeer::CATEGORIES]))
  2136. $this->oldColumnsValues[entryPeer::CATEGORIES] = $this->categories;
  2137. if ($v !== null) {
  2138. $v = (string) $v;
  2139. }
  2140. if ($this->categories !== $v) {
  2141. $this->categories = $v;
  2142. $this->modifiedColumns[] = entryPeer::CATEGORIES;
  2143. }
  2144. return $this;
  2145. } // setCategories()
  2146. /**
  2147. * Set the value of [categories_ids] column.
  2148. *
  2149. * @param string $v new value
  2150. * @return entry The current object (for fluent API support)
  2151. */
  2152. public function setCategoriesIds($v)
  2153. {
  2154. if(!isset($this->oldColumnsValues[entryPeer::CATEGORIES_IDS]))
  2155. $this->oldColumnsValues[entryPeer::CATEGORIES_IDS] = $this->categories_ids;
  2156. if ($v !== null) {
  2157. $v = (string) $v;
  2158. }
  2159. if ($this->categories_ids !== $v) {
  2160. $this->categories_ids = $v;
  2161. $this->modifiedColumns[] = entryPeer::CATEGORIES_IDS;
  2162. }
  2163. return $this;
  2164. } // setCategoriesIds()
  2165. /**
  2166. * Sets the value of [start_date] column to a normalized version of the date/time value specified.
  2167. *
  2168. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  2169. * be treated as NULL for temporal objects.
  2170. * @return entry The current object (for fluent API support)
  2171. */
  2172. public function setStartDate($v)
  2173. {
  2174. if(!isset($this->oldColumnsValues[entryPeer::START_DATE]))
  2175. $this->oldColumnsValues[entryPeer::START_DATE] = $this->start_date;
  2176. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  2177. // -- which is unexpected, to say the least.
  2178. if ($v === null || $v === '') {
  2179. $dt = null;
  2180. } elseif ($v instanceof DateTime) {
  2181. $dt = $v;
  2182. } else {
  2183. // some string/numeric value passed; we normalize that so that we can
  2184. // validate it.
  2185. try {
  2186. if (is_numeric($v)) { // if it's a unix timestamp
  2187. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  2188. // We have to explicitly specify and then change the time zone because of a
  2189. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  2190. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  2191. } else {
  2192. $dt = new DateTime($v);
  2193. }
  2194. } catch (Exception $x) {
  2195. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  2196. }
  2197. }
  2198. if ( $this->start_date !== null || $dt !== null ) {
  2199. // (nested ifs are a little easier to read in this case)
  2200. $currNorm = ($this->start_date !== null && $tmpDt = new DateTime($this->start_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  2201. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  2202. if ( ($currNorm !== $newNorm) // normalized values don't match
  2203. )
  2204. {
  2205. $this->start_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  2206. $this->modifiedColumns[] = entryPeer::START_DATE;
  2207. }
  2208. } // if either are not null
  2209. return $this;
  2210. } // setStartDate()
  2211. /**
  2212. * Sets the value of [end_date] column to a normalized version of the date/time value specified.
  2213. *
  2214. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  2215. * be treated as NULL for temporal objects.
  2216. * @return entry The current object (for fluent API support)
  2217. */
  2218. public function setEndDate($v)
  2219. {
  2220. if(!isset($this->oldColumnsValues[entryPeer::END_DATE]))
  2221. $this->oldColumnsValues[entryPeer::END_DATE] = $this->end_date;
  2222. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  2223. // -- which is unexpected, to say the least.
  2224. if ($v === null || $v === '') {
  2225. $dt = null;
  2226. } elseif ($v instanceof DateTime) {
  2227. $dt = $v;
  2228. } else {
  2229. // some string/numeric value passed; we normalize that so that we can
  2230. // validate it.
  2231. try {
  2232. if (is_numeric($v)) { // if it's a unix timestamp
  2233. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  2234. // We have to explicitly specify and then change the time zone because of a
  2235. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  2236. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  2237. } else {
  2238. $dt = new DateTime($v);
  2239. }
  2240. } catch (Exception $x) {
  2241. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  2242. }
  2243. }
  2244. if ( $this->end_date !== null || $dt !== null ) {
  2245. // (nested ifs are a little easier to read in this case)
  2246. $currNorm = ($this->end_date !== null && $tmpDt = new DateTime($this->end_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  2247. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  2248. if ( ($currNorm !== $newNorm) // normalized values don't match
  2249. )
  2250. {
  2251. $this->end_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  2252. $this->modifiedColumns[] = entryPeer::END_DATE;
  2253. }
  2254. } // if either are not null
  2255. return $this;
  2256. } // setEndDate()
  2257. /**
  2258. * Set the value of [search_text_discrete] column.
  2259. *
  2260. * @param string $v new value
  2261. * @return entry The current object (for fluent API support)
  2262. */
  2263. public function setSearchTextDiscrete($v)
  2264. {
  2265. if(!isset($this->oldColumnsValues[entryPeer::SEARCH_TEXT_DISCRETE]))
  2266. $this->oldColumnsValues[entryPeer::SEARCH_TEXT_DISCRETE] = $this->search_text_discrete;
  2267. if ($v !== null) {
  2268. $v = (string) $v;
  2269. }
  2270. if ($this->search_text_discrete !== $v) {
  2271. $this->search_text_discrete = $v;
  2272. $this->modifiedColumns[] = entryPeer::SEARCH_TEXT_DISCRETE;
  2273. }
  2274. return $this;
  2275. } // setSearchTextDiscrete()
  2276. /**
  2277. * Set the value of [flavor_params_ids] column.
  2278. *
  2279. * @param string $v new value
  2280. * @return entry The current object (for fluent API support)
  2281. */
  2282. public function setFlavorParamsIds($v)
  2283. {
  2284. if(!isset($this->oldColumnsValues[entryPeer::FLAVOR_PARAMS_IDS]))
  2285. $this->oldColumnsValues[entryPeer::FLAVOR_PARAMS_IDS] = $this->flavor_params_ids;
  2286. if ($v !== null) {
  2287. $v = (string) $v;
  2288. }
  2289. if ($this->flavor_params_ids !== $v) {
  2290. $this->flavor_params_ids = $v;
  2291. $this->modifiedColumns[] = entryPeer::FLAVOR_PARAMS_IDS;
  2292. }
  2293. return $this;
  2294. } // setFlavorParamsIds()
  2295. /**
  2296. * Sets the value of [available_from] column to a normalized version of the date/time value specified.
  2297. *
  2298. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  2299. * be treated as NULL for temporal objects.
  2300. * @return entry The current object (for fluent API support)
  2301. */
  2302. public function setAvailableFrom($v)
  2303. {
  2304. if(!isset($this->oldColumnsValues[entryPeer::AVAILABLE_FROM]))
  2305. $this->oldColumnsValues[entryPeer::AVAILABLE_FROM] = $this->available_from;
  2306. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  2307. // -- which is unexpected, to say the least.
  2308. if ($v === null || $v === '') {
  2309. $dt = null;
  2310. } elseif ($v instanceof DateTime) {
  2311. $dt = $v;
  2312. } else {
  2313. // some string/numeric value passed; we normalize that so that we can
  2314. // validate it.
  2315. try {
  2316. if (is_numeric($v)) { // if it's a unix timestamp
  2317. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  2318. // We have to explicitly specify and then change the time zone because of a
  2319. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  2320. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  2321. } else {
  2322. $dt = new DateTime($v);
  2323. }
  2324. } catch (Exception $x) {
  2325. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  2326. }
  2327. }
  2328. if ( $this->available_from !== null || $dt !== null ) {
  2329. // (nested ifs are a little easier to read in this case)
  2330. $currNorm = ($this->available_from !== null && $tmpDt = new DateTime($this->available_from)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  2331. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  2332. if ( ($currNorm !== $newNorm) // normalized values don't match
  2333. )
  2334. {
  2335. $this->available_from = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  2336. $this->modifiedColumns[] = entryPeer::AVAILABLE_FROM;
  2337. }
  2338. } // if either are not null
  2339. return $this;
  2340. } // setAvailableFrom()
  2341. /**
  2342. * Indicates whether the columns in this object are only set to default values.
  2343. *
  2344. * This method can be used in conjunction with isModified() to indicate whether an object is both
  2345. * modified _and_ has some values set which are non-default.
  2346. *
  2347. * @return boolean Whether the columns in this object are only been set with default values.
  2348. */
  2349. public function hasOnlyDefaultValues()
  2350. {
  2351. if ($this->views !== 0) {
  2352. return false;
  2353. }
  2354. if ($this->votes !== 0) {
  2355. return false;
  2356. }
  2357. if ($this->comments !== 0) {
  2358. return false;
  2359. }
  2360. if ($this->favorites !== 0) {
  2361. return false;
  2362. }
  2363. if ($this->total_rank !== 0) {
  2364. return false;
  2365. }
  2366. if ($this->rank !== 0) {
  2367. return false;
  2368. }
  2369. if ($this->length_in_msecs !== 0) {
  2370. return false;
  2371. }
  2372. if ($this->partner_id !== 0) {
  2373. return false;
  2374. }
  2375. if ($this->subp_id !== 0) {
  2376. return false;
  2377. }
  2378. if ($this->permissions !== 1) {
  2379. return false;
  2380. }
  2381. if ($this->plays !== 0) {
  2382. return false;
  2383. }
  2384. // otherwise, everything was equal, so return TRUE
  2385. return true;
  2386. } // hasOnlyDefaultValues()
  2387. /**
  2388. * Hydrates (populates) the object variables with values from the database resultset.
  2389. *
  2390. * An offset (0-based "start column") is specified so that objects can be hydrated
  2391. * with a subset of the columns in the resultset rows. This is needed, for example,
  2392. * for results of JOIN queries where the resultset row includes columns from two or
  2393. * more tables.
  2394. *
  2395. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  2396. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  2397. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  2398. * @return int next starting column
  2399. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  2400. */
  2401. public function hydrate($row, $startcol = 0, $rehydrate = false)
  2402. {
  2403. try {
  2404. $this->id = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
  2405. $this->kshow_id = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
  2406. $this->kuser_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
  2407. $this->name = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
  2408. $this->type = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
  2409. $this->media_type = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
  2410. $this->data = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
  2411. $this->thumbnail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
  2412. $this->views = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
  2413. $this->votes = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
  2414. $this->comments = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null;
  2415. $this->favorites = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
  2416. $this->total_rank = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
  2417. $this->rank = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
  2418. $this->tags = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
  2419. $this->anonymous = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
  2420. $this->status = ($row[$startcol + 16] !== null) ? (int) $row[$startcol + 16] : null;
  2421. $this->source = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null;
  2422. $this->source_id = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
  2423. $this->source_link = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
  2424. $this->license_type = ($row[$startcol + 20] !== null) ? (int) $row[$startcol + 20] : null;
  2425. $this->credit = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
  2426. $this->length_in_msecs = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null;
  2427. $this->created_at = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null;
  2428. $this->updated_at = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null;
  2429. $this->partner_id = ($row[$startcol + 25] !== null) ? (int) $row[$startcol + 25] : null;
  2430. $this->display_in_search = ($row[$startcol + 26] !== null) ? (int) $row[$startcol + 26] : null;
  2431. $this->subp_id = ($row[$startcol + 27] !== null) ? (int) $row[$startcol + 27] : null;
  2432. $this->custom_data = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
  2433. $this->search_text = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
  2434. $this->screen_name = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
  2435. $this->site_url = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
  2436. $this->permissions = ($row[$startcol + 32] !== null) ? (int) $row[$startcol + 32] : null;
  2437. $this->group_id = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
  2438. $this->plays = ($row[$startcol + 34] !== null) ? (int) $row[$startcol + 34] : null;
  2439. $this->partner_data = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
  2440. $this->int_id = ($row[$startcol + 36] !== null) ? (int) $row[$startcol + 36] : null;
  2441. $this->indexed_custom_data_1 = ($row[$startcol + 37] !== null) ? (int) $row[$startcol + 37] : null;
  2442. $this->description = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
  2443. $this->media_date = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
  2444. $this->admin_tags = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
  2445. $this->moderation_status = ($row[$startcol + 41] !== null) ? (int) $row[$startcol + 41] : null;
  2446. $this->moderation_count = ($row[$startcol + 42] !== null) ? (int) $row[$startcol + 42] : null;
  2447. $this->modified_at = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
  2448. $this->puser_id = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
  2449. $this->access_control_id = ($row[$startcol + 45] !== null) ? (int) $row[$startcol + 45] : null;
  2450. $this->conversion_profile_id = ($row[$startcol + 46] !== null) ? (int) $row[$startcol + 46] : null;
  2451. $this->categories = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
  2452. $this->categories_ids = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
  2453. $this->start_date = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
  2454. $this->end_date = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
  2455. $this->search_text_discrete = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
  2456. $this->flavor_params_ids = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
  2457. $this->available_from = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
  2458. $this->resetModified();
  2459. $this->setNew(false);
  2460. if ($rehydrate) {
  2461. $this->ensureConsistency();
  2462. }
  2463. // FIXME - using NUM_COLUMNS may be clearer.
  2464. return $startcol + 54; // 54 = entryPeer::NUM_COLUMNS - entryPeer::NUM_LAZY_LOAD_COLUMNS).
  2465. } catch (Exception $e) {
  2466. throw new PropelException("Error populating entry object", $e);
  2467. }
  2468. }
  2469. /**
  2470. * Checks and repairs the internal consistency of the object.
  2471. *
  2472. * This method is executed after an already-instantiated object is re-hydrated
  2473. * from the database. It exists to check any foreign keys to make sure that
  2474. * the objects related to the current object are correct based on foreign key.
  2475. *
  2476. * You can override this method in the stub class, but you should always invoke
  2477. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  2478. * in case your model changes.
  2479. *
  2480. * @throws PropelException
  2481. */
  2482. public function ensureConsistency()
  2483. {
  2484. if ($this->akshow !== null && $this->kshow_id !== $this->akshow->getId()) {
  2485. $this->akshow = null;
  2486. }
  2487. if ($this->akuser !== null && $this->kuser_id !== $this->akuser->getId()) {
  2488. $this->akuser = null;
  2489. }
  2490. if ($this->aaccessControl !== null && $this->access_control_id !== $this->aaccessControl->getId()) {
  2491. $this->aaccessControl = null;
  2492. }
  2493. if ($this->aconversionProfile2 !== null && $this->conversion_profile_id !== $this->aconversionProfile2->getId()) {
  2494. $this->aconversionProfile2 = null;
  2495. }
  2496. } // ensureConsistency
  2497. /**
  2498. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  2499. *
  2500. * This will only work if the object has been saved and has a valid primary key set.
  2501. *
  2502. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  2503. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  2504. * @return void
  2505. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  2506. */
  2507. public function reload($deep = false, PropelPDO $con = null)
  2508. {
  2509. if ($this->isDeleted()) {
  2510. throw new PropelException("Cannot reload a deleted object.");
  2511. }
  2512. if ($this->isNew()) {
  2513. throw new PropelException("Cannot reload an unsaved object.");
  2514. }
  2515. if ($con === null) {
  2516. $con = Propel::getConnection(entryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  2517. }
  2518. // We don't need to alter the object instance pool; we're just modifying this instance
  2519. // already in the pool.
  2520. entryPeer::setUseCriteriaFilter(false);
  2521. $stmt = entryPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  2522. entryPeer::setUseCriteriaFilter(true);
  2523. $row = $stmt->fetch(PDO::FETCH_NUM);
  2524. $stmt->closeCursor();
  2525. if (!$row) {
  2526. throw new PropelException('Cannot find matching row in the database to reload object values.');
  2527. }
  2528. $this->hydrate($row, 0, true); // rehydrate
  2529. if ($deep) { // also de-associate any related objects?
  2530. $this->akshow = null;
  2531. $this->akuser = null;
  2532. $this->aaccessControl = null;
  2533. $this->aconversionProfile2 = null;
  2534. $this->collkvotes = null;
  2535. $this->lastkvoteCriteria = null;
  2536. $this->collconversions = null;
  2537. $this->lastconversionCriteria = null;
  2538. $this->collWidgetLogs = null;
  2539. $this->lastWidgetLogCriteria = null;
  2540. $this->collmoderationFlags = null;
  2541. $this->lastmoderationFlagCriteria = null;
  2542. $this->collroughcutEntrysRelatedByRoughcutId = null;
  2543. $this->lastroughcutEntryRelatedByRoughcutIdCriteria = null;
  2544. $this->collroughcutEntrysRelatedByEntryId = null;
  2545. $this->lastroughcutEntryRelatedByEntryIdCriteria = null;
  2546. $this->collwidgets = null;
  2547. $this->lastwidgetCriteria = null;
  2548. $this->collassetParamsOutputs = null;
  2549. $this->lastassetParamsOutputCriteria = null;
  2550. $this->collassets = null;
  2551. $this->lastassetCriteria = null;
  2552. } // if (deep)
  2553. }
  2554. /**
  2555. * Removes this object from datastore and sets delete attribute.
  2556. *
  2557. * @param PropelPDO $con
  2558. * @return void
  2559. * @throws PropelException
  2560. * @see BaseObject::setDeleted()
  2561. * @see BaseObject::isDeleted()
  2562. */
  2563. public function delete(PropelPDO $con = null)
  2564. {
  2565. if ($this->isDeleted()) {
  2566. throw new PropelException("This object has already been deleted.");
  2567. }
  2568. if ($con === null) {
  2569. $con = Propel::getConnection(entryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  2570. }
  2571. $con->beginTransaction();
  2572. try {
  2573. $ret = $this->preDelete($con);
  2574. if ($ret) {
  2575. entryPeer::doDelete($this, $con);
  2576. $this->postDelete($con);
  2577. $this->setDeleted(true);
  2578. $con->commit();
  2579. } else {
  2580. $con->commit();
  2581. }
  2582. } catch (PropelException $e) {
  2583. $con->rollBack();
  2584. throw $e;
  2585. }
  2586. }
  2587. /**
  2588. * Persists this object to the database.
  2589. *
  2590. * If the object is new, it inserts it; otherwise an update is performed.
  2591. * All modified related objects will also be persisted in the doSave()
  2592. * method. This method wraps all precipitate database operations in a
  2593. * single transaction.
  2594. *
  2595. * Since this table was configured to reload rows on insert, the object will
  2596. * be reloaded from the database if an INSERT operation is performed (unless
  2597. * the $skipReload parameter is TRUE).
  2598. *
  2599. * @param PropelPDO $con
  2600. * @param boolean $skipReload Whether to skip the reload for this object from database.
  2601. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  2602. * @throws PropelException
  2603. * @see doSave()
  2604. */
  2605. public function save(PropelPDO $con = null, $skipReload = false)
  2606. {
  2607. if ($this->isDeleted()) {
  2608. throw new PropelException("You cannot save an object that has been deleted.");
  2609. }
  2610. if ($con === null) {
  2611. $con = Propel::getConnection(entryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  2612. }
  2613. $con->beginTransaction();
  2614. $isInsert = $this->isNew();
  2615. try {
  2616. $ret = $this->preSave($con);
  2617. if ($isInsert) {
  2618. $ret = $ret && $this->preInsert($con);
  2619. } else {
  2620. $ret = $ret && $this->preUpdate($con);
  2621. }
  2622. if ($ret) {
  2623. $affectedRows = $this->doSave($con, $skipReload);
  2624. if ($isInsert) {
  2625. $this->postInsert($con);
  2626. } else {
  2627. $this->postUpdate($con);
  2628. }
  2629. $this->postSave($con);
  2630. entryPeer::addInstanceToPool($this);
  2631. } else {
  2632. $affectedRows = 0;
  2633. }
  2634. $con->commit();
  2635. return $affectedRows;
  2636. } catch (PropelException $e) {
  2637. $con->rollBack();
  2638. throw $e;
  2639. }
  2640. }
  2641. public function wasObjectSaved()
  2642. {
  2643. return $this->objectSaved;
  2644. }
  2645. /**
  2646. * Performs the work of inserting or updating the row in the database.
  2647. *
  2648. * If the object is new, it inserts it; otherwise an update is performed.
  2649. * All related objects are also updated in this method.
  2650. *
  2651. * @param PropelPDO $con
  2652. * @param boolean $skipReload Whether to skip the reload for this object from database.
  2653. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  2654. * @throws PropelException
  2655. * @see save()
  2656. */
  2657. protected function doSave(PropelPDO $con, $skipReload = false)
  2658. {
  2659. $affectedRows = 0; // initialize var to track total num of affected rows
  2660. if (!$this->alreadyInSave) {
  2661. $this->alreadyInSave = true;
  2662. $reloadObject = false;
  2663. // We call the save method on the following object(s) if they
  2664. // were passed to this object by their coresponding set
  2665. // method. This object relates to these object(s) by a
  2666. // foreign key reference.
  2667. if ($this->akshow !== null) {
  2668. if ($this->akshow->isModified() || $this->akshow->isNew()) {
  2669. $affectedRows += $this->akshow->save($con);
  2670. }
  2671. $this->setkshow($this->akshow);
  2672. }
  2673. if ($this->akuser !== null) {
  2674. if ($this->akuser->isModified() || $this->akuser->isNew()) {
  2675. $affectedRows += $this->akuser->save($con);
  2676. }
  2677. $this->setkuser($this->akuser);
  2678. }
  2679. if ($this->aaccessControl !== null) {
  2680. if ($this->aaccessControl->isModified() || $this->aaccessControl->isNew()) {
  2681. $affectedRows += $this->aaccessControl->save($con);
  2682. }
  2683. $this->setaccessControl($this->aaccessControl);
  2684. }
  2685. if ($this->aconversionProfile2 !== null) {
  2686. if ($this->aconversionProfile2->isModified() || $this->aconversionProfile2->isNew()) {
  2687. $affectedRows += $this->aconversionProfile2->save($con);
  2688. }
  2689. $this->setconversionProfile2($this->aconversionProfile2);
  2690. }
  2691. // If this object has been modified, then save it to the database.
  2692. $this->objectSaved = false;
  2693. if ($this->isModified()) {
  2694. if ($this->isNew()) {
  2695. $pk = entryPeer::doInsert($this, $con);
  2696. if (!$skipReload) {
  2697. $reloadObject = true;
  2698. }
  2699. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  2700. // should always be true here (even though technically
  2701. // BasePeer::doInsert() can insert multiple rows).
  2702. $this->setNew(false);
  2703. $this->objectSaved = true;
  2704. } else {
  2705. $affectedObjects = entryPeer::doUpdate($this, $con);
  2706. if($affectedObjects)
  2707. $this->objectSaved = true;
  2708. $affectedRows += $affectedObjects;
  2709. }
  2710. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  2711. }
  2712. if ($this->collkvotes !== null) {
  2713. foreach ($this->collkvotes as $referrerFK) {
  2714. if (!$referrerFK->isDeleted()) {
  2715. $affectedRows += $referrerFK->save($con);
  2716. }
  2717. }
  2718. }
  2719. if ($this->collconversions !== null) {
  2720. foreach ($this->collconversions as $referrerFK) {
  2721. if (!$referrerFK->isDeleted()) {
  2722. $affectedRows += $referrerFK->save($con);
  2723. }
  2724. }
  2725. }
  2726. if ($this->collWidgetLogs !== null) {
  2727. foreach ($this->collWidgetLogs as $referrerFK) {
  2728. if (!$referrerFK->isDeleted()) {
  2729. $affectedRows += $referrerFK->save($con);
  2730. }
  2731. }
  2732. }
  2733. if ($this->collmoderationFlags !== null) {
  2734. foreach ($this->collmoderationFlags as $referrerFK) {
  2735. if (!$referrerFK->isDeleted()) {
  2736. $affectedRows += $referrerFK->save($con);
  2737. }
  2738. }
  2739. }
  2740. if ($this->collroughcutEntrysRelatedByRoughcutId !== null) {
  2741. foreach ($this->collroughcutEntrysRelatedByRoughcutId as $referrerFK) {
  2742. if (!$referrerFK->isDeleted()) {
  2743. $affectedRows += $referrerFK->save($con);
  2744. }
  2745. }
  2746. }
  2747. if ($this->collroughcutEntrysRelatedByEntryId !== null) {
  2748. foreach ($this->collroughcutEntrysRelatedByEntryId as $referrerFK) {
  2749. if (!$referrerFK->isDeleted()) {
  2750. $affectedRows += $referrerFK->save($con);
  2751. }
  2752. }
  2753. }
  2754. if ($this->collwidgets !== null) {
  2755. foreach ($this->collwidgets as $referrerFK) {
  2756. if (!$referrerFK->isDeleted()) {
  2757. $affectedRows += $referrerFK->save($con);
  2758. }
  2759. }
  2760. }
  2761. if ($this->collassetParamsOutputs !== null) {
  2762. foreach ($this->collassetParamsOutputs as $referrerFK) {
  2763. if (!$referrerFK->isDeleted()) {
  2764. $affectedRows += $referrerFK->save($con);
  2765. }
  2766. }
  2767. }
  2768. if ($this->collassets !== null) {
  2769. foreach ($this->collassets as $referrerFK) {
  2770. if (!$referrerFK->isDeleted()) {
  2771. $affectedRows += $referrerFK->save($con);
  2772. }
  2773. }
  2774. }
  2775. $this->alreadyInSave = false;
  2776. if ($reloadObject) {
  2777. $this->reload($con);
  2778. }
  2779. }
  2780. return $affectedRows;
  2781. } // doSave()
  2782. /**
  2783. * Override in order to use the query cache.
  2784. * Cache invalidation keys are used to determine when cached queries are valid.
  2785. * Before returning a query result from the cache, the time of the cached query
  2786. * is compared to the time saved in the invalidation key.
  2787. * A cached query will only be used if it's newer than the matching invalidation key.
  2788. *
  2789. * @return array Array of keys that will should be updated when this object is modified.
  2790. */
  2791. public function getCacheInvalidationKeys()
  2792. {
  2793. return array();
  2794. }
  2795. /**
  2796. * Code to be run before persisting the object
  2797. * @param PropelPDO $con
  2798. * @return bloolean
  2799. */
  2800. public function preSave(PropelPDO $con = null)
  2801. {
  2802. $this->setCustomDataObj();
  2803. return parent::preSave($con);
  2804. }
  2805. /**
  2806. * Code to be run after persisting the object
  2807. * @param PropelPDO $con
  2808. */
  2809. public function postSave(PropelPDO $con = null)
  2810. {
  2811. $this->oldColumnsValues = array();
  2812. $this->oldCustomDataValues = array();
  2813. }
  2814. /**
  2815. * Code to be run before inserting to database
  2816. * @param PropelPDO $con
  2817. * @return boolean
  2818. */
  2819. public function preInsert(PropelPDO $con = null)
  2820. {
  2821. $this->setCreatedAt(time());
  2822. $this->setUpdatedAt(time());
  2823. return true;
  2824. }
  2825. /**
  2826. * Code to be run after inserting to database
  2827. * @param PropelPDO $con
  2828. */
  2829. public function postInsert(PropelPDO $con = null)
  2830. {
  2831. kQueryCache::invalidateQueryCache($this);
  2832. kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
  2833. if($this->copiedFrom)
  2834. kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
  2835. }
  2836. /**
  2837. * Code to be run after updating the object in database
  2838. * @param PropelPDO $con
  2839. */
  2840. public function postUpdate(PropelPDO $con = null)
  2841. {
  2842. if ($this->alreadyInSave)
  2843. {
  2844. return;
  2845. }
  2846. if($this->isModified())
  2847. {
  2848. kQueryCache::invalidateQueryCache($this);
  2849. kEventsManager::raiseEvent(new kObjectChangedEvent($this, $this->tempModifiedColumns));
  2850. }
  2851. $this->tempModifiedColumns = array();
  2852. }
  2853. /**
  2854. * Saves the modified columns temporarily while saving
  2855. * @var array
  2856. */
  2857. private $tempModifiedColumns = array();
  2858. /**
  2859. * Returns whether the object has been modified.
  2860. *
  2861. * @return boolean True if the object has been modified.
  2862. */
  2863. public function isModified()
  2864. {
  2865. if(!empty($this->tempModifiedColumns))
  2866. return true;
  2867. return !empty($this->modifiedColumns);
  2868. }
  2869. /**
  2870. * Has specified column been modified?
  2871. *
  2872. * @param string $col
  2873. * @return boolean True if $col has been modified.
  2874. */
  2875. public function isColumnModified($col)
  2876. {
  2877. if(in_array($col, $this->tempModifiedColumns))
  2878. return true;
  2879. return in_array($col, $this->modifiedColumns);
  2880. }
  2881. /**
  2882. * Code to be run before updating the object in database
  2883. * @param PropelPDO $con
  2884. * @return boolean
  2885. */
  2886. public function preUpdate(PropelPDO $con = null)
  2887. {
  2888. if ($this->alreadyInSave)
  2889. {
  2890. return true;
  2891. }
  2892. if($this->isModified())
  2893. $this->setUpdatedAt(time());
  2894. $this->tempModifiedColumns = $this->modifiedColumns;
  2895. return true;
  2896. }
  2897. /**
  2898. * Array of ValidationFailed objects.
  2899. * @var array ValidationFailed[]
  2900. */
  2901. protected $validationFailures = array();
  2902. /**
  2903. * Gets any ValidationFailed objects that resulted from last call to validate().
  2904. *
  2905. *
  2906. * @return array ValidationFailed[]
  2907. * @see validate()
  2908. */
  2909. public function getValidationFailures()
  2910. {
  2911. return $this->validationFailures;
  2912. }
  2913. /**
  2914. * Validates the objects modified field values and all objects related to this table.
  2915. *
  2916. * If $columns is either a column name or an array of column names
  2917. * only those columns are validated.
  2918. *
  2919. * @param mixed $columns Column name or an array of column names.
  2920. * @return boolean Whether all columns pass validation.
  2921. * @see doValidate()
  2922. * @see getValidationFailures()
  2923. */
  2924. public function validate($columns = null)
  2925. {
  2926. $res = $this->doValidate($columns);
  2927. if ($res === true) {
  2928. $this->validationFailures = array();
  2929. return true;
  2930. } else {
  2931. $this->validationFailures = $res;
  2932. return false;
  2933. }
  2934. }
  2935. /**
  2936. * This function performs the validation work for complex object models.
  2937. *
  2938. * In addition to checking the current object, all related objects will
  2939. * also be validated. If all pass then <code>true</code> is returned; otherwise
  2940. * an aggreagated array of ValidationFailed objects will be returned.
  2941. *
  2942. * @param array $columns Array of column names to validate.
  2943. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  2944. */
  2945. protected function doValidate($columns = null)
  2946. {
  2947. if (!$this->alreadyInValidation) {
  2948. $this->alreadyInValidation = true;
  2949. $retval = null;
  2950. $failureMap = array();
  2951. // We call the validate method on the following object(s) if they
  2952. // were passed to this object by their coresponding set
  2953. // method. This object relates to these object(s) by a
  2954. // foreign key reference.
  2955. if ($this->akshow !== null) {
  2956. if (!$this->akshow->validate($columns)) {
  2957. $failureMap = array_merge($failureMap, $this->akshow->getValidationFailures());
  2958. }
  2959. }
  2960. if ($this->akuser !== null) {
  2961. if (!$this->akuser->validate($columns)) {
  2962. $failureMap = array_merge($failureMap, $this->akuser->getValidationFailures());
  2963. }
  2964. }
  2965. if ($this->aaccessControl !== null) {
  2966. if (!$this->aaccessControl->validate($columns)) {
  2967. $failureMap = array_merge($failureMap, $this->aaccessControl->getValidationFailures());
  2968. }
  2969. }
  2970. if ($this->aconversionProfile2 !== null) {
  2971. if (!$this->aconversionProfile2->validate($columns)) {
  2972. $failureMap = array_merge($failureMap, $this->aconversionProfile2->getValidationFailures());
  2973. }
  2974. }
  2975. if (($retval = entryPeer::doValidate($this, $columns)) !== true) {
  2976. $failureMap = array_merge($failureMap, $retval);
  2977. }
  2978. if ($this->collkvotes !== null) {
  2979. foreach ($this->collkvotes as $referrerFK) {
  2980. if (!$referrerFK->validate($columns)) {
  2981. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  2982. }
  2983. }
  2984. }
  2985. if ($this->collconversions !== null) {
  2986. foreach ($this->collconversions as $referrerFK) {
  2987. if (!$referrerFK->validate($columns)) {
  2988. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  2989. }
  2990. }
  2991. }
  2992. if ($this->collWidgetLogs !== null) {
  2993. foreach ($this->collWidgetLogs as $referrerFK) {
  2994. if (!$referrerFK->validate($columns)) {
  2995. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  2996. }
  2997. }
  2998. }
  2999. if ($this->collmoderationFlags !== null) {
  3000. foreach ($this->collmoderationFlags as $referrerFK) {
  3001. if (!$referrerFK->validate($columns)) {
  3002. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3003. }
  3004. }
  3005. }
  3006. if ($this->collroughcutEntrysRelatedByRoughcutId !== null) {
  3007. foreach ($this->collroughcutEntrysRelatedByRoughcutId as $referrerFK) {
  3008. if (!$referrerFK->validate($columns)) {
  3009. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3010. }
  3011. }
  3012. }
  3013. if ($this->collroughcutEntrysRelatedByEntryId !== null) {
  3014. foreach ($this->collroughcutEntrysRelatedByEntryId as $referrerFK) {
  3015. if (!$referrerFK->validate($columns)) {
  3016. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3017. }
  3018. }
  3019. }
  3020. if ($this->collwidgets !== null) {
  3021. foreach ($this->collwidgets as $referrerFK) {
  3022. if (!$referrerFK->validate($columns)) {
  3023. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3024. }
  3025. }
  3026. }
  3027. if ($this->collassetParamsOutputs !== null) {
  3028. foreach ($this->collassetParamsOutputs as $referrerFK) {
  3029. if (!$referrerFK->validate($columns)) {
  3030. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3031. }
  3032. }
  3033. }
  3034. if ($this->collassets !== null) {
  3035. foreach ($this->collassets as $referrerFK) {
  3036. if (!$referrerFK->validate($columns)) {
  3037. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  3038. }
  3039. }
  3040. }
  3041. $this->alreadyInValidation = false;
  3042. }
  3043. return (!empty($failureMap) ? $failureMap : true);
  3044. }
  3045. /**
  3046. * Retrieves a field from the object by name passed in as a string.
  3047. *
  3048. * @param string $name name
  3049. * @param string $type The type of fieldname the $name is of:
  3050. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  3051. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  3052. * @return mixed Value of field.
  3053. */
  3054. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  3055. {
  3056. $pos = entryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  3057. $field = $this->getByPosition($pos);
  3058. return $field;
  3059. }
  3060. /**
  3061. * Retrieves a field from the object by Position as specified in the xml schema.
  3062. * Zero-based.
  3063. *
  3064. * @param int $pos position in xml schema
  3065. * @return mixed Value of field at $pos
  3066. */
  3067. public function getByPosition($pos)
  3068. {
  3069. switch($pos) {
  3070. case 0:
  3071. return $this->getId();
  3072. break;
  3073. case 1:
  3074. return $this->getKshowId();
  3075. break;
  3076. case 2:
  3077. return $this->getKuserId();
  3078. break;
  3079. case 3:
  3080. return $this->getName();
  3081. break;
  3082. case 4:
  3083. return $this->getType();
  3084. break;
  3085. case 5:
  3086. return $this->getMediaType();
  3087. break;
  3088. case 6:
  3089. return $this->getData();
  3090. break;
  3091. case 7:
  3092. return $this->getThumbnail();
  3093. break;
  3094. case 8:
  3095. return $this->getViews();
  3096. break;
  3097. case 9:
  3098. return $this->getVotes();
  3099. break;
  3100. case 10:
  3101. return $this->getComments();
  3102. break;
  3103. case 11:
  3104. return $this->getFavorites();
  3105. break;
  3106. case 12:
  3107. return $this->getTotalRank();
  3108. break;
  3109. case 13:
  3110. return $this->getRank();
  3111. break;
  3112. case 14:
  3113. return $this->getTags();
  3114. break;
  3115. case 15:
  3116. return $this->getAnonymous();
  3117. break;
  3118. case 16:
  3119. return $this->getStatus();
  3120. break;
  3121. case 17:
  3122. return $this->getSource();
  3123. break;
  3124. case 18:
  3125. return $this->getSourceId();
  3126. break;
  3127. case 19:
  3128. return $this->getSourceLink();
  3129. break;
  3130. case 20:
  3131. return $this->getLicenseType();
  3132. break;
  3133. case 21:
  3134. return $this->getCredit();
  3135. break;
  3136. case 22:
  3137. return $this->getLengthInMsecs();
  3138. break;
  3139. case 23:
  3140. return $this->getCreatedAt();
  3141. break;
  3142. case 24:
  3143. return $this->getUpdatedAt();
  3144. break;
  3145. case 25:
  3146. return $this->getPartnerId();
  3147. break;
  3148. case 26:
  3149. return $this->getDisplayInSearch();
  3150. break;
  3151. case 27:
  3152. return $this->getSubpId();
  3153. break;
  3154. case 28:
  3155. return $this->getCustomData();
  3156. break;
  3157. case 29:
  3158. return $this->getSearchText();
  3159. break;
  3160. case 30:
  3161. return $this->getScreenName();
  3162. break;
  3163. case 31:
  3164. return $this->getSiteUrl();
  3165. break;
  3166. case 32:
  3167. return $this->getPermissions();
  3168. break;
  3169. case 33:
  3170. return $this->getGroupId();
  3171. break;
  3172. case 34:
  3173. return $this->getPlays();
  3174. break;
  3175. case 35:
  3176. return $this->getPartnerData();
  3177. break;
  3178. case 36:
  3179. return $this->getIntId();
  3180. break;
  3181. case 37:
  3182. return $this->getIndexedCustomData1();
  3183. break;
  3184. case 38:
  3185. return $this->getDescription();
  3186. break;
  3187. case 39:
  3188. return $this->getMediaDate();
  3189. break;
  3190. case 40:
  3191. return $this->getAdminTags();
  3192. break;
  3193. case 41:
  3194. return $this->getModerationStatus();
  3195. break;
  3196. case 42:
  3197. return $this->getModerationCount();
  3198. break;
  3199. case 43:
  3200. return $this->getModifiedAt();
  3201. break;
  3202. case 44:
  3203. return $this->getPuserId();
  3204. break;
  3205. case 45:
  3206. return $this->getAccessControlId();
  3207. break;
  3208. case 46:
  3209. return $this->getConversionProfileId();
  3210. break;
  3211. case 47:
  3212. return $this->getCategories();
  3213. break;
  3214. case 48:
  3215. return $this->getCategoriesIds();
  3216. break;
  3217. case 49:
  3218. return $this->getStartDate();
  3219. break;
  3220. case 50:
  3221. return $this->getEndDate();
  3222. break;
  3223. case 51:
  3224. return $this->getSearchTextDiscrete();
  3225. break;
  3226. case 52:
  3227. return $this->getFlavorParamsIds();
  3228. break;
  3229. case 53:
  3230. return $this->getAvailableFrom();
  3231. break;
  3232. default:
  3233. return null;
  3234. break;
  3235. } // switch()
  3236. }
  3237. /**
  3238. * Exports the object as an array.
  3239. *
  3240. * You can specify the key type of the array by passing one of the class
  3241. * type constants.
  3242. *
  3243. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  3244. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  3245. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  3246. * @return an associative array containing the field names (as keys) and field values
  3247. */
  3248. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  3249. {
  3250. $keys = entryPeer::getFieldNames($keyType);
  3251. $result = array(
  3252. $keys[0] => $this->getId(),
  3253. $keys[1] => $this->getKshowId(),
  3254. $keys[2] => $this->getKuserId(),
  3255. $keys[3] => $this->getName(),
  3256. $keys[4] => $this->getType(),
  3257. $keys[5] => $this->getMediaType(),
  3258. $keys[6] => $this->getData(),
  3259. $keys[7] => $this->getThumbnail(),
  3260. $keys[8] => $this->getViews(),
  3261. $keys[9] => $this->getVotes(),
  3262. $keys[10] => $this->getComments(),
  3263. $keys[11] => $this->getFavorites(),
  3264. $keys[12] => $this->getTotalRank(),
  3265. $keys[13] => $this->getRank(),
  3266. $keys[14] => $this->getTags(),
  3267. $keys[15] => $this->getAnonymous(),
  3268. $keys[16] => $this->getStatus(),
  3269. $keys[17] => $this->getSource(),
  3270. $keys[18] => $this->getSourceId(),
  3271. $keys[19] => $this->getSourceLink(),
  3272. $keys[20] => $this->getLicenseType(),
  3273. $keys[21] => $this->getCredit(),
  3274. $keys[22] => $this->getLengthInMsecs(),
  3275. $keys[23] => $this->getCreatedAt(),
  3276. $keys[24] => $this->getUpdatedAt(),
  3277. $keys[25] => $this->getPartnerId(),
  3278. $keys[26] => $this->getDisplayInSearch(),
  3279. $keys[27] => $this->getSubpId(),
  3280. $keys[28] => $this->getCustomData(),
  3281. $keys[29] => $this->getSearchText(),
  3282. $keys[30] => $this->getScreenName(),
  3283. $keys[31] => $this->getSiteUrl(),
  3284. $keys[32] => $this->getPermissions(),
  3285. $keys[33] => $this->getGroupId(),
  3286. $keys[34] => $this->getPlays(),
  3287. $keys[35] => $this->getPartnerData(),
  3288. $keys[36] => $this->getIntId(),
  3289. $keys[37] => $this->getIndexedCustomData1(),
  3290. $keys[38] => $this->getDescription(),
  3291. $keys[39] => $this->getMediaDate(),
  3292. $keys[40] => $this->getAdminTags(),
  3293. $keys[41] => $this->getModerationStatus(),
  3294. $keys[42] => $this->getModerationCount(),
  3295. $keys[43] => $this->getModifiedAt(),
  3296. $keys[44] => $this->getPuserId(),
  3297. $keys[45] => $this->getAccessControlId(),
  3298. $keys[46] => $this->getConversionProfileId(),
  3299. $keys[47] => $this->getCategories(),
  3300. $keys[48] => $this->getCategoriesIds(),
  3301. $keys[49] => $this->getStartDate(),
  3302. $keys[50] => $this->getEndDate(),
  3303. $keys[51] => $this->getSearchTextDiscrete(),
  3304. $keys[52] => $this->getFlavorParamsIds(),
  3305. $keys[53] => $this->getAvailableFrom(),
  3306. );
  3307. return $result;
  3308. }
  3309. /**
  3310. * Sets a field from the object by name passed in as a string.
  3311. *
  3312. * @param string $name peer name
  3313. * @param mixed $value field value
  3314. * @param string $type The type of fieldname the $name is of:
  3315. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  3316. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  3317. * @return void
  3318. */
  3319. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  3320. {
  3321. $pos = entryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  3322. return $this->setByPosition($pos, $value);
  3323. }
  3324. /**
  3325. * Sets a field from the object by Position as specified in the xml schema.
  3326. * Zero-based.
  3327. *
  3328. * @param int $pos position in xml schema
  3329. * @param mixed $value field value
  3330. * @return void
  3331. */
  3332. public function setByPosition($pos, $value)
  3333. {
  3334. switch($pos) {
  3335. case 0:
  3336. $this->setId($value);
  3337. break;
  3338. case 1:
  3339. $this->setKshowId($value);
  3340. break;
  3341. case 2:
  3342. $this->setKuserId($value);
  3343. break;
  3344. case 3:
  3345. $this->setName($value);
  3346. break;
  3347. case 4:
  3348. $this->setType($value);
  3349. break;
  3350. case 5:
  3351. $this->setMediaType($value);
  3352. break;
  3353. case 6:
  3354. $this->setData($value);
  3355. break;
  3356. case 7:
  3357. $this->setThumbnail($value);
  3358. break;
  3359. case 8:
  3360. $this->setViews($value);
  3361. break;
  3362. case 9:
  3363. $this->setVotes($value);
  3364. break;
  3365. case 10:
  3366. $this->setComments($value);
  3367. break;
  3368. case 11:
  3369. $this->setFavorites($value);
  3370. break;
  3371. case 12:
  3372. $this->setTotalRank($value);
  3373. break;
  3374. case 13:
  3375. $this->setRank($value);
  3376. break;
  3377. case 14:
  3378. $this->setTags($value);
  3379. break;
  3380. case 15:
  3381. $this->setAnonymous($value);
  3382. break;
  3383. case 16:
  3384. $this->setStatus($value);
  3385. break;
  3386. case 17:
  3387. $this->setSource($value);
  3388. break;
  3389. case 18:
  3390. $this->setSourceId($value);
  3391. break;
  3392. case 19:
  3393. $this->setSourceLink($value);
  3394. break;
  3395. case 20:
  3396. $this->setLicenseType($value);
  3397. break;
  3398. case 21:
  3399. $this->setCredit($value);
  3400. break;
  3401. case 22:
  3402. $this->setLengthInMsecs($value);
  3403. break;
  3404. case 23:
  3405. $this->setCreatedAt($value);
  3406. break;
  3407. case 24:
  3408. $this->setUpdatedAt($value);
  3409. break;
  3410. case 25:
  3411. $this->setPartnerId($value);
  3412. break;
  3413. case 26:
  3414. $this->setDisplayInSearch($value);
  3415. break;
  3416. case 27:
  3417. $this->setSubpId($value);
  3418. break;
  3419. case 28:
  3420. $this->setCustomData($value);
  3421. break;
  3422. case 29:
  3423. $this->setSearchText($value);
  3424. break;
  3425. case 30:
  3426. $this->setScreenName($value);
  3427. break;
  3428. case 31:
  3429. $this->setSiteUrl($value);
  3430. break;
  3431. case 32:
  3432. $this->setPermissions($value);
  3433. break;
  3434. case 33:
  3435. $this->setGroupId($value);
  3436. break;
  3437. case 34:
  3438. $this->setPlays($value);
  3439. break;
  3440. case 35:
  3441. $this->setPartnerData($value);
  3442. break;
  3443. case 36:
  3444. $this->setIntId($value);
  3445. break;
  3446. case 37:
  3447. $this->setIndexedCustomData1($value);
  3448. break;
  3449. case 38:
  3450. $this->setDescription($value);
  3451. break;
  3452. case 39:
  3453. $this->setMediaDate($value);
  3454. break;
  3455. case 40:
  3456. $this->setAdminTags($value);
  3457. break;
  3458. case 41:
  3459. $this->setModerationStatus($value);
  3460. break;
  3461. case 42:
  3462. $this->setModerationCount($value);
  3463. break;
  3464. case 43:
  3465. $this->setModifiedAt($value);
  3466. break;
  3467. case 44:
  3468. $this->setPuserId($value);
  3469. break;
  3470. case 45:
  3471. $this->setAccessControlId($value);
  3472. break;
  3473. case 46:
  3474. $this->setConversionProfileId($value);
  3475. break;
  3476. case 47:
  3477. $this->setCategories($value);
  3478. break;
  3479. case 48:
  3480. $this->setCategoriesIds($value);
  3481. break;
  3482. case 49:
  3483. $this->setStartDate($value);
  3484. break;
  3485. case 50:
  3486. $this->setEndDate($value);
  3487. break;
  3488. case 51:
  3489. $this->setSearchTextDiscrete($value);
  3490. break;
  3491. case 52:
  3492. $this->setFlavorParamsIds($value);
  3493. break;
  3494. case 53:
  3495. $this->setAvailableFrom($value);
  3496. break;
  3497. } // switch()
  3498. }
  3499. /**
  3500. * Populates the object using an array.
  3501. *
  3502. * This is particularly useful when populating an object from one of the
  3503. * request arrays (e.g. $_POST). This method goes through the column
  3504. * names, checking to see whether a matching key exists in populated
  3505. * array. If so the setByName() method is called for that column.
  3506. *
  3507. * You can specify the key type of the array by additionally passing one
  3508. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  3509. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  3510. * The default key type is the column's phpname (e.g. 'AuthorId')
  3511. *
  3512. * @param array $arr An array to populate the object from.
  3513. * @param string $keyType The type of keys the array uses.
  3514. * @return void
  3515. */
  3516. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  3517. {
  3518. $keys = entryPeer::getFieldNames($keyType);
  3519. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  3520. if (array_key_exists($keys[1], $arr)) $this->setKshowId($arr[$keys[1]]);
  3521. if (array_key_exists($keys[2], $arr)) $this->setKuserId($arr[$keys[2]]);
  3522. if (array_key_exists($keys[3], $arr)) $this->setName($arr[$keys[3]]);
  3523. if (array_key_exists($keys[4], $arr)) $this->setType($arr[$keys[4]]);
  3524. if (array_key_exists($keys[5], $arr)) $this->setMediaType($arr[$keys[5]]);
  3525. if (array_key_exists($keys[6], $arr)) $this->setData($arr[$keys[6]]);
  3526. if (array_key_exists($keys[7], $arr)) $this->setThumbnail($arr[$keys[7]]);
  3527. if (array_key_exists($keys[8], $arr)) $this->setViews($arr[$keys[8]]);
  3528. if (array_key_exists($keys[9], $arr)) $this->setVotes($arr[$keys[9]]);
  3529. if (array_key_exists($keys[10], $arr)) $this->setComments($arr[$keys[10]]);
  3530. if (array_key_exists($keys[11], $arr)) $this->setFavorites($arr[$keys[11]]);
  3531. if (array_key_exists($keys[12], $arr)) $this->setTotalRank($arr[$keys[12]]);
  3532. if (array_key_exists($keys[13], $arr)) $this->setRank($arr[$keys[13]]);
  3533. if (array_key_exists($keys[14], $arr)) $this->setTags($arr[$keys[14]]);
  3534. if (array_key_exists($keys[15], $arr)) $this->setAnonymous($arr[$keys[15]]);
  3535. if (array_key_exists($keys[16], $arr)) $this->setStatus($arr[$keys[16]]);
  3536. if (array_key_exists($keys[17], $arr)) $this->setSource($arr[$keys[17]]);
  3537. if (array_key_exists($keys[18], $arr)) $this->setSourceId($arr[$keys[18]]);
  3538. if (array_key_exists($keys[19], $arr)) $this->setSourceLink($arr[$keys[19]]);
  3539. if (array_key_exists($keys[20], $arr)) $this->setLicenseType($arr[$keys[20]]);
  3540. if (array_key_exists($keys[21], $arr)) $this->setCredit($arr[$keys[21]]);
  3541. if (array_key_exists($keys[22], $arr)) $this->setLengthInMsecs($arr[$keys[22]]);
  3542. if (array_key_exists($keys[23], $arr)) $this->setCreatedAt($arr[$keys[23]]);
  3543. if (array_key_exists($keys[24], $arr)) $this->setUpdatedAt($arr[$keys[24]]);
  3544. if (array_key_exists($keys[25], $arr)) $this->setPartnerId($arr[$keys[25]]);
  3545. if (array_key_exists($keys[26], $arr)) $this->setDisplayInSearch($arr[$keys[26]]);
  3546. if (array_key_exists($keys[27], $arr)) $this->setSubpId($arr[$keys[27]]);
  3547. if (array_key_exists($keys[28], $arr)) $this->setCustomData($arr[$keys[28]]);
  3548. if (array_key_exists($keys[29], $arr)) $this->setSearchText($arr[$keys[29]]);
  3549. if (array_key_exists($keys[30], $arr)) $this->setScreenName($arr[$keys[30]]);
  3550. if (array_key_exists($keys[31], $arr)) $this->setSiteUrl($arr[$keys[31]]);
  3551. if (array_key_exists($keys[32], $arr)) $this->setPermissions($arr[$keys[32]]);
  3552. if (array_key_exists($keys[33], $arr)) $this->setGroupId($arr[$keys[33]]);
  3553. if (array_key_exists($keys[34], $arr)) $this->setPlays($arr[$keys[34]]);
  3554. if (array_key_exists($keys[35], $arr)) $this->setPartnerData($arr[$keys[35]]);
  3555. if (array_key_exists($keys[36], $arr)) $this->setIntId($arr[$keys[36]]);
  3556. if (array_key_exists($keys[37], $arr)) $this->setIndexedCustomData1($arr[$keys[37]]);
  3557. if (array_key_exists($keys[38], $arr)) $this->setDescription($arr[$keys[38]]);
  3558. if (array_key_exists($keys[39], $arr)) $this->setMediaDate($arr[$keys[39]]);
  3559. if (array_key_exists($keys[40], $arr)) $this->setAdminTags($arr[$keys[40]]);
  3560. if (array_key_exists($keys[41], $arr)) $this->setModerationStatus($arr[$keys[41]]);
  3561. if (array_key_exists($keys[42], $arr)) $this->setModerationCount($arr[$keys[42]]);
  3562. if (array_key_exists($keys[43], $arr)) $this->setModifiedAt($arr[$keys[43]]);
  3563. if (array_key_exists($keys[44], $arr)) $this->setPuserId($arr[$keys[44]]);
  3564. if (array_key_exists($keys[45], $arr)) $this->setAccessControlId($arr[$keys[45]]);
  3565. if (array_key_exists($keys[46], $arr)) $this->setConversionProfileId($arr[$keys[46]]);
  3566. if (array_key_exists($keys[47], $arr)) $this->setCategories($arr[$keys[47]]);
  3567. if (array_key_exists($keys[48], $arr)) $this->setCategoriesIds($arr[$keys[48]]);
  3568. if (array_key_exists($keys[49], $arr)) $this->setStartDate($arr[$keys[49]]);
  3569. if (array_key_exists($keys[50], $arr)) $this->setEndDate($arr[$keys[50]]);
  3570. if (array_key_exists($keys[51], $arr)) $this->setSearchTextDiscrete($arr[$keys[51]]);
  3571. if (array_key_exists($keys[52], $arr)) $this->setFlavorParamsIds($arr[$keys[52]]);
  3572. if (array_key_exists($keys[53], $arr)) $this->setAvailableFrom($arr[$keys[53]]);
  3573. }
  3574. /**
  3575. * Build a Criteria object containing the values of all modified columns in this object.
  3576. *
  3577. * @return Criteria The Criteria object containing all modified values.
  3578. */
  3579. public function buildCriteria()
  3580. {
  3581. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  3582. if ($this->isColumnModified(entryPeer::ID)) $criteria->add(entryPeer::ID, $this->id);
  3583. if ($this->isColumnModified(entryPeer::KSHOW_ID)) $criteria->add(entryPeer::KSHOW_ID, $this->kshow_id);
  3584. if ($this->isColumnModified(entryPeer::KUSER_ID)) $criteria->add(entryPeer::KUSER_ID, $this->kuser_id);
  3585. if ($this->isColumnModified(entryPeer::NAME)) $criteria->add(entryPeer::NAME, $this->name);
  3586. if ($this->isColumnModified(entryPeer::TYPE)) $criteria->add(entryPeer::TYPE, $this->type);
  3587. if ($this->isColumnModified(entryPeer::MEDIA_TYPE)) $criteria->add(entryPeer::MEDIA_TYPE, $this->media_type);
  3588. if ($this->isColumnModified(entryPeer::DATA)) $criteria->add(entryPeer::DATA, $this->data);
  3589. if ($this->isColumnModified(entryPeer::THUMBNAIL)) $criteria->add(entryPeer::THUMBNAIL, $this->thumbnail);
  3590. if ($this->isColumnModified(entryPeer::VIEWS)) $criteria->add(entryPeer::VIEWS, $this->views);
  3591. if ($this->isColumnModified(entryPeer::VOTES)) $criteria->add(entryPeer::VOTES, $this->votes);
  3592. if ($this->isColumnModified(entryPeer::COMMENTS)) $criteria->add(entryPeer::COMMENTS, $this->comments);
  3593. if ($this->isColumnModified(entryPeer::FAVORITES)) $criteria->add(entryPeer::FAVORITES, $this->favorites);
  3594. if ($this->isColumnModified(entryPeer::TOTAL_RANK)) $criteria->add(entryPeer::TOTAL_RANK, $this->total_rank);
  3595. if ($this->isColumnModified(entryPeer::RANK)) $criteria->add(entryPeer::RANK, $this->rank);
  3596. if ($this->isColumnModified(entryPeer::TAGS)) $criteria->add(entryPeer::TAGS, $this->tags);
  3597. if ($this->isColumnModified(entryPeer::ANONYMOUS)) $criteria->add(entryPeer::ANONYMOUS, $this->anonymous);
  3598. if ($this->isColumnModified(entryPeer::STATUS)) $criteria->add(entryPeer::STATUS, $this->status);
  3599. if ($this->isColumnModified(entryPeer::SOURCE)) $criteria->add(entryPeer::SOURCE, $this->source);
  3600. if ($this->isColumnModified(entryPeer::SOURCE_ID)) $criteria->add(entryPeer::SOURCE_ID, $this->source_id);
  3601. if ($this->isColumnModified(entryPeer::SOURCE_LINK)) $criteria->add(entryPeer::SOURCE_LINK, $this->source_link);
  3602. if ($this->isColumnModified(entryPeer::LICENSE_TYPE)) $criteria->add(entryPeer::LICENSE_TYPE, $this->license_type);
  3603. if ($this->isColumnModified(entryPeer::CREDIT)) $criteria->add(entryPeer::CREDIT, $this->credit);
  3604. if ($this->isColumnModified(entryPeer::LENGTH_IN_MSECS)) $criteria->add(entryPeer::LENGTH_IN_MSECS, $this->length_in_msecs);
  3605. if ($this->isColumnModified(entryPeer::CREATED_AT)) $criteria->add(entryPeer::CREATED_AT, $this->created_at);
  3606. if ($this->isColumnModified(entryPeer::UPDATED_AT)) $criteria->add(entryPeer::UPDATED_AT, $this->updated_at);
  3607. if ($this->isColumnModified(entryPeer::PARTNER_ID)) $criteria->add(entryPeer::PARTNER_ID, $this->partner_id);
  3608. if ($this->isColumnModified(entryPeer::DISPLAY_IN_SEARCH)) $criteria->add(entryPeer::DISPLAY_IN_SEARCH, $this->display_in_search);
  3609. if ($this->isColumnModified(entryPeer::SUBP_ID)) $criteria->add(entryPeer::SUBP_ID, $this->subp_id);
  3610. if ($this->isColumnModified(entryPeer::CUSTOM_DATA)) $criteria->add(entryPeer::CUSTOM_DATA, $this->custom_data);
  3611. if ($this->isColumnModified(entryPeer::SEARCH_TEXT)) $criteria->add(entryPeer::SEARCH_TEXT, $this->search_text);
  3612. if ($this->isColumnModified(entryPeer::SCREEN_NAME)) $criteria->add(entryPeer::SCREEN_NAME, $this->screen_name);
  3613. if ($this->isColumnModified(entryPeer::SITE_URL)) $criteria->add(entryPeer::SITE_URL, $this->site_url);
  3614. if ($this->isColumnModified(entryPeer::PERMISSIONS)) $criteria->add(entryPeer::PERMISSIONS, $this->permissions);
  3615. if ($this->isColumnModified(entryPeer::GROUP_ID)) $criteria->add(entryPeer::GROUP_ID, $this->group_id);
  3616. if ($this->isColumnModified(entryPeer::PLAYS)) $criteria->add(entryPeer::PLAYS, $this->plays);
  3617. if ($this->isColumnModified(entryPeer::PARTNER_DATA)) $criteria->add(entryPeer::PARTNER_DATA, $this->partner_data);
  3618. if ($this->isColumnModified(entryPeer::INT_ID)) $criteria->add(entryPeer::INT_ID, $this->int_id);
  3619. if ($this->isColumnModified(entryPeer::INDEXED_CUSTOM_DATA_1)) $criteria->add(entryPeer::INDEXED_CUSTOM_DATA_1, $this->indexed_custom_data_1);
  3620. if ($this->isColumnModified(entryPeer::DESCRIPTION)) $criteria->add(entryPeer::DESCRIPTION, $this->description);
  3621. if ($this->isColumnModified(entryPeer::MEDIA_DATE)) $criteria->add(entryPeer::MEDIA_DATE, $this->media_date);
  3622. if ($this->isColumnModified(entryPeer::ADMIN_TAGS)) $criteria->add(entryPeer::ADMIN_TAGS, $this->admin_tags);
  3623. if ($this->isColumnModified(entryPeer::MODERATION_STATUS)) $criteria->add(entryPeer::MODERATION_STATUS, $this->moderation_status);
  3624. if ($this->isColumnModified(entryPeer::MODERATION_COUNT)) $criteria->add(entryPeer::MODERATION_COUNT, $this->moderation_count);
  3625. if ($this->isColumnModified(entryPeer::MODIFIED_AT)) $criteria->add(entryPeer::MODIFIED_AT, $this->modified_at);
  3626. if ($this->isColumnModified(entryPeer::PUSER_ID)) $criteria->add(entryPeer::PUSER_ID, $this->puser_id);
  3627. if ($this->isColumnModified(entryPeer::ACCESS_CONTROL_ID)) $criteria->add(entryPeer::ACCESS_CONTROL_ID, $this->access_control_id);
  3628. if ($this->isColumnModified(entryPeer::CONVERSION_PROFILE_ID)) $criteria->add(entryPeer::CONVERSION_PROFILE_ID, $this->conversion_profile_id);
  3629. if ($this->isColumnModified(entryPeer::CATEGORIES)) $criteria->add(entryPeer::CATEGORIES, $this->categories);
  3630. if ($this->isColumnModified(entryPeer::CATEGORIES_IDS)) $criteria->add(entryPeer::CATEGORIES_IDS, $this->categories_ids);
  3631. if ($this->isColumnModified(entryPeer::START_DATE)) $criteria->add(entryPeer::START_DATE, $this->start_date);
  3632. if ($this->isColumnModified(entryPeer::END_DATE)) $criteria->add(entryPeer::END_DATE, $this->end_date);
  3633. if ($this->isColumnModified(entryPeer::SEARCH_TEXT_DISCRETE)) $criteria->add(entryPeer::SEARCH_TEXT_DISCRETE, $this->search_text_discrete);
  3634. if ($this->isColumnModified(entryPeer::FLAVOR_PARAMS_IDS)) $criteria->add(entryPeer::FLAVOR_PARAMS_IDS, $this->flavor_params_ids);
  3635. if ($this->isColumnModified(entryPeer::AVAILABLE_FROM)) $criteria->add(entryPeer::AVAILABLE_FROM, $this->available_from);
  3636. return $criteria;
  3637. }
  3638. /**
  3639. * Builds a Criteria object containing the primary key for this object.
  3640. *
  3641. * Unlike buildCriteria() this method includes the primary key values regardless
  3642. * of whether or not they have been modified.
  3643. *
  3644. * @return Criteria The Criteria object containing value(s) for primary key(s).
  3645. */
  3646. public function buildPkeyCriteria()
  3647. {
  3648. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  3649. $criteria->add(entryPeer::ID, $this->id);
  3650. if($this->alreadyInSave && count($this->modifiedColumns) == 2 and $this->isColumnModified(entryPeer::UPDATED_AT))
  3651. {
  3652. $theModifiedColumn = null;
  3653. foreach($this->modifiedColumns as $modifiedColumn)
  3654. if($modifiedColumn != entryPeer::UPDATED_AT)
  3655. $theModifiedColumn = $modifiedColumn;
  3656. $atomicColumns = entryPeer::getAtomicColumns();
  3657. if(in_array($theModifiedColumn, $atomicColumns))
  3658. $criteria->add($theModifiedColumn, $this->getByName($theModifiedColumn, BasePeer::TYPE_COLNAME), Criteria::NOT_EQUAL);
  3659. }
  3660. return $criteria;
  3661. }
  3662. /**
  3663. * Returns the primary key for this object (row).
  3664. * @return string
  3665. */
  3666. public function getPrimaryKey()
  3667. {
  3668. return $this->getId();
  3669. }
  3670. /**
  3671. * Generic method to set the primary key (id column).
  3672. *
  3673. * @param string $key Primary key.
  3674. * @return void
  3675. */
  3676. public function setPrimaryKey($key)
  3677. {
  3678. $this->setId($key);
  3679. }
  3680. /**
  3681. * Sets contents of passed object to values from current object.
  3682. *
  3683. * If desired, this method can also make copies of all associated (fkey referrers)
  3684. * objects.
  3685. *
  3686. * @param object $copyObj An object of entry (or compatible) type.
  3687. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  3688. * @throws PropelException
  3689. */
  3690. public function copyInto($copyObj, $deepCopy = false)
  3691. {
  3692. $copyObj->setId($this->id);
  3693. $copyObj->setKshowId($this->kshow_id);
  3694. $copyObj->setKuserId($this->kuser_id);
  3695. $copyObj->setName($this->name);
  3696. $copyObj->setType($this->type);
  3697. $copyObj->setMediaType($this->media_type);
  3698. $copyObj->setData($this->data);
  3699. $copyObj->setThumbnail($this->thumbnail);
  3700. $copyObj->setViews($this->views);
  3701. $copyObj->setVotes($this->votes);
  3702. $copyObj->setComments($this->comments);
  3703. $copyObj->setFavorites($this->favorites);
  3704. $copyObj->setTotalRank($this->total_rank);
  3705. $copyObj->setRank($this->rank);
  3706. $copyObj->setTags($this->tags);
  3707. $copyObj->setAnonymous($this->anonymous);
  3708. $copyObj->setStatus($this->status);
  3709. $copyObj->setSource($this->source);
  3710. $copyObj->setSourceId($this->source_id);
  3711. $copyObj->setSourceLink($this->source_link);
  3712. $copyObj->setLicenseType($this->license_type);
  3713. $copyObj->setCredit($this->credit);
  3714. $copyObj->setLengthInMsecs($this->length_in_msecs);
  3715. $copyObj->setCreatedAt($this->created_at);
  3716. $copyObj->setUpdatedAt($this->updated_at);
  3717. $copyObj->setPartnerId($this->partner_id);
  3718. $copyObj->setDisplayInSearch($this->display_in_search);
  3719. $copyObj->setSubpId($this->subp_id);
  3720. $copyObj->setCustomData($this->custom_data);
  3721. $copyObj->setSearchText($this->search_text);
  3722. $copyObj->setScreenName($this->screen_name);
  3723. $copyObj->setSiteUrl($this->site_url);
  3724. $copyObj->setPermissions($this->permissions);
  3725. $copyObj->setGroupId($this->group_id);
  3726. $copyObj->setPlays($this->plays);
  3727. $copyObj->setPartnerData($this->partner_data);
  3728. $copyObj->setIndexedCustomData1($this->indexed_custom_data_1);
  3729. $copyObj->setDescription($this->description);
  3730. $copyObj->setMediaDate($this->media_date);
  3731. $copyObj->setAdminTags($this->admin_tags);
  3732. $copyObj->setModerationStatus($this->moderation_status);
  3733. $copyObj->setModerationCount($this->moderation_count);
  3734. $copyObj->setModifiedAt($this->modified_at);
  3735. $copyObj->setPuserId($this->puser_id);
  3736. $copyObj->setAccessControlId($this->access_control_id);
  3737. $copyObj->setConversionProfileId($this->conversion_profile_id);
  3738. $copyObj->setCategories($this->categories);
  3739. $copyObj->setCategoriesIds($this->categories_ids);
  3740. $copyObj->setStartDate($this->start_date);
  3741. $copyObj->setEndDate($this->end_date);
  3742. $copyObj->setSearchTextDiscrete($this->search_text_discrete);
  3743. $copyObj->setFlavorParamsIds($this->flavor_params_ids);
  3744. $copyObj->setAvailableFrom($this->available_from);
  3745. if ($deepCopy) {
  3746. // important: temporarily setNew(false) because this affects the behavior of
  3747. // the getter/setter methods for fkey referrer objects.
  3748. $copyObj->setNew(false);
  3749. foreach ($this->getkvotes() as $relObj) {
  3750. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3751. $copyObj->addkvote($relObj->copy($deepCopy));
  3752. }
  3753. }
  3754. foreach ($this->getconversions() as $relObj) {
  3755. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3756. $copyObj->addconversion($relObj->copy($deepCopy));
  3757. }
  3758. }
  3759. foreach ($this->getWidgetLogs() as $relObj) {
  3760. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3761. $copyObj->addWidgetLog($relObj->copy($deepCopy));
  3762. }
  3763. }
  3764. foreach ($this->getmoderationFlags() as $relObj) {
  3765. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3766. $copyObj->addmoderationFlag($relObj->copy($deepCopy));
  3767. }
  3768. }
  3769. foreach ($this->getroughcutEntrysRelatedByRoughcutId() as $relObj) {
  3770. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3771. $copyObj->addroughcutEntryRelatedByRoughcutId($relObj->copy($deepCopy));
  3772. }
  3773. }
  3774. foreach ($this->getroughcutEntrysRelatedByEntryId() as $relObj) {
  3775. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3776. $copyObj->addroughcutEntryRelatedByEntryId($relObj->copy($deepCopy));
  3777. }
  3778. }
  3779. foreach ($this->getwidgets() as $relObj) {
  3780. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3781. $copyObj->addwidget($relObj->copy($deepCopy));
  3782. }
  3783. }
  3784. foreach ($this->getassetParamsOutputs() as $relObj) {
  3785. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3786. $copyObj->addassetParamsOutput($relObj->copy($deepCopy));
  3787. }
  3788. }
  3789. foreach ($this->getassets() as $relObj) {
  3790. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  3791. $copyObj->addasset($relObj->copy($deepCopy));
  3792. }
  3793. }
  3794. } // if ($deepCopy)
  3795. $copyObj->setNew(true);
  3796. $copyObj->setIntId(NULL); // this is a auto-increment column, so set to default value
  3797. }
  3798. /**
  3799. * Makes a copy of this object that will be inserted as a new row in table when saved.
  3800. * It creates a new object filling in the simple attributes, but skipping any primary
  3801. * keys that are defined for the table.
  3802. *
  3803. * If desired, this method can also make copies of all associated (fkey referrers)
  3804. * objects.
  3805. *
  3806. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  3807. * @return entry Clone of current object.
  3808. * @throws PropelException
  3809. */
  3810. public function copy($deepCopy = false)
  3811. {
  3812. // we use get_class(), because this might be a subclass
  3813. $clazz = get_class($this);
  3814. $copyObj = new $clazz();
  3815. $this->copyInto($copyObj, $deepCopy);
  3816. $copyObj->setCopiedFrom($this);
  3817. return $copyObj;
  3818. }
  3819. /**
  3820. * Stores the source object that this object copied from
  3821. *
  3822. * @var entry Clone of current object.
  3823. */
  3824. protected $copiedFrom = null;
  3825. /**
  3826. * Stores the source object that this object copied from
  3827. *
  3828. * @param entry $copiedFrom Clone of current object.
  3829. */
  3830. public function setCopiedFrom(entry $copiedFrom)
  3831. {
  3832. $this->copiedFrom = $copiedFrom;
  3833. }
  3834. /**
  3835. * Returns a peer instance associated with this om.
  3836. *
  3837. * Since Peer classes are not to have any instance attributes, this method returns the
  3838. * same instance for all member of this class. The method could therefore
  3839. * be static, but this would prevent one from overriding the behavior.
  3840. *
  3841. * @return entryPeer
  3842. */
  3843. public function getPeer()
  3844. {
  3845. if (self::$peer === null) {
  3846. self::$peer = new entryPeer();
  3847. }
  3848. return self::$peer;
  3849. }
  3850. /**
  3851. * Declares an association between this object and a kshow object.
  3852. *
  3853. * @param kshow $v
  3854. * @return entry The current object (for fluent API support)
  3855. * @throws PropelException
  3856. */
  3857. public function setkshow(kshow $v = null)
  3858. {
  3859. if ($v === null) {
  3860. $this->setKshowId(NULL);
  3861. } else {
  3862. $this->setKshowId($v->getId());
  3863. }
  3864. $this->akshow = $v;
  3865. // Add binding for other direction of this n:n relationship.
  3866. // If this object has already been added to the kshow object, it will not be re-added.
  3867. if ($v !== null) {
  3868. $v->addentry($this);
  3869. }
  3870. return $this;
  3871. }
  3872. /**
  3873. * Get the associated kshow object
  3874. *
  3875. * @param PropelPDO Optional Connection object.
  3876. * @return kshow The associated kshow object.
  3877. * @throws PropelException
  3878. */
  3879. public function getkshow(PropelPDO $con = null)
  3880. {
  3881. if ($this->akshow === null && (($this->kshow_id !== "" && $this->kshow_id !== null))) {
  3882. $this->akshow = kshowPeer::retrieveByPk($this->kshow_id);
  3883. /* The following can be used additionally to
  3884. guarantee the related object contains a reference
  3885. to this object. This level of coupling may, however, be
  3886. undesirable since it could result in an only partially populated collection
  3887. in the referenced object.
  3888. $this->akshow->addentrys($this);
  3889. */
  3890. }
  3891. return $this->akshow;
  3892. }
  3893. /**
  3894. * Declares an association between this object and a kuser object.
  3895. *
  3896. * @param kuser $v
  3897. * @return entry The current object (for fluent API support)
  3898. * @throws PropelException
  3899. */
  3900. public function setkuser(kuser $v = null)
  3901. {
  3902. if ($v === null) {
  3903. $this->setKuserId(NULL);
  3904. } else {
  3905. $this->setKuserId($v->getId());
  3906. }
  3907. $this->akuser = $v;
  3908. // Add binding for other direction of this n:n relationship.
  3909. // If this object has already been added to the kuser object, it will not be re-added.
  3910. if ($v !== null) {
  3911. $v->addentry($this);
  3912. }
  3913. return $this;
  3914. }
  3915. /**
  3916. * Get the associated kuser object
  3917. *
  3918. * @param PropelPDO Optional Connection object.
  3919. * @return kuser The associated kuser object.
  3920. * @throws PropelException
  3921. */
  3922. public function getkuser(PropelPDO $con = null)
  3923. {
  3924. if ($this->akuser === null && ($this->kuser_id !== null)) {
  3925. $this->akuser = kuserPeer::retrieveByPk($this->kuser_id);
  3926. /* The following can be used additionally to
  3927. guarantee the related object contains a reference
  3928. to this object. This level of coupling may, however, be
  3929. undesirable since it could result in an only partially populated collection
  3930. in the referenced object.
  3931. $this->akuser->addentrys($this);
  3932. */
  3933. }
  3934. return $this->akuser;
  3935. }
  3936. /**
  3937. * Declares an association between this object and a accessControl object.
  3938. *
  3939. * @param accessControl $v
  3940. * @return entry The current object (for fluent API support)
  3941. * @throws PropelException
  3942. */
  3943. public function setaccessControl(accessControl $v = null)
  3944. {
  3945. if ($v === null) {
  3946. $this->setAccessControlId(NULL);
  3947. } else {
  3948. $this->setAccessControlId($v->getId());
  3949. }
  3950. $this->aaccessControl = $v;
  3951. // Add binding for other direction of this n:n relationship.
  3952. // If this object has already been added to the accessControl object, it will not be re-added.
  3953. if ($v !== null) {
  3954. $v->addentry($this);
  3955. }
  3956. return $this;
  3957. }
  3958. /**
  3959. * Get the associated accessControl object
  3960. *
  3961. * @param PropelPDO Optional Connection object.
  3962. * @return accessControl The associated accessControl object.
  3963. * @throws PropelException
  3964. */
  3965. public function getaccessControl(PropelPDO $con = null)
  3966. {
  3967. if ($this->aaccessControl === null && ($this->access_control_id !== null)) {
  3968. $this->aaccessControl = accessControlPeer::retrieveByPk($this->access_control_id);
  3969. /* The following can be used additionally to
  3970. guarantee the related object contains a reference
  3971. to this object. This level of coupling may, however, be
  3972. undesirable since it could result in an only partially populated collection
  3973. in the referenced object.
  3974. $this->aaccessControl->addentrys($this);
  3975. */
  3976. }
  3977. return $this->aaccessControl;
  3978. }
  3979. /**
  3980. * Declares an association between this object and a conversionProfile2 object.
  3981. *
  3982. * @param conversionProfile2 $v
  3983. * @return entry The current object (for fluent API support)
  3984. * @throws PropelException
  3985. */
  3986. public function setconversionProfile2(conversionProfile2 $v = null)
  3987. {
  3988. if ($v === null) {
  3989. $this->setConversionProfileId(NULL);
  3990. } else {
  3991. $this->setConversionProfileId($v->getId());
  3992. }
  3993. $this->aconversionProfile2 = $v;
  3994. // Add binding for other direction of this n:n relationship.
  3995. // If this object has already been added to the conversionProfile2 object, it will not be re-added.
  3996. if ($v !== null) {
  3997. $v->addentry($this);
  3998. }
  3999. return $this;
  4000. }
  4001. /**
  4002. * Get the associated conversionProfile2 object
  4003. *
  4004. * @param PropelPDO Optional Connection object.
  4005. * @return conversionProfile2 The associated conversionProfile2 object.
  4006. * @throws PropelException
  4007. */
  4008. public function getconversionProfile2(PropelPDO $con = null)
  4009. {
  4010. if ($this->aconversionProfile2 === null && ($this->conversion_profile_id !== null)) {
  4011. $this->aconversionProfile2 = conversionProfile2Peer::retrieveByPk($this->conversion_profile_id);
  4012. /* The following can be used additionally to
  4013. guarantee the related object contains a reference
  4014. to this object. This level of coupling may, however, be
  4015. undesirable since it could result in an only partially populated collection
  4016. in the referenced object.
  4017. $this->aconversionProfile2->addentrys($this);
  4018. */
  4019. }
  4020. return $this->aconversionProfile2;
  4021. }
  4022. /**
  4023. * Clears out the collkvotes collection (array).
  4024. *
  4025. * This does not modify the database; however, it will remove any associated objects, causing
  4026. * them to be refetched by subsequent calls to accessor method.
  4027. *
  4028. * @return void
  4029. * @see addkvotes()
  4030. */
  4031. public function clearkvotes()
  4032. {
  4033. $this->collkvotes = null; // important to set this to NULL since that means it is uninitialized
  4034. }
  4035. /**
  4036. * Initializes the collkvotes collection (array).
  4037. *
  4038. * By default this just sets the collkvotes collection to an empty array (like clearcollkvotes());
  4039. * however, you may wish to override this method in your stub class to provide setting appropriate
  4040. * to your application -- for example, setting the initial array to the values stored in database.
  4041. *
  4042. * @return void
  4043. */
  4044. public function initkvotes()
  4045. {
  4046. $this->collkvotes = array();
  4047. }
  4048. /**
  4049. * Gets an array of kvote objects which contain a foreign key that references this object.
  4050. *
  4051. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4052. * Otherwise if this entry has previously been saved, it will retrieve
  4053. * related kvotes from storage. If this entry is new, it will return
  4054. * an empty collection or the current collection, the criteria is ignored on a new object.
  4055. *
  4056. * @param PropelPDO $con
  4057. * @param Criteria $criteria
  4058. * @return array kvote[]
  4059. * @throws PropelException
  4060. */
  4061. public function getkvotes($criteria = null, PropelPDO $con = null)
  4062. {
  4063. if ($criteria === null) {
  4064. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4065. }
  4066. elseif ($criteria instanceof Criteria)
  4067. {
  4068. $criteria = clone $criteria;
  4069. }
  4070. if ($this->collkvotes === null) {
  4071. if ($this->isNew()) {
  4072. $this->collkvotes = array();
  4073. } else {
  4074. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4075. kvotePeer::addSelectColumns($criteria);
  4076. $this->collkvotes = kvotePeer::doSelect($criteria, $con);
  4077. }
  4078. } else {
  4079. // criteria has no effect for a new object
  4080. if (!$this->isNew()) {
  4081. // the following code is to determine if a new query is
  4082. // called for. If the criteria is the same as the last
  4083. // one, just return the collection.
  4084. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4085. kvotePeer::addSelectColumns($criteria);
  4086. if (!isset($this->lastkvoteCriteria) || !$this->lastkvoteCriteria->equals($criteria)) {
  4087. $this->collkvotes = kvotePeer::doSelect($criteria, $con);
  4088. }
  4089. }
  4090. }
  4091. $this->lastkvoteCriteria = $criteria;
  4092. return $this->collkvotes;
  4093. }
  4094. /**
  4095. * Returns the number of related kvote objects.
  4096. *
  4097. * @param Criteria $criteria
  4098. * @param boolean $distinct
  4099. * @param PropelPDO $con
  4100. * @return int Count of related kvote objects.
  4101. * @throws PropelException
  4102. */
  4103. public function countkvotes(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4104. {
  4105. if ($criteria === null) {
  4106. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4107. } else {
  4108. $criteria = clone $criteria;
  4109. }
  4110. if ($distinct) {
  4111. $criteria->setDistinct();
  4112. }
  4113. $count = null;
  4114. if ($this->collkvotes === null) {
  4115. if ($this->isNew()) {
  4116. $count = 0;
  4117. } else {
  4118. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4119. $count = kvotePeer::doCount($criteria, false, $con);
  4120. }
  4121. } else {
  4122. // criteria has no effect for a new object
  4123. if (!$this->isNew()) {
  4124. // the following code is to determine if a new query is
  4125. // called for. If the criteria is the same as the last
  4126. // one, just return count of the collection.
  4127. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4128. if (!isset($this->lastkvoteCriteria) || !$this->lastkvoteCriteria->equals($criteria)) {
  4129. $count = kvotePeer::doCount($criteria, false, $con);
  4130. } else {
  4131. $count = count($this->collkvotes);
  4132. }
  4133. } else {
  4134. $count = count($this->collkvotes);
  4135. }
  4136. }
  4137. return $count;
  4138. }
  4139. /**
  4140. * Method called to associate a kvote object to this object
  4141. * through the kvote foreign key attribute.
  4142. *
  4143. * @param kvote $l kvote
  4144. * @return void
  4145. * @throws PropelException
  4146. */
  4147. public function addkvote(kvote $l)
  4148. {
  4149. if ($this->collkvotes === null) {
  4150. $this->initkvotes();
  4151. }
  4152. if (!in_array($l, $this->collkvotes, true)) { // only add it if the **same** object is not already associated
  4153. array_push($this->collkvotes, $l);
  4154. $l->setentry($this);
  4155. }
  4156. }
  4157. /**
  4158. * If this collection has already been initialized with
  4159. * an identical criteria, it returns the collection.
  4160. * Otherwise if this entry is new, it will return
  4161. * an empty collection; or if this entry has previously
  4162. * been saved, it will retrieve related kvotes from storage.
  4163. *
  4164. * This method is protected by default in order to keep the public
  4165. * api reasonable. You can provide public methods for those you
  4166. * actually need in entry.
  4167. */
  4168. public function getkvotesJoinkshowRelatedByKshowId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  4169. {
  4170. if ($criteria === null) {
  4171. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4172. }
  4173. elseif ($criteria instanceof Criteria)
  4174. {
  4175. $criteria = clone $criteria;
  4176. }
  4177. if ($this->collkvotes === null) {
  4178. if ($this->isNew()) {
  4179. $this->collkvotes = array();
  4180. } else {
  4181. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4182. $this->collkvotes = kvotePeer::doSelectJoinkshowRelatedByKshowId($criteria, $con, $join_behavior);
  4183. }
  4184. } else {
  4185. // the following code is to determine if a new query is
  4186. // called for. If the criteria is the same as the last
  4187. // one, just return the collection.
  4188. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4189. if (!isset($this->lastkvoteCriteria) || !$this->lastkvoteCriteria->equals($criteria)) {
  4190. $this->collkvotes = kvotePeer::doSelectJoinkshowRelatedByKshowId($criteria, $con, $join_behavior);
  4191. }
  4192. }
  4193. $this->lastkvoteCriteria = $criteria;
  4194. return $this->collkvotes;
  4195. }
  4196. /**
  4197. * If this collection has already been initialized with
  4198. * an identical criteria, it returns the collection.
  4199. * Otherwise if this entry is new, it will return
  4200. * an empty collection; or if this entry has previously
  4201. * been saved, it will retrieve related kvotes from storage.
  4202. *
  4203. * This method is protected by default in order to keep the public
  4204. * api reasonable. You can provide public methods for those you
  4205. * actually need in entry.
  4206. */
  4207. public function getkvotesJoinkshowRelatedByKuserId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  4208. {
  4209. if ($criteria === null) {
  4210. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4211. }
  4212. elseif ($criteria instanceof Criteria)
  4213. {
  4214. $criteria = clone $criteria;
  4215. }
  4216. if ($this->collkvotes === null) {
  4217. if ($this->isNew()) {
  4218. $this->collkvotes = array();
  4219. } else {
  4220. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4221. $this->collkvotes = kvotePeer::doSelectJoinkshowRelatedByKuserId($criteria, $con, $join_behavior);
  4222. }
  4223. } else {
  4224. // the following code is to determine if a new query is
  4225. // called for. If the criteria is the same as the last
  4226. // one, just return the collection.
  4227. $criteria->add(kvotePeer::ENTRY_ID, $this->id);
  4228. if (!isset($this->lastkvoteCriteria) || !$this->lastkvoteCriteria->equals($criteria)) {
  4229. $this->collkvotes = kvotePeer::doSelectJoinkshowRelatedByKuserId($criteria, $con, $join_behavior);
  4230. }
  4231. }
  4232. $this->lastkvoteCriteria = $criteria;
  4233. return $this->collkvotes;
  4234. }
  4235. /**
  4236. * Clears out the collconversions collection (array).
  4237. *
  4238. * This does not modify the database; however, it will remove any associated objects, causing
  4239. * them to be refetched by subsequent calls to accessor method.
  4240. *
  4241. * @return void
  4242. * @see addconversions()
  4243. */
  4244. public function clearconversions()
  4245. {
  4246. $this->collconversions = null; // important to set this to NULL since that means it is uninitialized
  4247. }
  4248. /**
  4249. * Initializes the collconversions collection (array).
  4250. *
  4251. * By default this just sets the collconversions collection to an empty array (like clearcollconversions());
  4252. * however, you may wish to override this method in your stub class to provide setting appropriate
  4253. * to your application -- for example, setting the initial array to the values stored in database.
  4254. *
  4255. * @return void
  4256. */
  4257. public function initconversions()
  4258. {
  4259. $this->collconversions = array();
  4260. }
  4261. /**
  4262. * Gets an array of conversion objects which contain a foreign key that references this object.
  4263. *
  4264. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4265. * Otherwise if this entry has previously been saved, it will retrieve
  4266. * related conversions from storage. If this entry is new, it will return
  4267. * an empty collection or the current collection, the criteria is ignored on a new object.
  4268. *
  4269. * @param PropelPDO $con
  4270. * @param Criteria $criteria
  4271. * @return array conversion[]
  4272. * @throws PropelException
  4273. */
  4274. public function getconversions($criteria = null, PropelPDO $con = null)
  4275. {
  4276. if ($criteria === null) {
  4277. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4278. }
  4279. elseif ($criteria instanceof Criteria)
  4280. {
  4281. $criteria = clone $criteria;
  4282. }
  4283. if ($this->collconversions === null) {
  4284. if ($this->isNew()) {
  4285. $this->collconversions = array();
  4286. } else {
  4287. $criteria->add(conversionPeer::ENTRY_ID, $this->id);
  4288. conversionPeer::addSelectColumns($criteria);
  4289. $this->collconversions = conversionPeer::doSelect($criteria, $con);
  4290. }
  4291. } else {
  4292. // criteria has no effect for a new object
  4293. if (!$this->isNew()) {
  4294. // the following code is to determine if a new query is
  4295. // called for. If the criteria is the same as the last
  4296. // one, just return the collection.
  4297. $criteria->add(conversionPeer::ENTRY_ID, $this->id);
  4298. conversionPeer::addSelectColumns($criteria);
  4299. if (!isset($this->lastconversionCriteria) || !$this->lastconversionCriteria->equals($criteria)) {
  4300. $this->collconversions = conversionPeer::doSelect($criteria, $con);
  4301. }
  4302. }
  4303. }
  4304. $this->lastconversionCriteria = $criteria;
  4305. return $this->collconversions;
  4306. }
  4307. /**
  4308. * Returns the number of related conversion objects.
  4309. *
  4310. * @param Criteria $criteria
  4311. * @param boolean $distinct
  4312. * @param PropelPDO $con
  4313. * @return int Count of related conversion objects.
  4314. * @throws PropelException
  4315. */
  4316. public function countconversions(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4317. {
  4318. if ($criteria === null) {
  4319. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4320. } else {
  4321. $criteria = clone $criteria;
  4322. }
  4323. if ($distinct) {
  4324. $criteria->setDistinct();
  4325. }
  4326. $count = null;
  4327. if ($this->collconversions === null) {
  4328. if ($this->isNew()) {
  4329. $count = 0;
  4330. } else {
  4331. $criteria->add(conversionPeer::ENTRY_ID, $this->id);
  4332. $count = conversionPeer::doCount($criteria, false, $con);
  4333. }
  4334. } else {
  4335. // criteria has no effect for a new object
  4336. if (!$this->isNew()) {
  4337. // the following code is to determine if a new query is
  4338. // called for. If the criteria is the same as the last
  4339. // one, just return count of the collection.
  4340. $criteria->add(conversionPeer::ENTRY_ID, $this->id);
  4341. if (!isset($this->lastconversionCriteria) || !$this->lastconversionCriteria->equals($criteria)) {
  4342. $count = conversionPeer::doCount($criteria, false, $con);
  4343. } else {
  4344. $count = count($this->collconversions);
  4345. }
  4346. } else {
  4347. $count = count($this->collconversions);
  4348. }
  4349. }
  4350. return $count;
  4351. }
  4352. /**
  4353. * Method called to associate a conversion object to this object
  4354. * through the conversion foreign key attribute.
  4355. *
  4356. * @param conversion $l conversion
  4357. * @return void
  4358. * @throws PropelException
  4359. */
  4360. public function addconversion(conversion $l)
  4361. {
  4362. if ($this->collconversions === null) {
  4363. $this->initconversions();
  4364. }
  4365. if (!in_array($l, $this->collconversions, true)) { // only add it if the **same** object is not already associated
  4366. array_push($this->collconversions, $l);
  4367. $l->setentry($this);
  4368. }
  4369. }
  4370. /**
  4371. * Clears out the collWidgetLogs collection (array).
  4372. *
  4373. * This does not modify the database; however, it will remove any associated objects, causing
  4374. * them to be refetched by subsequent calls to accessor method.
  4375. *
  4376. * @return void
  4377. * @see addWidgetLogs()
  4378. */
  4379. public function clearWidgetLogs()
  4380. {
  4381. $this->collWidgetLogs = null; // important to set this to NULL since that means it is uninitialized
  4382. }
  4383. /**
  4384. * Initializes the collWidgetLogs collection (array).
  4385. *
  4386. * By default this just sets the collWidgetLogs collection to an empty array (like clearcollWidgetLogs());
  4387. * however, you may wish to override this method in your stub class to provide setting appropriate
  4388. * to your application -- for example, setting the initial array to the values stored in database.
  4389. *
  4390. * @return void
  4391. */
  4392. public function initWidgetLogs()
  4393. {
  4394. $this->collWidgetLogs = array();
  4395. }
  4396. /**
  4397. * Gets an array of WidgetLog objects which contain a foreign key that references this object.
  4398. *
  4399. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4400. * Otherwise if this entry has previously been saved, it will retrieve
  4401. * related WidgetLogs from storage. If this entry is new, it will return
  4402. * an empty collection or the current collection, the criteria is ignored on a new object.
  4403. *
  4404. * @param PropelPDO $con
  4405. * @param Criteria $criteria
  4406. * @return array WidgetLog[]
  4407. * @throws PropelException
  4408. */
  4409. public function getWidgetLogs($criteria = null, PropelPDO $con = null)
  4410. {
  4411. if ($criteria === null) {
  4412. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4413. }
  4414. elseif ($criteria instanceof Criteria)
  4415. {
  4416. $criteria = clone $criteria;
  4417. }
  4418. if ($this->collWidgetLogs === null) {
  4419. if ($this->isNew()) {
  4420. $this->collWidgetLogs = array();
  4421. } else {
  4422. $criteria->add(WidgetLogPeer::ENTRY_ID, $this->id);
  4423. WidgetLogPeer::addSelectColumns($criteria);
  4424. $this->collWidgetLogs = WidgetLogPeer::doSelect($criteria, $con);
  4425. }
  4426. } else {
  4427. // criteria has no effect for a new object
  4428. if (!$this->isNew()) {
  4429. // the following code is to determine if a new query is
  4430. // called for. If the criteria is the same as the last
  4431. // one, just return the collection.
  4432. $criteria->add(WidgetLogPeer::ENTRY_ID, $this->id);
  4433. WidgetLogPeer::addSelectColumns($criteria);
  4434. if (!isset($this->lastWidgetLogCriteria) || !$this->lastWidgetLogCriteria->equals($criteria)) {
  4435. $this->collWidgetLogs = WidgetLogPeer::doSelect($criteria, $con);
  4436. }
  4437. }
  4438. }
  4439. $this->lastWidgetLogCriteria = $criteria;
  4440. return $this->collWidgetLogs;
  4441. }
  4442. /**
  4443. * Returns the number of related WidgetLog objects.
  4444. *
  4445. * @param Criteria $criteria
  4446. * @param boolean $distinct
  4447. * @param PropelPDO $con
  4448. * @return int Count of related WidgetLog objects.
  4449. * @throws PropelException
  4450. */
  4451. public function countWidgetLogs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4452. {
  4453. if ($criteria === null) {
  4454. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4455. } else {
  4456. $criteria = clone $criteria;
  4457. }
  4458. if ($distinct) {
  4459. $criteria->setDistinct();
  4460. }
  4461. $count = null;
  4462. if ($this->collWidgetLogs === null) {
  4463. if ($this->isNew()) {
  4464. $count = 0;
  4465. } else {
  4466. $criteria->add(WidgetLogPeer::ENTRY_ID, $this->id);
  4467. $count = WidgetLogPeer::doCount($criteria, false, $con);
  4468. }
  4469. } else {
  4470. // criteria has no effect for a new object
  4471. if (!$this->isNew()) {
  4472. // the following code is to determine if a new query is
  4473. // called for. If the criteria is the same as the last
  4474. // one, just return count of the collection.
  4475. $criteria->add(WidgetLogPeer::ENTRY_ID, $this->id);
  4476. if (!isset($this->lastWidgetLogCriteria) || !$this->lastWidgetLogCriteria->equals($criteria)) {
  4477. $count = WidgetLogPeer::doCount($criteria, false, $con);
  4478. } else {
  4479. $count = count($this->collWidgetLogs);
  4480. }
  4481. } else {
  4482. $count = count($this->collWidgetLogs);
  4483. }
  4484. }
  4485. return $count;
  4486. }
  4487. /**
  4488. * Method called to associate a WidgetLog object to this object
  4489. * through the WidgetLog foreign key attribute.
  4490. *
  4491. * @param WidgetLog $l WidgetLog
  4492. * @return void
  4493. * @throws PropelException
  4494. */
  4495. public function addWidgetLog(WidgetLog $l)
  4496. {
  4497. if ($this->collWidgetLogs === null) {
  4498. $this->initWidgetLogs();
  4499. }
  4500. if (!in_array($l, $this->collWidgetLogs, true)) { // only add it if the **same** object is not already associated
  4501. array_push($this->collWidgetLogs, $l);
  4502. $l->setentry($this);
  4503. }
  4504. }
  4505. /**
  4506. * Clears out the collmoderationFlags collection (array).
  4507. *
  4508. * This does not modify the database; however, it will remove any associated objects, causing
  4509. * them to be refetched by subsequent calls to accessor method.
  4510. *
  4511. * @return void
  4512. * @see addmoderationFlags()
  4513. */
  4514. public function clearmoderationFlags()
  4515. {
  4516. $this->collmoderationFlags = null; // important to set this to NULL since that means it is uninitialized
  4517. }
  4518. /**
  4519. * Initializes the collmoderationFlags collection (array).
  4520. *
  4521. * By default this just sets the collmoderationFlags collection to an empty array (like clearcollmoderationFlags());
  4522. * however, you may wish to override this method in your stub class to provide setting appropriate
  4523. * to your application -- for example, setting the initial array to the values stored in database.
  4524. *
  4525. * @return void
  4526. */
  4527. public function initmoderationFlags()
  4528. {
  4529. $this->collmoderationFlags = array();
  4530. }
  4531. /**
  4532. * Gets an array of moderationFlag objects which contain a foreign key that references this object.
  4533. *
  4534. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4535. * Otherwise if this entry has previously been saved, it will retrieve
  4536. * related moderationFlags from storage. If this entry is new, it will return
  4537. * an empty collection or the current collection, the criteria is ignored on a new object.
  4538. *
  4539. * @param PropelPDO $con
  4540. * @param Criteria $criteria
  4541. * @return array moderationFlag[]
  4542. * @throws PropelException
  4543. */
  4544. public function getmoderationFlags($criteria = null, PropelPDO $con = null)
  4545. {
  4546. if ($criteria === null) {
  4547. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4548. }
  4549. elseif ($criteria instanceof Criteria)
  4550. {
  4551. $criteria = clone $criteria;
  4552. }
  4553. if ($this->collmoderationFlags === null) {
  4554. if ($this->isNew()) {
  4555. $this->collmoderationFlags = array();
  4556. } else {
  4557. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4558. moderationFlagPeer::addSelectColumns($criteria);
  4559. $this->collmoderationFlags = moderationFlagPeer::doSelect($criteria, $con);
  4560. }
  4561. } else {
  4562. // criteria has no effect for a new object
  4563. if (!$this->isNew()) {
  4564. // the following code is to determine if a new query is
  4565. // called for. If the criteria is the same as the last
  4566. // one, just return the collection.
  4567. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4568. moderationFlagPeer::addSelectColumns($criteria);
  4569. if (!isset($this->lastmoderationFlagCriteria) || !$this->lastmoderationFlagCriteria->equals($criteria)) {
  4570. $this->collmoderationFlags = moderationFlagPeer::doSelect($criteria, $con);
  4571. }
  4572. }
  4573. }
  4574. $this->lastmoderationFlagCriteria = $criteria;
  4575. return $this->collmoderationFlags;
  4576. }
  4577. /**
  4578. * Returns the number of related moderationFlag objects.
  4579. *
  4580. * @param Criteria $criteria
  4581. * @param boolean $distinct
  4582. * @param PropelPDO $con
  4583. * @return int Count of related moderationFlag objects.
  4584. * @throws PropelException
  4585. */
  4586. public function countmoderationFlags(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4587. {
  4588. if ($criteria === null) {
  4589. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4590. } else {
  4591. $criteria = clone $criteria;
  4592. }
  4593. if ($distinct) {
  4594. $criteria->setDistinct();
  4595. }
  4596. $count = null;
  4597. if ($this->collmoderationFlags === null) {
  4598. if ($this->isNew()) {
  4599. $count = 0;
  4600. } else {
  4601. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4602. $count = moderationFlagPeer::doCount($criteria, false, $con);
  4603. }
  4604. } else {
  4605. // criteria has no effect for a new object
  4606. if (!$this->isNew()) {
  4607. // the following code is to determine if a new query is
  4608. // called for. If the criteria is the same as the last
  4609. // one, just return count of the collection.
  4610. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4611. if (!isset($this->lastmoderationFlagCriteria) || !$this->lastmoderationFlagCriteria->equals($criteria)) {
  4612. $count = moderationFlagPeer::doCount($criteria, false, $con);
  4613. } else {
  4614. $count = count($this->collmoderationFlags);
  4615. }
  4616. } else {
  4617. $count = count($this->collmoderationFlags);
  4618. }
  4619. }
  4620. return $count;
  4621. }
  4622. /**
  4623. * Method called to associate a moderationFlag object to this object
  4624. * through the moderationFlag foreign key attribute.
  4625. *
  4626. * @param moderationFlag $l moderationFlag
  4627. * @return void
  4628. * @throws PropelException
  4629. */
  4630. public function addmoderationFlag(moderationFlag $l)
  4631. {
  4632. if ($this->collmoderationFlags === null) {
  4633. $this->initmoderationFlags();
  4634. }
  4635. if (!in_array($l, $this->collmoderationFlags, true)) { // only add it if the **same** object is not already associated
  4636. array_push($this->collmoderationFlags, $l);
  4637. $l->setentry($this);
  4638. }
  4639. }
  4640. /**
  4641. * If this collection has already been initialized with
  4642. * an identical criteria, it returns the collection.
  4643. * Otherwise if this entry is new, it will return
  4644. * an empty collection; or if this entry has previously
  4645. * been saved, it will retrieve related moderationFlags from storage.
  4646. *
  4647. * This method is protected by default in order to keep the public
  4648. * api reasonable. You can provide public methods for those you
  4649. * actually need in entry.
  4650. */
  4651. public function getmoderationFlagsJoinkuserRelatedByKuserId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  4652. {
  4653. if ($criteria === null) {
  4654. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4655. }
  4656. elseif ($criteria instanceof Criteria)
  4657. {
  4658. $criteria = clone $criteria;
  4659. }
  4660. if ($this->collmoderationFlags === null) {
  4661. if ($this->isNew()) {
  4662. $this->collmoderationFlags = array();
  4663. } else {
  4664. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4665. $this->collmoderationFlags = moderationFlagPeer::doSelectJoinkuserRelatedByKuserId($criteria, $con, $join_behavior);
  4666. }
  4667. } else {
  4668. // the following code is to determine if a new query is
  4669. // called for. If the criteria is the same as the last
  4670. // one, just return the collection.
  4671. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4672. if (!isset($this->lastmoderationFlagCriteria) || !$this->lastmoderationFlagCriteria->equals($criteria)) {
  4673. $this->collmoderationFlags = moderationFlagPeer::doSelectJoinkuserRelatedByKuserId($criteria, $con, $join_behavior);
  4674. }
  4675. }
  4676. $this->lastmoderationFlagCriteria = $criteria;
  4677. return $this->collmoderationFlags;
  4678. }
  4679. /**
  4680. * If this collection has already been initialized with
  4681. * an identical criteria, it returns the collection.
  4682. * Otherwise if this entry is new, it will return
  4683. * an empty collection; or if this entry has previously
  4684. * been saved, it will retrieve related moderationFlags from storage.
  4685. *
  4686. * This method is protected by default in order to keep the public
  4687. * api reasonable. You can provide public methods for those you
  4688. * actually need in entry.
  4689. */
  4690. public function getmoderationFlagsJoinkuserRelatedByFlaggedKuserId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  4691. {
  4692. if ($criteria === null) {
  4693. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4694. }
  4695. elseif ($criteria instanceof Criteria)
  4696. {
  4697. $criteria = clone $criteria;
  4698. }
  4699. if ($this->collmoderationFlags === null) {
  4700. if ($this->isNew()) {
  4701. $this->collmoderationFlags = array();
  4702. } else {
  4703. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4704. $this->collmoderationFlags = moderationFlagPeer::doSelectJoinkuserRelatedByFlaggedKuserId($criteria, $con, $join_behavior);
  4705. }
  4706. } else {
  4707. // the following code is to determine if a new query is
  4708. // called for. If the criteria is the same as the last
  4709. // one, just return the collection.
  4710. $criteria->add(moderationFlagPeer::FLAGGED_ENTRY_ID, $this->id);
  4711. if (!isset($this->lastmoderationFlagCriteria) || !$this->lastmoderationFlagCriteria->equals($criteria)) {
  4712. $this->collmoderationFlags = moderationFlagPeer::doSelectJoinkuserRelatedByFlaggedKuserId($criteria, $con, $join_behavior);
  4713. }
  4714. }
  4715. $this->lastmoderationFlagCriteria = $criteria;
  4716. return $this->collmoderationFlags;
  4717. }
  4718. /**
  4719. * Clears out the collroughcutEntrysRelatedByRoughcutId collection (array).
  4720. *
  4721. * This does not modify the database; however, it will remove any associated objects, causing
  4722. * them to be refetched by subsequent calls to accessor method.
  4723. *
  4724. * @return void
  4725. * @see addroughcutEntrysRelatedByRoughcutId()
  4726. */
  4727. public function clearroughcutEntrysRelatedByRoughcutId()
  4728. {
  4729. $this->collroughcutEntrysRelatedByRoughcutId = null; // important to set this to NULL since that means it is uninitialized
  4730. }
  4731. /**
  4732. * Initializes the collroughcutEntrysRelatedByRoughcutId collection (array).
  4733. *
  4734. * By default this just sets the collroughcutEntrysRelatedByRoughcutId collection to an empty array (like clearcollroughcutEntrysRelatedByRoughcutId());
  4735. * however, you may wish to override this method in your stub class to provide setting appropriate
  4736. * to your application -- for example, setting the initial array to the values stored in database.
  4737. *
  4738. * @return void
  4739. */
  4740. public function initroughcutEntrysRelatedByRoughcutId()
  4741. {
  4742. $this->collroughcutEntrysRelatedByRoughcutId = array();
  4743. }
  4744. /**
  4745. * Gets an array of roughcutEntry objects which contain a foreign key that references this object.
  4746. *
  4747. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4748. * Otherwise if this entry has previously been saved, it will retrieve
  4749. * related roughcutEntrysRelatedByRoughcutId from storage. If this entry is new, it will return
  4750. * an empty collection or the current collection, the criteria is ignored on a new object.
  4751. *
  4752. * @param PropelPDO $con
  4753. * @param Criteria $criteria
  4754. * @return array roughcutEntry[]
  4755. * @throws PropelException
  4756. */
  4757. public function getroughcutEntrysRelatedByRoughcutId($criteria = null, PropelPDO $con = null)
  4758. {
  4759. if ($criteria === null) {
  4760. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4761. }
  4762. elseif ($criteria instanceof Criteria)
  4763. {
  4764. $criteria = clone $criteria;
  4765. }
  4766. if ($this->collroughcutEntrysRelatedByRoughcutId === null) {
  4767. if ($this->isNew()) {
  4768. $this->collroughcutEntrysRelatedByRoughcutId = array();
  4769. } else {
  4770. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4771. roughcutEntryPeer::addSelectColumns($criteria);
  4772. $this->collroughcutEntrysRelatedByRoughcutId = roughcutEntryPeer::doSelect($criteria, $con);
  4773. }
  4774. } else {
  4775. // criteria has no effect for a new object
  4776. if (!$this->isNew()) {
  4777. // the following code is to determine if a new query is
  4778. // called for. If the criteria is the same as the last
  4779. // one, just return the collection.
  4780. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4781. roughcutEntryPeer::addSelectColumns($criteria);
  4782. if (!isset($this->lastroughcutEntryRelatedByRoughcutIdCriteria) || !$this->lastroughcutEntryRelatedByRoughcutIdCriteria->equals($criteria)) {
  4783. $this->collroughcutEntrysRelatedByRoughcutId = roughcutEntryPeer::doSelect($criteria, $con);
  4784. }
  4785. }
  4786. }
  4787. $this->lastroughcutEntryRelatedByRoughcutIdCriteria = $criteria;
  4788. return $this->collroughcutEntrysRelatedByRoughcutId;
  4789. }
  4790. /**
  4791. * Returns the number of related roughcutEntry objects.
  4792. *
  4793. * @param Criteria $criteria
  4794. * @param boolean $distinct
  4795. * @param PropelPDO $con
  4796. * @return int Count of related roughcutEntry objects.
  4797. * @throws PropelException
  4798. */
  4799. public function countroughcutEntrysRelatedByRoughcutId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4800. {
  4801. if ($criteria === null) {
  4802. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4803. } else {
  4804. $criteria = clone $criteria;
  4805. }
  4806. if ($distinct) {
  4807. $criteria->setDistinct();
  4808. }
  4809. $count = null;
  4810. if ($this->collroughcutEntrysRelatedByRoughcutId === null) {
  4811. if ($this->isNew()) {
  4812. $count = 0;
  4813. } else {
  4814. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4815. $count = roughcutEntryPeer::doCount($criteria, false, $con);
  4816. }
  4817. } else {
  4818. // criteria has no effect for a new object
  4819. if (!$this->isNew()) {
  4820. // the following code is to determine if a new query is
  4821. // called for. If the criteria is the same as the last
  4822. // one, just return count of the collection.
  4823. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4824. if (!isset($this->lastroughcutEntryRelatedByRoughcutIdCriteria) || !$this->lastroughcutEntryRelatedByRoughcutIdCriteria->equals($criteria)) {
  4825. $count = roughcutEntryPeer::doCount($criteria, false, $con);
  4826. } else {
  4827. $count = count($this->collroughcutEntrysRelatedByRoughcutId);
  4828. }
  4829. } else {
  4830. $count = count($this->collroughcutEntrysRelatedByRoughcutId);
  4831. }
  4832. }
  4833. return $count;
  4834. }
  4835. /**
  4836. * Method called to associate a roughcutEntry object to this object
  4837. * through the roughcutEntry foreign key attribute.
  4838. *
  4839. * @param roughcutEntry $l roughcutEntry
  4840. * @return void
  4841. * @throws PropelException
  4842. */
  4843. public function addroughcutEntryRelatedByRoughcutId(roughcutEntry $l)
  4844. {
  4845. if ($this->collroughcutEntrysRelatedByRoughcutId === null) {
  4846. $this->initroughcutEntrysRelatedByRoughcutId();
  4847. }
  4848. if (!in_array($l, $this->collroughcutEntrysRelatedByRoughcutId, true)) { // only add it if the **same** object is not already associated
  4849. array_push($this->collroughcutEntrysRelatedByRoughcutId, $l);
  4850. $l->setentryRelatedByRoughcutId($this);
  4851. }
  4852. }
  4853. /**
  4854. * If this collection has already been initialized with
  4855. * an identical criteria, it returns the collection.
  4856. * Otherwise if this entry is new, it will return
  4857. * an empty collection; or if this entry has previously
  4858. * been saved, it will retrieve related roughcutEntrysRelatedByRoughcutId from storage.
  4859. *
  4860. * This method is protected by default in order to keep the public
  4861. * api reasonable. You can provide public methods for those you
  4862. * actually need in entry.
  4863. */
  4864. public function getroughcutEntrysRelatedByRoughcutIdJoinkshow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  4865. {
  4866. if ($criteria === null) {
  4867. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4868. }
  4869. elseif ($criteria instanceof Criteria)
  4870. {
  4871. $criteria = clone $criteria;
  4872. }
  4873. if ($this->collroughcutEntrysRelatedByRoughcutId === null) {
  4874. if ($this->isNew()) {
  4875. $this->collroughcutEntrysRelatedByRoughcutId = array();
  4876. } else {
  4877. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4878. $this->collroughcutEntrysRelatedByRoughcutId = roughcutEntryPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  4879. }
  4880. } else {
  4881. // the following code is to determine if a new query is
  4882. // called for. If the criteria is the same as the last
  4883. // one, just return the collection.
  4884. $criteria->add(roughcutEntryPeer::ROUGHCUT_ID, $this->id);
  4885. if (!isset($this->lastroughcutEntryRelatedByRoughcutIdCriteria) || !$this->lastroughcutEntryRelatedByRoughcutIdCriteria->equals($criteria)) {
  4886. $this->collroughcutEntrysRelatedByRoughcutId = roughcutEntryPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  4887. }
  4888. }
  4889. $this->lastroughcutEntryRelatedByRoughcutIdCriteria = $criteria;
  4890. return $this->collroughcutEntrysRelatedByRoughcutId;
  4891. }
  4892. /**
  4893. * Clears out the collroughcutEntrysRelatedByEntryId collection (array).
  4894. *
  4895. * This does not modify the database; however, it will remove any associated objects, causing
  4896. * them to be refetched by subsequent calls to accessor method.
  4897. *
  4898. * @return void
  4899. * @see addroughcutEntrysRelatedByEntryId()
  4900. */
  4901. public function clearroughcutEntrysRelatedByEntryId()
  4902. {
  4903. $this->collroughcutEntrysRelatedByEntryId = null; // important to set this to NULL since that means it is uninitialized
  4904. }
  4905. /**
  4906. * Initializes the collroughcutEntrysRelatedByEntryId collection (array).
  4907. *
  4908. * By default this just sets the collroughcutEntrysRelatedByEntryId collection to an empty array (like clearcollroughcutEntrysRelatedByEntryId());
  4909. * however, you may wish to override this method in your stub class to provide setting appropriate
  4910. * to your application -- for example, setting the initial array to the values stored in database.
  4911. *
  4912. * @return void
  4913. */
  4914. public function initroughcutEntrysRelatedByEntryId()
  4915. {
  4916. $this->collroughcutEntrysRelatedByEntryId = array();
  4917. }
  4918. /**
  4919. * Gets an array of roughcutEntry objects which contain a foreign key that references this object.
  4920. *
  4921. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  4922. * Otherwise if this entry has previously been saved, it will retrieve
  4923. * related roughcutEntrysRelatedByEntryId from storage. If this entry is new, it will return
  4924. * an empty collection or the current collection, the criteria is ignored on a new object.
  4925. *
  4926. * @param PropelPDO $con
  4927. * @param Criteria $criteria
  4928. * @return array roughcutEntry[]
  4929. * @throws PropelException
  4930. */
  4931. public function getroughcutEntrysRelatedByEntryId($criteria = null, PropelPDO $con = null)
  4932. {
  4933. if ($criteria === null) {
  4934. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4935. }
  4936. elseif ($criteria instanceof Criteria)
  4937. {
  4938. $criteria = clone $criteria;
  4939. }
  4940. if ($this->collroughcutEntrysRelatedByEntryId === null) {
  4941. if ($this->isNew()) {
  4942. $this->collroughcutEntrysRelatedByEntryId = array();
  4943. } else {
  4944. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  4945. roughcutEntryPeer::addSelectColumns($criteria);
  4946. $this->collroughcutEntrysRelatedByEntryId = roughcutEntryPeer::doSelect($criteria, $con);
  4947. }
  4948. } else {
  4949. // criteria has no effect for a new object
  4950. if (!$this->isNew()) {
  4951. // the following code is to determine if a new query is
  4952. // called for. If the criteria is the same as the last
  4953. // one, just return the collection.
  4954. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  4955. roughcutEntryPeer::addSelectColumns($criteria);
  4956. if (!isset($this->lastroughcutEntryRelatedByEntryIdCriteria) || !$this->lastroughcutEntryRelatedByEntryIdCriteria->equals($criteria)) {
  4957. $this->collroughcutEntrysRelatedByEntryId = roughcutEntryPeer::doSelect($criteria, $con);
  4958. }
  4959. }
  4960. }
  4961. $this->lastroughcutEntryRelatedByEntryIdCriteria = $criteria;
  4962. return $this->collroughcutEntrysRelatedByEntryId;
  4963. }
  4964. /**
  4965. * Returns the number of related roughcutEntry objects.
  4966. *
  4967. * @param Criteria $criteria
  4968. * @param boolean $distinct
  4969. * @param PropelPDO $con
  4970. * @return int Count of related roughcutEntry objects.
  4971. * @throws PropelException
  4972. */
  4973. public function countroughcutEntrysRelatedByEntryId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  4974. {
  4975. if ($criteria === null) {
  4976. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  4977. } else {
  4978. $criteria = clone $criteria;
  4979. }
  4980. if ($distinct) {
  4981. $criteria->setDistinct();
  4982. }
  4983. $count = null;
  4984. if ($this->collroughcutEntrysRelatedByEntryId === null) {
  4985. if ($this->isNew()) {
  4986. $count = 0;
  4987. } else {
  4988. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  4989. $count = roughcutEntryPeer::doCount($criteria, false, $con);
  4990. }
  4991. } else {
  4992. // criteria has no effect for a new object
  4993. if (!$this->isNew()) {
  4994. // the following code is to determine if a new query is
  4995. // called for. If the criteria is the same as the last
  4996. // one, just return count of the collection.
  4997. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  4998. if (!isset($this->lastroughcutEntryRelatedByEntryIdCriteria) || !$this->lastroughcutEntryRelatedByEntryIdCriteria->equals($criteria)) {
  4999. $count = roughcutEntryPeer::doCount($criteria, false, $con);
  5000. } else {
  5001. $count = count($this->collroughcutEntrysRelatedByEntryId);
  5002. }
  5003. } else {
  5004. $count = count($this->collroughcutEntrysRelatedByEntryId);
  5005. }
  5006. }
  5007. return $count;
  5008. }
  5009. /**
  5010. * Method called to associate a roughcutEntry object to this object
  5011. * through the roughcutEntry foreign key attribute.
  5012. *
  5013. * @param roughcutEntry $l roughcutEntry
  5014. * @return void
  5015. * @throws PropelException
  5016. */
  5017. public function addroughcutEntryRelatedByEntryId(roughcutEntry $l)
  5018. {
  5019. if ($this->collroughcutEntrysRelatedByEntryId === null) {
  5020. $this->initroughcutEntrysRelatedByEntryId();
  5021. }
  5022. if (!in_array($l, $this->collroughcutEntrysRelatedByEntryId, true)) { // only add it if the **same** object is not already associated
  5023. array_push($this->collroughcutEntrysRelatedByEntryId, $l);
  5024. $l->setentryRelatedByEntryId($this);
  5025. }
  5026. }
  5027. /**
  5028. * If this collection has already been initialized with
  5029. * an identical criteria, it returns the collection.
  5030. * Otherwise if this entry is new, it will return
  5031. * an empty collection; or if this entry has previously
  5032. * been saved, it will retrieve related roughcutEntrysRelatedByEntryId from storage.
  5033. *
  5034. * This method is protected by default in order to keep the public
  5035. * api reasonable. You can provide public methods for those you
  5036. * actually need in entry.
  5037. */
  5038. public function getroughcutEntrysRelatedByEntryIdJoinkshow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5039. {
  5040. if ($criteria === null) {
  5041. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5042. }
  5043. elseif ($criteria instanceof Criteria)
  5044. {
  5045. $criteria = clone $criteria;
  5046. }
  5047. if ($this->collroughcutEntrysRelatedByEntryId === null) {
  5048. if ($this->isNew()) {
  5049. $this->collroughcutEntrysRelatedByEntryId = array();
  5050. } else {
  5051. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  5052. $this->collroughcutEntrysRelatedByEntryId = roughcutEntryPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  5053. }
  5054. } else {
  5055. // the following code is to determine if a new query is
  5056. // called for. If the criteria is the same as the last
  5057. // one, just return the collection.
  5058. $criteria->add(roughcutEntryPeer::ENTRY_ID, $this->id);
  5059. if (!isset($this->lastroughcutEntryRelatedByEntryIdCriteria) || !$this->lastroughcutEntryRelatedByEntryIdCriteria->equals($criteria)) {
  5060. $this->collroughcutEntrysRelatedByEntryId = roughcutEntryPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  5061. }
  5062. }
  5063. $this->lastroughcutEntryRelatedByEntryIdCriteria = $criteria;
  5064. return $this->collroughcutEntrysRelatedByEntryId;
  5065. }
  5066. /**
  5067. * Clears out the collwidgets collection (array).
  5068. *
  5069. * This does not modify the database; however, it will remove any associated objects, causing
  5070. * them to be refetched by subsequent calls to accessor method.
  5071. *
  5072. * @return void
  5073. * @see addwidgets()
  5074. */
  5075. public function clearwidgets()
  5076. {
  5077. $this->collwidgets = null; // important to set this to NULL since that means it is uninitialized
  5078. }
  5079. /**
  5080. * Initializes the collwidgets collection (array).
  5081. *
  5082. * By default this just sets the collwidgets collection to an empty array (like clearcollwidgets());
  5083. * however, you may wish to override this method in your stub class to provide setting appropriate
  5084. * to your application -- for example, setting the initial array to the values stored in database.
  5085. *
  5086. * @return void
  5087. */
  5088. public function initwidgets()
  5089. {
  5090. $this->collwidgets = array();
  5091. }
  5092. /**
  5093. * Gets an array of widget objects which contain a foreign key that references this object.
  5094. *
  5095. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  5096. * Otherwise if this entry has previously been saved, it will retrieve
  5097. * related widgets from storage. If this entry is new, it will return
  5098. * an empty collection or the current collection, the criteria is ignored on a new object.
  5099. *
  5100. * @param PropelPDO $con
  5101. * @param Criteria $criteria
  5102. * @return array widget[]
  5103. * @throws PropelException
  5104. */
  5105. public function getwidgets($criteria = null, PropelPDO $con = null)
  5106. {
  5107. if ($criteria === null) {
  5108. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5109. }
  5110. elseif ($criteria instanceof Criteria)
  5111. {
  5112. $criteria = clone $criteria;
  5113. }
  5114. if ($this->collwidgets === null) {
  5115. if ($this->isNew()) {
  5116. $this->collwidgets = array();
  5117. } else {
  5118. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5119. widgetPeer::addSelectColumns($criteria);
  5120. $this->collwidgets = widgetPeer::doSelect($criteria, $con);
  5121. }
  5122. } else {
  5123. // criteria has no effect for a new object
  5124. if (!$this->isNew()) {
  5125. // the following code is to determine if a new query is
  5126. // called for. If the criteria is the same as the last
  5127. // one, just return the collection.
  5128. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5129. widgetPeer::addSelectColumns($criteria);
  5130. if (!isset($this->lastwidgetCriteria) || !$this->lastwidgetCriteria->equals($criteria)) {
  5131. $this->collwidgets = widgetPeer::doSelect($criteria, $con);
  5132. }
  5133. }
  5134. }
  5135. $this->lastwidgetCriteria = $criteria;
  5136. return $this->collwidgets;
  5137. }
  5138. /**
  5139. * Returns the number of related widget objects.
  5140. *
  5141. * @param Criteria $criteria
  5142. * @param boolean $distinct
  5143. * @param PropelPDO $con
  5144. * @return int Count of related widget objects.
  5145. * @throws PropelException
  5146. */
  5147. public function countwidgets(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  5148. {
  5149. if ($criteria === null) {
  5150. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5151. } else {
  5152. $criteria = clone $criteria;
  5153. }
  5154. if ($distinct) {
  5155. $criteria->setDistinct();
  5156. }
  5157. $count = null;
  5158. if ($this->collwidgets === null) {
  5159. if ($this->isNew()) {
  5160. $count = 0;
  5161. } else {
  5162. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5163. $count = widgetPeer::doCount($criteria, false, $con);
  5164. }
  5165. } else {
  5166. // criteria has no effect for a new object
  5167. if (!$this->isNew()) {
  5168. // the following code is to determine if a new query is
  5169. // called for. If the criteria is the same as the last
  5170. // one, just return count of the collection.
  5171. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5172. if (!isset($this->lastwidgetCriteria) || !$this->lastwidgetCriteria->equals($criteria)) {
  5173. $count = widgetPeer::doCount($criteria, false, $con);
  5174. } else {
  5175. $count = count($this->collwidgets);
  5176. }
  5177. } else {
  5178. $count = count($this->collwidgets);
  5179. }
  5180. }
  5181. return $count;
  5182. }
  5183. /**
  5184. * Method called to associate a widget object to this object
  5185. * through the widget foreign key attribute.
  5186. *
  5187. * @param widget $l widget
  5188. * @return void
  5189. * @throws PropelException
  5190. */
  5191. public function addwidget(widget $l)
  5192. {
  5193. if ($this->collwidgets === null) {
  5194. $this->initwidgets();
  5195. }
  5196. if (!in_array($l, $this->collwidgets, true)) { // only add it if the **same** object is not already associated
  5197. array_push($this->collwidgets, $l);
  5198. $l->setentry($this);
  5199. }
  5200. }
  5201. /**
  5202. * If this collection has already been initialized with
  5203. * an identical criteria, it returns the collection.
  5204. * Otherwise if this entry is new, it will return
  5205. * an empty collection; or if this entry has previously
  5206. * been saved, it will retrieve related widgets from storage.
  5207. *
  5208. * This method is protected by default in order to keep the public
  5209. * api reasonable. You can provide public methods for those you
  5210. * actually need in entry.
  5211. */
  5212. public function getwidgetsJoinkshow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5213. {
  5214. if ($criteria === null) {
  5215. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5216. }
  5217. elseif ($criteria instanceof Criteria)
  5218. {
  5219. $criteria = clone $criteria;
  5220. }
  5221. if ($this->collwidgets === null) {
  5222. if ($this->isNew()) {
  5223. $this->collwidgets = array();
  5224. } else {
  5225. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5226. $this->collwidgets = widgetPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  5227. }
  5228. } else {
  5229. // the following code is to determine if a new query is
  5230. // called for. If the criteria is the same as the last
  5231. // one, just return the collection.
  5232. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5233. if (!isset($this->lastwidgetCriteria) || !$this->lastwidgetCriteria->equals($criteria)) {
  5234. $this->collwidgets = widgetPeer::doSelectJoinkshow($criteria, $con, $join_behavior);
  5235. }
  5236. }
  5237. $this->lastwidgetCriteria = $criteria;
  5238. return $this->collwidgets;
  5239. }
  5240. /**
  5241. * If this collection has already been initialized with
  5242. * an identical criteria, it returns the collection.
  5243. * Otherwise if this entry is new, it will return
  5244. * an empty collection; or if this entry has previously
  5245. * been saved, it will retrieve related widgets from storage.
  5246. *
  5247. * This method is protected by default in order to keep the public
  5248. * api reasonable. You can provide public methods for those you
  5249. * actually need in entry.
  5250. */
  5251. public function getwidgetsJoinuiConf($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5252. {
  5253. if ($criteria === null) {
  5254. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5255. }
  5256. elseif ($criteria instanceof Criteria)
  5257. {
  5258. $criteria = clone $criteria;
  5259. }
  5260. if ($this->collwidgets === null) {
  5261. if ($this->isNew()) {
  5262. $this->collwidgets = array();
  5263. } else {
  5264. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5265. $this->collwidgets = widgetPeer::doSelectJoinuiConf($criteria, $con, $join_behavior);
  5266. }
  5267. } else {
  5268. // the following code is to determine if a new query is
  5269. // called for. If the criteria is the same as the last
  5270. // one, just return the collection.
  5271. $criteria->add(widgetPeer::ENTRY_ID, $this->id);
  5272. if (!isset($this->lastwidgetCriteria) || !$this->lastwidgetCriteria->equals($criteria)) {
  5273. $this->collwidgets = widgetPeer::doSelectJoinuiConf($criteria, $con, $join_behavior);
  5274. }
  5275. }
  5276. $this->lastwidgetCriteria = $criteria;
  5277. return $this->collwidgets;
  5278. }
  5279. /**
  5280. * Clears out the collassetParamsOutputs collection (array).
  5281. *
  5282. * This does not modify the database; however, it will remove any associated objects, causing
  5283. * them to be refetched by subsequent calls to accessor method.
  5284. *
  5285. * @return void
  5286. * @see addassetParamsOutputs()
  5287. */
  5288. public function clearassetParamsOutputs()
  5289. {
  5290. $this->collassetParamsOutputs = null; // important to set this to NULL since that means it is uninitialized
  5291. }
  5292. /**
  5293. * Initializes the collassetParamsOutputs collection (array).
  5294. *
  5295. * By default this just sets the collassetParamsOutputs collection to an empty array (like clearcollassetParamsOutputs());
  5296. * however, you may wish to override this method in your stub class to provide setting appropriate
  5297. * to your application -- for example, setting the initial array to the values stored in database.
  5298. *
  5299. * @return void
  5300. */
  5301. public function initassetParamsOutputs()
  5302. {
  5303. $this->collassetParamsOutputs = array();
  5304. }
  5305. /**
  5306. * Gets an array of assetParamsOutput objects which contain a foreign key that references this object.
  5307. *
  5308. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  5309. * Otherwise if this entry has previously been saved, it will retrieve
  5310. * related assetParamsOutputs from storage. If this entry is new, it will return
  5311. * an empty collection or the current collection, the criteria is ignored on a new object.
  5312. *
  5313. * @param PropelPDO $con
  5314. * @param Criteria $criteria
  5315. * @return array assetParamsOutput[]
  5316. * @throws PropelException
  5317. */
  5318. public function getassetParamsOutputs($criteria = null, PropelPDO $con = null)
  5319. {
  5320. if ($criteria === null) {
  5321. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5322. }
  5323. elseif ($criteria instanceof Criteria)
  5324. {
  5325. $criteria = clone $criteria;
  5326. }
  5327. if ($this->collassetParamsOutputs === null) {
  5328. if ($this->isNew()) {
  5329. $this->collassetParamsOutputs = array();
  5330. } else {
  5331. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5332. assetParamsOutputPeer::addSelectColumns($criteria);
  5333. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelect($criteria, $con);
  5334. }
  5335. } else {
  5336. // criteria has no effect for a new object
  5337. if (!$this->isNew()) {
  5338. // the following code is to determine if a new query is
  5339. // called for. If the criteria is the same as the last
  5340. // one, just return the collection.
  5341. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5342. assetParamsOutputPeer::addSelectColumns($criteria);
  5343. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  5344. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelect($criteria, $con);
  5345. }
  5346. }
  5347. }
  5348. $this->lastassetParamsOutputCriteria = $criteria;
  5349. return $this->collassetParamsOutputs;
  5350. }
  5351. /**
  5352. * Returns the number of related assetParamsOutput objects.
  5353. *
  5354. * @param Criteria $criteria
  5355. * @param boolean $distinct
  5356. * @param PropelPDO $con
  5357. * @return int Count of related assetParamsOutput objects.
  5358. * @throws PropelException
  5359. */
  5360. public function countassetParamsOutputs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  5361. {
  5362. if ($criteria === null) {
  5363. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5364. } else {
  5365. $criteria = clone $criteria;
  5366. }
  5367. if ($distinct) {
  5368. $criteria->setDistinct();
  5369. }
  5370. $count = null;
  5371. if ($this->collassetParamsOutputs === null) {
  5372. if ($this->isNew()) {
  5373. $count = 0;
  5374. } else {
  5375. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5376. $count = assetParamsOutputPeer::doCount($criteria, false, $con);
  5377. }
  5378. } else {
  5379. // criteria has no effect for a new object
  5380. if (!$this->isNew()) {
  5381. // the following code is to determine if a new query is
  5382. // called for. If the criteria is the same as the last
  5383. // one, just return count of the collection.
  5384. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5385. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  5386. $count = assetParamsOutputPeer::doCount($criteria, false, $con);
  5387. } else {
  5388. $count = count($this->collassetParamsOutputs);
  5389. }
  5390. } else {
  5391. $count = count($this->collassetParamsOutputs);
  5392. }
  5393. }
  5394. return $count;
  5395. }
  5396. /**
  5397. * Method called to associate a assetParamsOutput object to this object
  5398. * through the assetParamsOutput foreign key attribute.
  5399. *
  5400. * @param assetParamsOutput $l assetParamsOutput
  5401. * @return void
  5402. * @throws PropelException
  5403. */
  5404. public function addassetParamsOutput(assetParamsOutput $l)
  5405. {
  5406. if ($this->collassetParamsOutputs === null) {
  5407. $this->initassetParamsOutputs();
  5408. }
  5409. if (!in_array($l, $this->collassetParamsOutputs, true)) { // only add it if the **same** object is not already associated
  5410. array_push($this->collassetParamsOutputs, $l);
  5411. $l->setentry($this);
  5412. }
  5413. }
  5414. /**
  5415. * If this collection has already been initialized with
  5416. * an identical criteria, it returns the collection.
  5417. * Otherwise if this entry is new, it will return
  5418. * an empty collection; or if this entry has previously
  5419. * been saved, it will retrieve related assetParamsOutputs from storage.
  5420. *
  5421. * This method is protected by default in order to keep the public
  5422. * api reasonable. You can provide public methods for those you
  5423. * actually need in entry.
  5424. */
  5425. public function getassetParamsOutputsJoinassetParams($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5426. {
  5427. if ($criteria === null) {
  5428. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5429. }
  5430. elseif ($criteria instanceof Criteria)
  5431. {
  5432. $criteria = clone $criteria;
  5433. }
  5434. if ($this->collassetParamsOutputs === null) {
  5435. if ($this->isNew()) {
  5436. $this->collassetParamsOutputs = array();
  5437. } else {
  5438. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5439. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinassetParams($criteria, $con, $join_behavior);
  5440. }
  5441. } else {
  5442. // the following code is to determine if a new query is
  5443. // called for. If the criteria is the same as the last
  5444. // one, just return the collection.
  5445. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5446. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  5447. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinassetParams($criteria, $con, $join_behavior);
  5448. }
  5449. }
  5450. $this->lastassetParamsOutputCriteria = $criteria;
  5451. return $this->collassetParamsOutputs;
  5452. }
  5453. /**
  5454. * If this collection has already been initialized with
  5455. * an identical criteria, it returns the collection.
  5456. * Otherwise if this entry is new, it will return
  5457. * an empty collection; or if this entry has previously
  5458. * been saved, it will retrieve related assetParamsOutputs from storage.
  5459. *
  5460. * This method is protected by default in order to keep the public
  5461. * api reasonable. You can provide public methods for those you
  5462. * actually need in entry.
  5463. */
  5464. public function getassetParamsOutputsJoinasset($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5465. {
  5466. if ($criteria === null) {
  5467. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5468. }
  5469. elseif ($criteria instanceof Criteria)
  5470. {
  5471. $criteria = clone $criteria;
  5472. }
  5473. if ($this->collassetParamsOutputs === null) {
  5474. if ($this->isNew()) {
  5475. $this->collassetParamsOutputs = array();
  5476. } else {
  5477. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5478. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinasset($criteria, $con, $join_behavior);
  5479. }
  5480. } else {
  5481. // the following code is to determine if a new query is
  5482. // called for. If the criteria is the same as the last
  5483. // one, just return the collection.
  5484. $criteria->add(assetParamsOutputPeer::ENTRY_ID, $this->id);
  5485. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  5486. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinasset($criteria, $con, $join_behavior);
  5487. }
  5488. }
  5489. $this->lastassetParamsOutputCriteria = $criteria;
  5490. return $this->collassetParamsOutputs;
  5491. }
  5492. /**
  5493. * Clears out the collassets collection (array).
  5494. *
  5495. * This does not modify the database; however, it will remove any associated objects, causing
  5496. * them to be refetched by subsequent calls to accessor method.
  5497. *
  5498. * @return void
  5499. * @see addassets()
  5500. */
  5501. public function clearassets()
  5502. {
  5503. $this->collassets = null; // important to set this to NULL since that means it is uninitialized
  5504. }
  5505. /**
  5506. * Initializes the collassets collection (array).
  5507. *
  5508. * By default this just sets the collassets collection to an empty array (like clearcollassets());
  5509. * however, you may wish to override this method in your stub class to provide setting appropriate
  5510. * to your application -- for example, setting the initial array to the values stored in database.
  5511. *
  5512. * @return void
  5513. */
  5514. public function initassets()
  5515. {
  5516. $this->collassets = array();
  5517. }
  5518. /**
  5519. * Gets an array of asset objects which contain a foreign key that references this object.
  5520. *
  5521. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  5522. * Otherwise if this entry has previously been saved, it will retrieve
  5523. * related assets from storage. If this entry is new, it will return
  5524. * an empty collection or the current collection, the criteria is ignored on a new object.
  5525. *
  5526. * @param PropelPDO $con
  5527. * @param Criteria $criteria
  5528. * @return array asset[]
  5529. * @throws PropelException
  5530. */
  5531. public function getassets($criteria = null, PropelPDO $con = null)
  5532. {
  5533. if ($criteria === null) {
  5534. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5535. }
  5536. elseif ($criteria instanceof Criteria)
  5537. {
  5538. $criteria = clone $criteria;
  5539. }
  5540. if ($this->collassets === null) {
  5541. if ($this->isNew()) {
  5542. $this->collassets = array();
  5543. } else {
  5544. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5545. assetPeer::addSelectColumns($criteria);
  5546. $this->collassets = assetPeer::doSelect($criteria, $con);
  5547. }
  5548. } else {
  5549. // criteria has no effect for a new object
  5550. if (!$this->isNew()) {
  5551. // the following code is to determine if a new query is
  5552. // called for. If the criteria is the same as the last
  5553. // one, just return the collection.
  5554. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5555. assetPeer::addSelectColumns($criteria);
  5556. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  5557. $this->collassets = assetPeer::doSelect($criteria, $con);
  5558. }
  5559. }
  5560. }
  5561. $this->lastassetCriteria = $criteria;
  5562. return $this->collassets;
  5563. }
  5564. /**
  5565. * Returns the number of related asset objects.
  5566. *
  5567. * @param Criteria $criteria
  5568. * @param boolean $distinct
  5569. * @param PropelPDO $con
  5570. * @return int Count of related asset objects.
  5571. * @throws PropelException
  5572. */
  5573. public function countassets(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  5574. {
  5575. if ($criteria === null) {
  5576. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5577. } else {
  5578. $criteria = clone $criteria;
  5579. }
  5580. if ($distinct) {
  5581. $criteria->setDistinct();
  5582. }
  5583. $count = null;
  5584. if ($this->collassets === null) {
  5585. if ($this->isNew()) {
  5586. $count = 0;
  5587. } else {
  5588. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5589. $count = assetPeer::doCount($criteria, false, $con);
  5590. }
  5591. } else {
  5592. // criteria has no effect for a new object
  5593. if (!$this->isNew()) {
  5594. // the following code is to determine if a new query is
  5595. // called for. If the criteria is the same as the last
  5596. // one, just return count of the collection.
  5597. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5598. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  5599. $count = assetPeer::doCount($criteria, false, $con);
  5600. } else {
  5601. $count = count($this->collassets);
  5602. }
  5603. } else {
  5604. $count = count($this->collassets);
  5605. }
  5606. }
  5607. return $count;
  5608. }
  5609. /**
  5610. * Method called to associate a asset object to this object
  5611. * through the asset foreign key attribute.
  5612. *
  5613. * @param asset $l asset
  5614. * @return void
  5615. * @throws PropelException
  5616. */
  5617. public function addasset(asset $l)
  5618. {
  5619. if ($this->collassets === null) {
  5620. $this->initassets();
  5621. }
  5622. if (!in_array($l, $this->collassets, true)) { // only add it if the **same** object is not already associated
  5623. array_push($this->collassets, $l);
  5624. $l->setentry($this);
  5625. }
  5626. }
  5627. /**
  5628. * If this collection has already been initialized with
  5629. * an identical criteria, it returns the collection.
  5630. * Otherwise if this entry is new, it will return
  5631. * an empty collection; or if this entry has previously
  5632. * been saved, it will retrieve related assets from storage.
  5633. *
  5634. * This method is protected by default in order to keep the public
  5635. * api reasonable. You can provide public methods for those you
  5636. * actually need in entry.
  5637. */
  5638. public function getassetsJoinassetParams($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  5639. {
  5640. if ($criteria === null) {
  5641. $criteria = new Criteria(entryPeer::DATABASE_NAME);
  5642. }
  5643. elseif ($criteria instanceof Criteria)
  5644. {
  5645. $criteria = clone $criteria;
  5646. }
  5647. if ($this->collassets === null) {
  5648. if ($this->isNew()) {
  5649. $this->collassets = array();
  5650. } else {
  5651. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5652. $this->collassets = assetPeer::doSelectJoinassetParams($criteria, $con, $join_behavior);
  5653. }
  5654. } else {
  5655. // the following code is to determine if a new query is
  5656. // called for. If the criteria is the same as the last
  5657. // one, just return the collection.
  5658. $criteria->add(assetPeer::ENTRY_ID, $this->id);
  5659. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  5660. $this->collassets = assetPeer::doSelectJoinassetParams($criteria, $con, $join_behavior);
  5661. }
  5662. }
  5663. $this->lastassetCriteria = $criteria;
  5664. return $this->collassets;
  5665. }
  5666. /**
  5667. * Resets all collections of referencing foreign keys.
  5668. *
  5669. * This method is a user-space workaround for PHP's inability to garbage collect objects
  5670. * with circular references. This is currently necessary when using Propel in certain
  5671. * daemon or large-volumne/high-memory operations.
  5672. *
  5673. * @param boolean $deep Whether to also clear the references on all associated objects.
  5674. */
  5675. public function clearAllReferences($deep = false)
  5676. {
  5677. if ($deep) {
  5678. if ($this->collkvotes) {
  5679. foreach ((array) $this->collkvotes as $o) {
  5680. $o->clearAllReferences($deep);
  5681. }
  5682. }
  5683. if ($this->collconversions) {
  5684. foreach ((array) $this->collconversions as $o) {
  5685. $o->clearAllReferences($deep);
  5686. }
  5687. }
  5688. if ($this->collWidgetLogs) {
  5689. foreach ((array) $this->collWidgetLogs as $o) {
  5690. $o->clearAllReferences($deep);
  5691. }
  5692. }
  5693. if ($this->collmoderationFlags) {
  5694. foreach ((array) $this->collmoderationFlags as $o) {
  5695. $o->clearAllReferences($deep);
  5696. }
  5697. }
  5698. if ($this->collroughcutEntrysRelatedByRoughcutId) {
  5699. foreach ((array) $this->collroughcutEntrysRelatedByRoughcutId as $o) {
  5700. $o->clearAllReferences($deep);
  5701. }
  5702. }
  5703. if ($this->collroughcutEntrysRelatedByEntryId) {
  5704. foreach ((array) $this->collroughcutEntrysRelatedByEntryId as $o) {
  5705. $o->clearAllReferences($deep);
  5706. }
  5707. }
  5708. if ($this->collwidgets) {
  5709. foreach ((array) $this->collwidgets as $o) {
  5710. $o->clearAllReferences($deep);
  5711. }
  5712. }
  5713. if ($this->collassetParamsOutputs) {
  5714. foreach ((array) $this->collassetParamsOutputs as $o) {
  5715. $o->clearAllReferences($deep);
  5716. }
  5717. }
  5718. if ($this->collassets) {
  5719. foreach ((array) $this->collassets as $o) {
  5720. $o->clearAllReferences($deep);
  5721. }
  5722. }
  5723. } // if ($deep)
  5724. $this->collkvotes = null;
  5725. $this->collconversions = null;
  5726. $this->collWidgetLogs = null;
  5727. $this->collmoderationFlags = null;
  5728. $this->collroughcutEntrysRelatedByRoughcutId = null;
  5729. $this->collroughcutEntrysRelatedByEntryId = null;
  5730. $this->collwidgets = null;
  5731. $this->collassetParamsOutputs = null;
  5732. $this->collassets = null;
  5733. $this->akshow = null;
  5734. $this->akuser = null;
  5735. $this->aaccessControl = null;
  5736. $this->aconversionProfile2 = null;
  5737. }
  5738. /* ---------------------- CustomData functions ------------------------- */
  5739. /**
  5740. * @var myCustomData
  5741. */
  5742. protected $m_custom_data = null;
  5743. /**
  5744. * Store custom data old values before the changes
  5745. * @var array
  5746. */
  5747. protected $oldCustomDataValues = array();
  5748. /**
  5749. * @return array
  5750. */
  5751. public function getCustomDataOldValues()
  5752. {
  5753. return $this->oldCustomDataValues;
  5754. }
  5755. /**
  5756. * @param string $name
  5757. * @param string $value
  5758. * @param string $namespace
  5759. * @return string
  5760. */
  5761. public function putInCustomData ( $name , $value , $namespace = null )
  5762. {
  5763. $customData = $this->getCustomDataObj( );
  5764. $currentNamespace = '';
  5765. if($namespace)
  5766. $currentNamespace = $namespace;
  5767. if(!isset($this->oldCustomDataValues[$currentNamespace]))
  5768. $this->oldCustomDataValues[$currentNamespace] = array();
  5769. if(!isset($this->oldCustomDataValues[$currentNamespace][$name]))
  5770. $this->oldCustomDataValues[$currentNamespace][$name] = $customData->get($name, $namespace);
  5771. $customData->put ( $name , $value , $namespace );
  5772. }
  5773. /**
  5774. * @param string $name
  5775. * @param string $namespace
  5776. * @param string $defaultValue
  5777. * @return string
  5778. */
  5779. public function getFromCustomData ( $name , $namespace = null , $defaultValue = null )
  5780. {
  5781. $customData = $this->getCustomDataObj( );
  5782. $res = $customData->get ( $name , $namespace );
  5783. if ( $res === null ) return $defaultValue;
  5784. return $res;
  5785. }
  5786. /**
  5787. * @param string $name
  5788. * @param string $namespace
  5789. */
  5790. public function removeFromCustomData ( $name , $namespace = null)
  5791. {
  5792. $customData = $this->getCustomDataObj( );
  5793. return $customData->remove ( $name , $namespace );
  5794. }
  5795. /**
  5796. * @param string $name
  5797. * @param int $delta
  5798. * @param string $namespace
  5799. * @return string
  5800. */
  5801. public function incInCustomData ( $name , $delta = 1, $namespace = null)
  5802. {
  5803. $customData = $this->getCustomDataObj( );
  5804. return $customData->inc ( $name , $delta , $namespace );
  5805. }
  5806. /**
  5807. * @param string $name
  5808. * @param int $delta
  5809. * @param string $namespace
  5810. * @return string
  5811. */
  5812. public function decInCustomData ( $name , $delta = 1, $namespace = null)
  5813. {
  5814. $customData = $this->getCustomDataObj( );
  5815. return $customData->dec ( $name , $delta , $namespace );
  5816. }
  5817. /**
  5818. * @return myCustomData
  5819. */
  5820. public function getCustomDataObj( )
  5821. {
  5822. if ( ! $this->m_custom_data )
  5823. {
  5824. $this->m_custom_data = myCustomData::fromString ( $this->getCustomData() );
  5825. }
  5826. return $this->m_custom_data;
  5827. }
  5828. /**
  5829. * Must be called before saving the object
  5830. */
  5831. public function setCustomDataObj()
  5832. {
  5833. if ( $this->m_custom_data != null )
  5834. {
  5835. $this->setCustomData( $this->m_custom_data->toString() );
  5836. }
  5837. }
  5838. /* ---------------------- CustomData functions ------------------------- */
  5839. } // Baseentry