PageRenderTime 72ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 1ms

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

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