PageRenderTime 66ms CodeModel.GetById 30ms 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

Large files files are truncated, but you can click here to view the full file

  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 setI

Large files files are truncated, but you can click here to view the full file