PageRenderTime 56ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://bitbucket.org/pandaos/kaltura
PHP | 2253 lines | 1158 code | 300 blank | 795 comment | 192 complexity | b27e7e0c9a2651695b97c6ae1941d305 MD5 | raw file
Possible License(s): AGPL-3.0, GPL-3.0, BSD-3-Clause, LGPL-2.1, GPL-2.0, LGPL-3.0, JSON, MPL-2.0-no-copyleft-exception, Apache-2.0

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

  1. <?php
  2. /**
  3. * Base class that represents a row from the 'syndication_feed' table.
  4. *
  5. *
  6. *
  7. * @package Core
  8. * @subpackage model.om
  9. */
  10. abstract class BasesyndicationFeed 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 syndicationFeedPeer
  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 int_id field.
  25. * @var int
  26. */
  27. protected $int_id;
  28. /**
  29. * The value for the partner_id field.
  30. * @var int
  31. */
  32. protected $partner_id;
  33. /**
  34. * The value for the playlist_id field.
  35. * @var string
  36. */
  37. protected $playlist_id;
  38. /**
  39. * The value for the name field.
  40. * Note: this column has a database default value of: ''
  41. * @var string
  42. */
  43. protected $name;
  44. /**
  45. * The value for the status field.
  46. * @var int
  47. */
  48. protected $status;
  49. /**
  50. * The value for the type field.
  51. * @var int
  52. */
  53. protected $type;
  54. /**
  55. * The value for the landing_page field.
  56. * Note: this column has a database default value of: ''
  57. * @var string
  58. */
  59. protected $landing_page;
  60. /**
  61. * The value for the flavor_param_id field.
  62. * @var int
  63. */
  64. protected $flavor_param_id;
  65. /**
  66. * The value for the player_uiconf_id field.
  67. * @var int
  68. */
  69. protected $player_uiconf_id;
  70. /**
  71. * The value for the allow_embed field.
  72. * Note: this column has a database default value of: true
  73. * @var boolean
  74. */
  75. protected $allow_embed;
  76. /**
  77. * The value for the adult_content field.
  78. * @var string
  79. */
  80. protected $adult_content;
  81. /**
  82. * The value for the transcode_existing_content field.
  83. * Note: this column has a database default value of: false
  84. * @var boolean
  85. */
  86. protected $transcode_existing_content;
  87. /**
  88. * The value for the add_to_default_conversion_profile field.
  89. * Note: this column has a database default value of: false
  90. * @var boolean
  91. */
  92. protected $add_to_default_conversion_profile;
  93. /**
  94. * The value for the categories field.
  95. * @var string
  96. */
  97. protected $categories;
  98. /**
  99. * The value for the feed_description field.
  100. * @var string
  101. */
  102. protected $feed_description;
  103. /**
  104. * The value for the language field.
  105. * @var string
  106. */
  107. protected $language;
  108. /**
  109. * The value for the feed_landing_page field.
  110. * @var string
  111. */
  112. protected $feed_landing_page;
  113. /**
  114. * The value for the owner_name field.
  115. * @var string
  116. */
  117. protected $owner_name;
  118. /**
  119. * The value for the owner_email field.
  120. * @var string
  121. */
  122. protected $owner_email;
  123. /**
  124. * The value for the feed_image_url field.
  125. * @var string
  126. */
  127. protected $feed_image_url;
  128. /**
  129. * The value for the feed_author field.
  130. * @var string
  131. */
  132. protected $feed_author;
  133. /**
  134. * The value for the created_at field.
  135. * @var string
  136. */
  137. protected $created_at;
  138. /**
  139. * The value for the custom_data field.
  140. * @var string
  141. */
  142. protected $custom_data;
  143. /**
  144. * The value for the display_in_search field.
  145. * Note: this column has a database default value of: 1
  146. * @var int
  147. */
  148. protected $display_in_search;
  149. /**
  150. * Flag to prevent endless save loop, if this object is referenced
  151. * by another object which falls in this transaction.
  152. * @var boolean
  153. */
  154. protected $alreadyInSave = false;
  155. /**
  156. * Flag to prevent endless validation loop, if this object is referenced
  157. * by another object which falls in this transaction.
  158. * @var boolean
  159. */
  160. protected $alreadyInValidation = false;
  161. /**
  162. * Store columns old values before the changes
  163. * @var array
  164. */
  165. protected $oldColumnsValues = array();
  166. /**
  167. * @return array
  168. */
  169. public function getColumnsOldValues()
  170. {
  171. return $this->oldColumnsValues;
  172. }
  173. /**
  174. * Applies default values to this object.
  175. * This method should be called from the object's constructor (or
  176. * equivalent initialization method).
  177. * @see __construct()
  178. */
  179. public function applyDefaultValues()
  180. {
  181. $this->name = '';
  182. $this->landing_page = '';
  183. $this->allow_embed = true;
  184. $this->transcode_existing_content = false;
  185. $this->add_to_default_conversion_profile = false;
  186. $this->display_in_search = 1;
  187. }
  188. /**
  189. * Initializes internal state of BasesyndicationFeed object.
  190. * @see applyDefaults()
  191. */
  192. public function __construct()
  193. {
  194. parent::__construct();
  195. $this->applyDefaultValues();
  196. }
  197. /**
  198. * Get the [id] column value.
  199. *
  200. * @return string
  201. */
  202. public function getId()
  203. {
  204. return $this->id;
  205. }
  206. /**
  207. * Get the [int_id] column value.
  208. *
  209. * @return int
  210. */
  211. public function getIntId()
  212. {
  213. return $this->int_id;
  214. }
  215. /**
  216. * Get the [partner_id] column value.
  217. *
  218. * @return int
  219. */
  220. public function getPartnerId()
  221. {
  222. return $this->partner_id;
  223. }
  224. /**
  225. * Get the [playlist_id] column value.
  226. *
  227. * @return string
  228. */
  229. public function getPlaylistId()
  230. {
  231. return $this->playlist_id;
  232. }
  233. /**
  234. * Get the [name] column value.
  235. *
  236. * @return string
  237. */
  238. public function getName()
  239. {
  240. return $this->name;
  241. }
  242. /**
  243. * Get the [status] column value.
  244. *
  245. * @return int
  246. */
  247. public function getStatus()
  248. {
  249. return $this->status;
  250. }
  251. /**
  252. * Get the [type] column value.
  253. *
  254. * @return int
  255. */
  256. public function getType()
  257. {
  258. return $this->type;
  259. }
  260. /**
  261. * Get the [landing_page] column value.
  262. *
  263. * @return string
  264. */
  265. public function getLandingPage()
  266. {
  267. return $this->landing_page;
  268. }
  269. /**
  270. * Get the [flavor_param_id] column value.
  271. *
  272. * @return int
  273. */
  274. public function getFlavorParamId()
  275. {
  276. return $this->flavor_param_id;
  277. }
  278. /**
  279. * Get the [player_uiconf_id] column value.
  280. *
  281. * @return int
  282. */
  283. public function getPlayerUiconfId()
  284. {
  285. return $this->player_uiconf_id;
  286. }
  287. /**
  288. * Get the [allow_embed] column value.
  289. *
  290. * @return boolean
  291. */
  292. public function getAllowEmbed()
  293. {
  294. return $this->allow_embed;
  295. }
  296. /**
  297. * Get the [adult_content] column value.
  298. *
  299. * @return string
  300. */
  301. public function getAdultContent()
  302. {
  303. return $this->adult_content;
  304. }
  305. /**
  306. * Get the [transcode_existing_content] column value.
  307. *
  308. * @return boolean
  309. */
  310. public function getTranscodeExistingContent()
  311. {
  312. return $this->transcode_existing_content;
  313. }
  314. /**
  315. * Get the [add_to_default_conversion_profile] column value.
  316. *
  317. * @return boolean
  318. */
  319. public function getAddToDefaultConversionProfile()
  320. {
  321. return $this->add_to_default_conversion_profile;
  322. }
  323. /**
  324. * Get the [categories] column value.
  325. *
  326. * @return string
  327. */
  328. public function getCategories()
  329. {
  330. return $this->categories;
  331. }
  332. /**
  333. * Get the [feed_description] column value.
  334. *
  335. * @return string
  336. */
  337. public function getFeedDescription()
  338. {
  339. return $this->feed_description;
  340. }
  341. /**
  342. * Get the [language] column value.
  343. *
  344. * @return string
  345. */
  346. public function getLanguage()
  347. {
  348. return $this->language;
  349. }
  350. /**
  351. * Get the [feed_landing_page] column value.
  352. *
  353. * @return string
  354. */
  355. public function getFeedLandingPage()
  356. {
  357. return $this->feed_landing_page;
  358. }
  359. /**
  360. * Get the [owner_name] column value.
  361. *
  362. * @return string
  363. */
  364. public function getOwnerName()
  365. {
  366. return $this->owner_name;
  367. }
  368. /**
  369. * Get the [owner_email] column value.
  370. *
  371. * @return string
  372. */
  373. public function getOwnerEmail()
  374. {
  375. return $this->owner_email;
  376. }
  377. /**
  378. * Get the [feed_image_url] column value.
  379. *
  380. * @return string
  381. */
  382. public function getFeedImageUrl()
  383. {
  384. return $this->feed_image_url;
  385. }
  386. /**
  387. * Get the [feed_author] column value.
  388. *
  389. * @return string
  390. */
  391. public function getFeedAuthor()
  392. {
  393. return $this->feed_author;
  394. }
  395. /**
  396. * Get the [optionally formatted] temporal [created_at] column value.
  397. *
  398. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  399. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  400. *
  401. * @param string $format The date/time format string (either date()-style or strftime()-style).
  402. * If format is NULL, then the raw unix timestamp integer will be returned.
  403. * @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
  404. * @throws PropelException - if unable to parse/validate the date/time value.
  405. */
  406. public function getCreatedAt($format = 'Y-m-d H:i:s')
  407. {
  408. if ($this->created_at === null) {
  409. return null;
  410. }
  411. if ($this->created_at === '0000-00-00 00:00:00') {
  412. // while technically this is not a default value of NULL,
  413. // this seems to be closest in meaning.
  414. return null;
  415. } else {
  416. try {
  417. $dt = new DateTime($this->created_at);
  418. } catch (Exception $x) {
  419. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
  420. }
  421. }
  422. if ($format === null) {
  423. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  424. return (int) $dt->format('U');
  425. } elseif (strpos($format, '%') !== false) {
  426. return strftime($format, $dt->format('U'));
  427. } else {
  428. return $dt->format($format);
  429. }
  430. }
  431. /**
  432. * Get the [custom_data] column value.
  433. *
  434. * @return string
  435. */
  436. public function getCustomData()
  437. {
  438. return $this->custom_data;
  439. }
  440. /**
  441. * Get the [display_in_search] column value.
  442. *
  443. * @return int
  444. */
  445. public function getDisplayInSearch()
  446. {
  447. return $this->display_in_search;
  448. }
  449. /**
  450. * Set the value of [id] column.
  451. *
  452. * @param string $v new value
  453. * @return syndicationFeed The current object (for fluent API support)
  454. */
  455. public function setId($v)
  456. {
  457. if(!isset($this->oldColumnsValues[syndicationFeedPeer::ID]))
  458. $this->oldColumnsValues[syndicationFeedPeer::ID] = $this->id;
  459. if ($v !== null) {
  460. $v = (string) $v;
  461. }
  462. if ($this->id !== $v) {
  463. $this->id = $v;
  464. $this->modifiedColumns[] = syndicationFeedPeer::ID;
  465. }
  466. return $this;
  467. } // setId()
  468. /**
  469. * Set the value of [int_id] column.
  470. *
  471. * @param int $v new value
  472. * @return syndicationFeed The current object (for fluent API support)
  473. */
  474. public function setIntId($v)
  475. {
  476. if(!isset($this->oldColumnsValues[syndicationFeedPeer::INT_ID]))
  477. $this->oldColumnsValues[syndicationFeedPeer::INT_ID] = $this->int_id;
  478. if ($v !== null) {
  479. $v = (int) $v;
  480. }
  481. if ($this->int_id !== $v) {
  482. $this->int_id = $v;
  483. $this->modifiedColumns[] = syndicationFeedPeer::INT_ID;
  484. }
  485. return $this;
  486. } // setIntId()
  487. /**
  488. * Set the value of [partner_id] column.
  489. *
  490. * @param int $v new value
  491. * @return syndicationFeed The current object (for fluent API support)
  492. */
  493. public function setPartnerId($v)
  494. {
  495. if(!isset($this->oldColumnsValues[syndicationFeedPeer::PARTNER_ID]))
  496. $this->oldColumnsValues[syndicationFeedPeer::PARTNER_ID] = $this->partner_id;
  497. if ($v !== null) {
  498. $v = (int) $v;
  499. }
  500. if ($this->partner_id !== $v) {
  501. $this->partner_id = $v;
  502. $this->modifiedColumns[] = syndicationFeedPeer::PARTNER_ID;
  503. }
  504. return $this;
  505. } // setPartnerId()
  506. /**
  507. * Set the value of [playlist_id] column.
  508. *
  509. * @param string $v new value
  510. * @return syndicationFeed The current object (for fluent API support)
  511. */
  512. public function setPlaylistId($v)
  513. {
  514. if(!isset($this->oldColumnsValues[syndicationFeedPeer::PLAYLIST_ID]))
  515. $this->oldColumnsValues[syndicationFeedPeer::PLAYLIST_ID] = $this->playlist_id;
  516. if ($v !== null) {
  517. $v = (string) $v;
  518. }
  519. if ($this->playlist_id !== $v) {
  520. $this->playlist_id = $v;
  521. $this->modifiedColumns[] = syndicationFeedPeer::PLAYLIST_ID;
  522. }
  523. return $this;
  524. } // setPlaylistId()
  525. /**
  526. * Set the value of [name] column.
  527. *
  528. * @param string $v new value
  529. * @return syndicationFeed The current object (for fluent API support)
  530. */
  531. public function setName($v)
  532. {
  533. if(!isset($this->oldColumnsValues[syndicationFeedPeer::NAME]))
  534. $this->oldColumnsValues[syndicationFeedPeer::NAME] = $this->name;
  535. if ($v !== null) {
  536. $v = (string) $v;
  537. }
  538. if ($this->name !== $v || $this->isNew()) {
  539. $this->name = $v;
  540. $this->modifiedColumns[] = syndicationFeedPeer::NAME;
  541. }
  542. return $this;
  543. } // setName()
  544. /**
  545. * Set the value of [status] column.
  546. *
  547. * @param int $v new value
  548. * @return syndicationFeed The current object (for fluent API support)
  549. */
  550. public function setStatus($v)
  551. {
  552. if(!isset($this->oldColumnsValues[syndicationFeedPeer::STATUS]))
  553. $this->oldColumnsValues[syndicationFeedPeer::STATUS] = $this->status;
  554. if ($v !== null) {
  555. $v = (int) $v;
  556. }
  557. if ($this->status !== $v) {
  558. $this->status = $v;
  559. $this->modifiedColumns[] = syndicationFeedPeer::STATUS;
  560. }
  561. return $this;
  562. } // setStatus()
  563. /**
  564. * Set the value of [type] column.
  565. *
  566. * @param int $v new value
  567. * @return syndicationFeed The current object (for fluent API support)
  568. */
  569. public function setType($v)
  570. {
  571. if(!isset($this->oldColumnsValues[syndicationFeedPeer::TYPE]))
  572. $this->oldColumnsValues[syndicationFeedPeer::TYPE] = $this->type;
  573. if ($v !== null) {
  574. $v = (int) $v;
  575. }
  576. if ($this->type !== $v) {
  577. $this->type = $v;
  578. $this->modifiedColumns[] = syndicationFeedPeer::TYPE;
  579. }
  580. return $this;
  581. } // setType()
  582. /**
  583. * Set the value of [landing_page] column.
  584. *
  585. * @param string $v new value
  586. * @return syndicationFeed The current object (for fluent API support)
  587. */
  588. public function setLandingPage($v)
  589. {
  590. if(!isset($this->oldColumnsValues[syndicationFeedPeer::LANDING_PAGE]))
  591. $this->oldColumnsValues[syndicationFeedPeer::LANDING_PAGE] = $this->landing_page;
  592. if ($v !== null) {
  593. $v = (string) $v;
  594. }
  595. if ($this->landing_page !== $v || $this->isNew()) {
  596. $this->landing_page = $v;
  597. $this->modifiedColumns[] = syndicationFeedPeer::LANDING_PAGE;
  598. }
  599. return $this;
  600. } // setLandingPage()
  601. /**
  602. * Set the value of [flavor_param_id] column.
  603. *
  604. * @param int $v new value
  605. * @return syndicationFeed The current object (for fluent API support)
  606. */
  607. public function setFlavorParamId($v)
  608. {
  609. if(!isset($this->oldColumnsValues[syndicationFeedPeer::FLAVOR_PARAM_ID]))
  610. $this->oldColumnsValues[syndicationFeedPeer::FLAVOR_PARAM_ID] = $this->flavor_param_id;
  611. if ($v !== null) {
  612. $v = (int) $v;
  613. }
  614. if ($this->flavor_param_id !== $v) {
  615. $this->flavor_param_id = $v;
  616. $this->modifiedColumns[] = syndicationFeedPeer::FLAVOR_PARAM_ID;
  617. }
  618. return $this;
  619. } // setFlavorParamId()
  620. /**
  621. * Set the value of [player_uiconf_id] column.
  622. *
  623. * @param int $v new value
  624. * @return syndicationFeed The current object (for fluent API support)
  625. */
  626. public function setPlayerUiconfId($v)
  627. {
  628. if(!isset($this->oldColumnsValues[syndicationFeedPeer::PLAYER_UICONF_ID]))
  629. $this->oldColumnsValues[syndicationFeedPeer::PLAYER_UICONF_ID] = $this->player_uiconf_id;
  630. if ($v !== null) {
  631. $v = (int) $v;
  632. }
  633. if ($this->player_uiconf_id !== $v) {
  634. $this->player_uiconf_id = $v;
  635. $this->modifiedColumns[] = syndicationFeedPeer::PLAYER_UICONF_ID;
  636. }
  637. return $this;
  638. } // setPlayerUiconfId()
  639. /**
  640. * Set the value of [allow_embed] column.
  641. *
  642. * @param boolean $v new value
  643. * @return syndicationFeed The current object (for fluent API support)
  644. */
  645. public function setAllowEmbed($v)
  646. {
  647. if(!isset($this->oldColumnsValues[syndicationFeedPeer::ALLOW_EMBED]))
  648. $this->oldColumnsValues[syndicationFeedPeer::ALLOW_EMBED] = $this->allow_embed;
  649. if ($v !== null) {
  650. $v = (boolean) $v;
  651. }
  652. if ($this->allow_embed !== $v || $this->isNew()) {
  653. $this->allow_embed = $v;
  654. $this->modifiedColumns[] = syndicationFeedPeer::ALLOW_EMBED;
  655. }
  656. return $this;
  657. } // setAllowEmbed()
  658. /**
  659. * Set the value of [adult_content] column.
  660. *
  661. * @param string $v new value
  662. * @return syndicationFeed The current object (for fluent API support)
  663. */
  664. public function setAdultContent($v)
  665. {
  666. if(!isset($this->oldColumnsValues[syndicationFeedPeer::ADULT_CONTENT]))
  667. $this->oldColumnsValues[syndicationFeedPeer::ADULT_CONTENT] = $this->adult_content;
  668. if ($v !== null) {
  669. $v = (string) $v;
  670. }
  671. if ($this->adult_content !== $v) {
  672. $this->adult_content = $v;
  673. $this->modifiedColumns[] = syndicationFeedPeer::ADULT_CONTENT;
  674. }
  675. return $this;
  676. } // setAdultContent()
  677. /**
  678. * Set the value of [transcode_existing_content] column.
  679. *
  680. * @param boolean $v new value
  681. * @return syndicationFeed The current object (for fluent API support)
  682. */
  683. public function setTranscodeExistingContent($v)
  684. {
  685. if(!isset($this->oldColumnsValues[syndicationFeedPeer::TRANSCODE_EXISTING_CONTENT]))
  686. $this->oldColumnsValues[syndicationFeedPeer::TRANSCODE_EXISTING_CONTENT] = $this->transcode_existing_content;
  687. if ($v !== null) {
  688. $v = (boolean) $v;
  689. }
  690. if ($this->transcode_existing_content !== $v || $this->isNew()) {
  691. $this->transcode_existing_content = $v;
  692. $this->modifiedColumns[] = syndicationFeedPeer::TRANSCODE_EXISTING_CONTENT;
  693. }
  694. return $this;
  695. } // setTranscodeExistingContent()
  696. /**
  697. * Set the value of [add_to_default_conversion_profile] column.
  698. *
  699. * @param boolean $v new value
  700. * @return syndicationFeed The current object (for fluent API support)
  701. */
  702. public function setAddToDefaultConversionProfile($v)
  703. {
  704. if(!isset($this->oldColumnsValues[syndicationFeedPeer::ADD_TO_DEFAULT_CONVERSION_PROFILE]))
  705. $this->oldColumnsValues[syndicationFeedPeer::ADD_TO_DEFAULT_CONVERSION_PROFILE] = $this->add_to_default_conversion_profile;
  706. if ($v !== null) {
  707. $v = (boolean) $v;
  708. }
  709. if ($this->add_to_default_conversion_profile !== $v || $this->isNew()) {
  710. $this->add_to_default_conversion_profile = $v;
  711. $this->modifiedColumns[] = syndicationFeedPeer::ADD_TO_DEFAULT_CONVERSION_PROFILE;
  712. }
  713. return $this;
  714. } // setAddToDefaultConversionProfile()
  715. /**
  716. * Set the value of [categories] column.
  717. *
  718. * @param string $v new value
  719. * @return syndicationFeed The current object (for fluent API support)
  720. */
  721. public function setCategories($v)
  722. {
  723. if(!isset($this->oldColumnsValues[syndicationFeedPeer::CATEGORIES]))
  724. $this->oldColumnsValues[syndicationFeedPeer::CATEGORIES] = $this->categories;
  725. if ($v !== null) {
  726. $v = (string) $v;
  727. }
  728. if ($this->categories !== $v) {
  729. $this->categories = $v;
  730. $this->modifiedColumns[] = syndicationFeedPeer::CATEGORIES;
  731. }
  732. return $this;
  733. } // setCategories()
  734. /**
  735. * Set the value of [feed_description] column.
  736. *
  737. * @param string $v new value
  738. * @return syndicationFeed The current object (for fluent API support)
  739. */
  740. public function setFeedDescription($v)
  741. {
  742. if(!isset($this->oldColumnsValues[syndicationFeedPeer::FEED_DESCRIPTION]))
  743. $this->oldColumnsValues[syndicationFeedPeer::FEED_DESCRIPTION] = $this->feed_description;
  744. if ($v !== null) {
  745. $v = (string) $v;
  746. }
  747. if ($this->feed_description !== $v) {
  748. $this->feed_description = $v;
  749. $this->modifiedColumns[] = syndicationFeedPeer::FEED_DESCRIPTION;
  750. }
  751. return $this;
  752. } // setFeedDescription()
  753. /**
  754. * Set the value of [language] column.
  755. *
  756. * @param string $v new value
  757. * @return syndicationFeed The current object (for fluent API support)
  758. */
  759. public function setLanguage($v)
  760. {
  761. if(!isset($this->oldColumnsValues[syndicationFeedPeer::LANGUAGE]))
  762. $this->oldColumnsValues[syndicationFeedPeer::LANGUAGE] = $this->language;
  763. if ($v !== null) {
  764. $v = (string) $v;
  765. }
  766. if ($this->language !== $v) {
  767. $this->language = $v;
  768. $this->modifiedColumns[] = syndicationFeedPeer::LANGUAGE;
  769. }
  770. return $this;
  771. } // setLanguage()
  772. /**
  773. * Set the value of [feed_landing_page] column.
  774. *
  775. * @param string $v new value
  776. * @return syndicationFeed The current object (for fluent API support)
  777. */
  778. public function setFeedLandingPage($v)
  779. {
  780. if(!isset($this->oldColumnsValues[syndicationFeedPeer::FEED_LANDING_PAGE]))
  781. $this->oldColumnsValues[syndicationFeedPeer::FEED_LANDING_PAGE] = $this->feed_landing_page;
  782. if ($v !== null) {
  783. $v = (string) $v;
  784. }
  785. if ($this->feed_landing_page !== $v) {
  786. $this->feed_landing_page = $v;
  787. $this->modifiedColumns[] = syndicationFeedPeer::FEED_LANDING_PAGE;
  788. }
  789. return $this;
  790. } // setFeedLandingPage()
  791. /**
  792. * Set the value of [owner_name] column.
  793. *
  794. * @param string $v new value
  795. * @return syndicationFeed The current object (for fluent API support)
  796. */
  797. public function setOwnerName($v)
  798. {
  799. if(!isset($this->oldColumnsValues[syndicationFeedPeer::OWNER_NAME]))
  800. $this->oldColumnsValues[syndicationFeedPeer::OWNER_NAME] = $this->owner_name;
  801. if ($v !== null) {
  802. $v = (string) $v;
  803. }
  804. if ($this->owner_name !== $v) {
  805. $this->owner_name = $v;
  806. $this->modifiedColumns[] = syndicationFeedPeer::OWNER_NAME;
  807. }
  808. return $this;
  809. } // setOwnerName()
  810. /**
  811. * Set the value of [owner_email] column.
  812. *
  813. * @param string $v new value
  814. * @return syndicationFeed The current object (for fluent API support)
  815. */
  816. public function setOwnerEmail($v)
  817. {
  818. if(!isset($this->oldColumnsValues[syndicationFeedPeer::OWNER_EMAIL]))
  819. $this->oldColumnsValues[syndicationFeedPeer::OWNER_EMAIL] = $this->owner_email;
  820. if ($v !== null) {
  821. $v = (string) $v;
  822. }
  823. if ($this->owner_email !== $v) {
  824. $this->owner_email = $v;
  825. $this->modifiedColumns[] = syndicationFeedPeer::OWNER_EMAIL;
  826. }
  827. return $this;
  828. } // setOwnerEmail()
  829. /**
  830. * Set the value of [feed_image_url] column.
  831. *
  832. * @param string $v new value
  833. * @return syndicationFeed The current object (for fluent API support)
  834. */
  835. public function setFeedImageUrl($v)
  836. {
  837. if(!isset($this->oldColumnsValues[syndicationFeedPeer::FEED_IMAGE_URL]))
  838. $this->oldColumnsValues[syndicationFeedPeer::FEED_IMAGE_URL] = $this->feed_image_url;
  839. if ($v !== null) {
  840. $v = (string) $v;
  841. }
  842. if ($this->feed_image_url !== $v) {
  843. $this->feed_image_url = $v;
  844. $this->modifiedColumns[] = syndicationFeedPeer::FEED_IMAGE_URL;
  845. }
  846. return $this;
  847. } // setFeedImageUrl()
  848. /**
  849. * Set the value of [feed_author] column.
  850. *
  851. * @param string $v new value
  852. * @return syndicationFeed The current object (for fluent API support)
  853. */
  854. public function setFeedAuthor($v)
  855. {
  856. if(!isset($this->oldColumnsValues[syndicationFeedPeer::FEED_AUTHOR]))
  857. $this->oldColumnsValues[syndicationFeedPeer::FEED_AUTHOR] = $this->feed_author;
  858. if ($v !== null) {
  859. $v = (string) $v;
  860. }
  861. if ($this->feed_author !== $v) {
  862. $this->feed_author = $v;
  863. $this->modifiedColumns[] = syndicationFeedPeer::FEED_AUTHOR;
  864. }
  865. return $this;
  866. } // setFeedAuthor()
  867. /**
  868. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  869. *
  870. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  871. * be treated as NULL for temporal objects.
  872. * @return syndicationFeed The current object (for fluent API support)
  873. */
  874. public function setCreatedAt($v)
  875. {
  876. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  877. // -- which is unexpected, to say the least.
  878. if ($v === null || $v === '') {
  879. $dt = null;
  880. } elseif ($v instanceof DateTime) {
  881. $dt = $v;
  882. } else {
  883. // some string/numeric value passed; we normalize that so that we can
  884. // validate it.
  885. try {
  886. if (is_numeric($v)) { // if it's a unix timestamp
  887. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  888. // We have to explicitly specify and then change the time zone because of a
  889. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  890. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  891. } else {
  892. $dt = new DateTime($v);
  893. }
  894. } catch (Exception $x) {
  895. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  896. }
  897. }
  898. if ( $this->created_at !== null || $dt !== null ) {
  899. // (nested ifs are a little easier to read in this case)
  900. $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  901. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  902. if ( ($currNorm !== $newNorm) // normalized values don't match
  903. )
  904. {
  905. $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  906. $this->modifiedColumns[] = syndicationFeedPeer::CREATED_AT;
  907. }
  908. } // if either are not null
  909. return $this;
  910. } // setCreatedAt()
  911. /**
  912. * Set the value of [custom_data] column.
  913. *
  914. * @param string $v new value
  915. * @return syndicationFeed The current object (for fluent API support)
  916. */
  917. public function setCustomData($v)
  918. {
  919. if ($v !== null) {
  920. $v = (string) $v;
  921. }
  922. if ($this->custom_data !== $v) {
  923. $this->custom_data = $v;
  924. $this->modifiedColumns[] = syndicationFeedPeer::CUSTOM_DATA;
  925. }
  926. return $this;
  927. } // setCustomData()
  928. /**
  929. * Set the value of [display_in_search] column.
  930. *
  931. * @param int $v new value
  932. * @return syndicationFeed The current object (for fluent API support)
  933. */
  934. public function setDisplayInSearch($v)
  935. {
  936. if(!isset($this->oldColumnsValues[syndicationFeedPeer::DISPLAY_IN_SEARCH]))
  937. $this->oldColumnsValues[syndicationFeedPeer::DISPLAY_IN_SEARCH] = $this->display_in_search;
  938. if ($v !== null) {
  939. $v = (int) $v;
  940. }
  941. if ($this->display_in_search !== $v || $this->isNew()) {
  942. $this->display_in_search = $v;
  943. $this->modifiedColumns[] = syndicationFeedPeer::DISPLAY_IN_SEARCH;
  944. }
  945. return $this;
  946. } // setDisplayInSearch()
  947. /**
  948. * Indicates whether the columns in this object are only set to default values.
  949. *
  950. * This method can be used in conjunction with isModified() to indicate whether an object is both
  951. * modified _and_ has some values set which are non-default.
  952. *
  953. * @return boolean Whether the columns in this object are only been set with default values.
  954. */
  955. public function hasOnlyDefaultValues()
  956. {
  957. if ($this->name !== '') {
  958. return false;
  959. }
  960. if ($this->landing_page !== '') {
  961. return false;
  962. }
  963. if ($this->allow_embed !== true) {
  964. return false;
  965. }
  966. if ($this->transcode_existing_content !== false) {
  967. return false;
  968. }
  969. if ($this->add_to_default_conversion_profile !== false) {
  970. return false;
  971. }
  972. if ($this->display_in_search !== 1) {
  973. return false;
  974. }
  975. // otherwise, everything was equal, so return TRUE
  976. return true;
  977. } // hasOnlyDefaultValues()
  978. /**
  979. * Hydrates (populates) the object variables with values from the database resultset.
  980. *
  981. * An offset (0-based "start column") is specified so that objects can be hydrated
  982. * with a subset of the columns in the resultset rows. This is needed, for example,
  983. * for results of JOIN queries where the resultset row includes columns from two or
  984. * more tables.
  985. *
  986. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  987. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  988. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  989. * @return int next starting column
  990. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  991. */
  992. public function hydrate($row, $startcol = 0, $rehydrate = false)
  993. {
  994. try {
  995. $this->id = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
  996. $this->int_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
  997. $this->partner_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
  998. $this->playlist_id = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
  999. $this->name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
  1000. $this->status = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
  1001. $this->type = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
  1002. $this->landing_page = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
  1003. $this->flavor_param_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
  1004. $this->player_uiconf_id = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
  1005. $this->allow_embed = ($row[$startcol + 10] !== null) ? (boolean) $row[$startcol + 10] : null;
  1006. $this->adult_content = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
  1007. $this->transcode_existing_content = ($row[$startcol + 12] !== null) ? (boolean) $row[$startcol + 12] : null;
  1008. $this->add_to_default_conversion_profile = ($row[$startcol + 13] !== null) ? (boolean) $row[$startcol + 13] : null;
  1009. $this->categories = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
  1010. $this->feed_description = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
  1011. $this->language = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
  1012. $this->feed_landing_page = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
  1013. $this->owner_name = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
  1014. $this->owner_email = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
  1015. $this->feed_image_url = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
  1016. $this->feed_author = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
  1017. $this->created_at = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null;
  1018. $this->custom_data = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null;
  1019. $this->display_in_search = ($row[$startcol + 24] !== null) ? (int) $row[$startcol + 24] : null;
  1020. $this->resetModified();
  1021. $this->setNew(false);
  1022. if ($rehydrate) {
  1023. $this->ensureConsistency();
  1024. }
  1025. // FIXME - using NUM_COLUMNS may be clearer.
  1026. return $startcol + 25; // 25 = syndicationFeedPeer::NUM_COLUMNS - syndicationFeedPeer::NUM_LAZY_LOAD_COLUMNS).
  1027. } catch (Exception $e) {
  1028. throw new PropelException("Error populating syndicationFeed object", $e);
  1029. }
  1030. }
  1031. /**
  1032. * Checks and repairs the internal consistency of the object.
  1033. *
  1034. * This method is executed after an already-instantiated object is re-hydrated
  1035. * from the database. It exists to check any foreign keys to make sure that
  1036. * the objects related to the current object are correct based on foreign key.
  1037. *
  1038. * You can override this method in the stub class, but you should always invoke
  1039. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  1040. * in case your model changes.
  1041. *
  1042. * @throws PropelException
  1043. */
  1044. public function ensureConsistency()
  1045. {
  1046. } // ensureConsistency
  1047. /**
  1048. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  1049. *
  1050. * This will only work if the object has been saved and has a valid primary key set.
  1051. *
  1052. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  1053. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  1054. * @return void
  1055. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  1056. */
  1057. public function reload($deep = false, PropelPDO $con = null)
  1058. {
  1059. if ($this->isDeleted()) {
  1060. throw new PropelException("Cannot reload a deleted object.");
  1061. }
  1062. if ($this->isNew()) {
  1063. throw new PropelException("Cannot reload an unsaved object.");
  1064. }
  1065. if ($con === null) {
  1066. $con = Propel::getConnection(syndicationFeedPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  1067. }
  1068. // We don't need to alter the object instance pool; we're just modifying this instance
  1069. // already in the pool.
  1070. syndicationFeedPeer::setUseCriteriaFilter(false);
  1071. $stmt = syndicationFeedPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  1072. syndicationFeedPeer::setUseCriteriaFilter(true);
  1073. $row = $stmt->fetch(PDO::FETCH_NUM);
  1074. $stmt->closeCursor();
  1075. if (!$row) {
  1076. throw new PropelException('Cannot find matching row in the database to reload object values.');
  1077. }
  1078. $this->hydrate($row, 0, true); // rehydrate
  1079. if ($deep) { // also de-associate any related objects?
  1080. } // if (deep)
  1081. }
  1082. /**
  1083. * Removes this object from datastore and sets delete attribute.
  1084. *
  1085. * @param PropelPDO $con
  1086. * @return void
  1087. * @throws PropelException
  1088. * @see BaseObject::setDeleted()
  1089. * @see BaseObject::isDeleted()
  1090. */
  1091. public function delete(PropelPDO $con = null)
  1092. {
  1093. if ($this->isDeleted()) {
  1094. throw new PropelException("This object has already been deleted.");
  1095. }
  1096. if ($con === null) {
  1097. $con = Propel::getConnection(syndicationFeedPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  1098. }
  1099. $con->beginTransaction();
  1100. try {
  1101. $ret = $this->preDelete($con);
  1102. if ($ret) {
  1103. syndicationFeedPeer::doDelete($this, $con);
  1104. $this->postDelete($con);
  1105. $this->setDeleted(true);
  1106. $con->commit();
  1107. } else {
  1108. $con->commit();
  1109. }
  1110. } catch (PropelException $e) {
  1111. $con->rollBack();
  1112. throw $e;
  1113. }
  1114. }
  1115. /**
  1116. * Persists this object to the database.
  1117. *
  1118. * If the object is new, it inserts it; otherwise an update is performed.
  1119. * All modified related objects will also be persisted in the doSave()
  1120. * method. This method wraps all precipitate database operations in a
  1121. * single transaction.
  1122. *
  1123. * Since this table was configured to reload rows on insert, the object will
  1124. * be reloaded from the database if an INSERT operation is performed (unless
  1125. * the $skipReload parameter is TRUE).
  1126. *
  1127. * @param PropelPDO $con
  1128. * @param boolean $skipReload Whether to skip the reload for this object from database.
  1129. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1130. * @throws PropelException
  1131. * @see doSave()
  1132. */
  1133. public function save(PropelPDO $con = null, $skipReload = false)
  1134. {
  1135. if ($this->isDeleted()) {
  1136. throw new PropelException("You cannot save an object that has been deleted.");
  1137. }
  1138. if ($con === null) {
  1139. $con = Propel::getConnection(syndicationFeedPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  1140. }
  1141. $con->beginTransaction();
  1142. $isInsert = $this->isNew();
  1143. try {
  1144. $ret = $this->preSave($con);
  1145. if ($isInsert) {
  1146. $ret = $ret && $this->preInsert($con);
  1147. } else {
  1148. $ret = $ret && $this->preUpdate($con);
  1149. }
  1150. if ($ret) {
  1151. $affectedRows = $this->doSave($con, $skipReload);
  1152. if ($isInsert) {
  1153. $this->postInsert($con);
  1154. } else {
  1155. $this->postUpdate($con);
  1156. }
  1157. $this->postSave($con);
  1158. syndicationFeedPeer::addInstanceToPool($this);
  1159. } else {
  1160. $affectedRows = 0;
  1161. }
  1162. $con->commit();
  1163. return $affectedRows;
  1164. } catch (PropelException $e) {
  1165. $con->rollBack();
  1166. throw $e;
  1167. }
  1168. }
  1169. /**
  1170. * Performs the work of inserting or updating the row in the database.
  1171. *
  1172. * If the object is new, it inserts it; otherwise an update is performed.
  1173. * All related objects are also updated in this method.
  1174. *
  1175. * @param PropelPDO $con
  1176. * @param boolean $skipReload Whether to skip the reload for this object from database.
  1177. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1178. * @throws PropelException
  1179. * @see save()
  1180. */
  1181. protected function doSave(PropelPDO $con, $skipReload = false)
  1182. {
  1183. $affectedRows = 0; // initialize var to track total num of affected rows
  1184. if (!$this->alreadyInSave) {
  1185. $this->alreadyInSave = true;
  1186. $reloadObject = false;
  1187. // If this object has been modified, then save it to the database.
  1188. if ($this->isModified()) {
  1189. if ($this->isNew()) {
  1190. $pk = syndicationFeedPeer::doInsert($this, $con);
  1191. if (!$skipReload) {
  1192. $reloadObject = true;
  1193. }
  1194. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  1195. // should always be true here (even though technically
  1196. // BasePeer::doInsert() can insert multiple rows).
  1197. $this->setNew(false);
  1198. } else {
  1199. $affectedRows += syndicationFeedPeer::doUpdate($this, $con);
  1200. }
  1201. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  1202. }
  1203. $this->alreadyInSave = false;
  1204. if ($reloadObject) {
  1205. $this->reload($con);
  1206. }
  1207. }
  1208. return $affectedRows;
  1209. } // doSave()
  1210. /**
  1211. * Override in order to use the query cache.
  1212. * Cache invalidation keys are used to determine when cached queries are valid.
  1213. * Before returning a query result from the cache, the time of the cached query
  1214. * is compared to the time saved in the invalidation key.
  1215. * A cached query will only be used if it's newer than the matching invalidation key.
  1216. *
  1217. * @return array Array of keys that will should be updated when this object is modified.
  1218. */
  1219. public function getCacheInvalidationKeys()
  1220. {
  1221. return array();
  1222. }
  1223. /**
  1224. * Code to be run before persisting the object
  1225. * @param PropelPDO $con
  1226. * @return bloolean
  1227. */
  1228. public function preSave(PropelPDO $con = null)
  1229. {
  1230. $this->setCustomDataObj();
  1231. return parent::preSave($con);
  1232. }
  1233. /**
  1234. * Code to be run after persisting the object
  1235. * @param PropelPDO $con
  1236. */
  1237. public function postSave(PropelPDO $con = null)
  1238. {
  1239. $this->oldColumnsValues = array();
  1240. $this->oldCustomDataValues = array();
  1241. }
  1242. /**
  1243. * Code to be run before inserting to database
  1244. * @param PropelPDO $con
  1245. * @return boolean
  1246. */
  1247. public function preInsert(PropelPDO $con = null)
  1248. {
  1249. $this->setCreatedAt(time());
  1250. return true;
  1251. }
  1252. /**
  1253. * Code to be run after inserting to database
  1254. * @param PropelPDO $con
  1255. */
  1256. public function postInsert(PropelPDO $con = null)
  1257. {
  1258. kQueryCache::invalidateQueryCache($this);
  1259. kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
  1260. if($this->copiedFrom)
  1261. kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
  1262. }
  1263. /**
  1264. * Code to be run after updating the object in database
  1265. * @param PropelPDO $con
  1266. */
  1267. public function postUpdate(PropelPDO $con = null)
  1268. {
  1269. if ($this->alreadyInSave)
  1270. {
  1271. return;
  1272. }
  1273. if($this->isModified())
  1274. {
  1275. kQueryCache::invalidateQueryCache($this);
  1276. kEventsManager::raiseEvent(new kObjectChangedEvent($this, $this->tempModifiedColumns));
  1277. }
  1278. $this->tempModifiedColumns = array();
  1279. }
  1280. /**
  1281. * Saves the modified columns temporarily while saving
  1282. * @var array
  1283. */
  1284. private $tempModifiedColumns = array();
  1285. /**
  1286. * Returns whether the object has been modified.
  1287. *
  1288. * @return boolean True if the object has been modified.
  1289. */
  1290. public function isModified()
  1291. {
  1292. if(!empty($this->tempModifiedColumns))
  1293. return true;
  1294. return !empty($this->modifiedColumns);
  1295. }
  1296. /**
  1297. * Has specified column been modified?
  1298. *
  1299. * @param string $col
  1300. * @return boolean True if $col has been modified.
  1301. */
  1302. public function isColumnModified($col)
  1303. {
  1304. if(in_array($col, $this->tempModifiedColumns))
  1305. return true;
  1306. return in_array($col, $this->modifiedColumns);
  1307. }
  1308. /**
  1309. * Code to be run before updating the object in database
  1310. * @param PropelPDO $con
  1311. * @return boolean
  1312. */
  1313. public function preUpdate(PropelPDO $con = null)
  1314. {
  1315. if ($this->alreadyInSave)
  1316. {
  1317. return true;
  1318. }
  1319. $this->tempModifiedColumns = $this->modifiedColumns;
  1320. return true;
  1321. }
  1322. /**
  1323. * Array of ValidationFailed objects.
  1324. * @var array ValidationFailed[]
  1325. */
  1326. protected $validationFailures = array();
  1327. /**
  1328. * Gets any ValidationFailed objects that resulted from last call to validate().
  1329. *
  1330. *
  1331. * @return array ValidationFailed[]
  1332. * @see validate()
  1333. */
  1334. public function getValidationFailures()
  1335. {
  1336. return $this->validationFailures;
  1337. }
  1338. /**
  1339. * Validates the objects modified field values and all objects related to this table.
  1340. *
  1341. * If $columns is either a column name or an array of column names
  1342. * only those columns are validated.
  1343. *
  1344. * @param mixed $columns Column name or an array of column names.
  1345. * @return boolean Whether all columns pass validation.
  1346. * @see doValidate()
  1347. * @see getValidationFailures()
  1348. */
  1349. public function validate($columns = null)
  1350. {
  1351. $res = $this->doValidate($columns);
  1352. if ($res === true) {
  1353. $this->validationFailures = array();
  1354. return true;
  1355. } else {
  1356. $this->validationFailures = $res;
  1357. return false;
  1358. }
  1359. }
  1360. /**
  1361. * This function performs the validation work for complex object models.
  1362. *
  1363. * In addition to checking the current object, all related objects will
  1364. * also be validated. If all pass then <code>true</code> is returned; otherwise
  1365. * an aggreagated array of ValidationFailed objects will be returned.
  1366. *
  1367. * @param array $columns Array of column names to validate.
  1368. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  1369. */
  1370. protected function doValidate($columns = null)
  1371. {
  1372. if (!$this->alreadyInValidation) {
  1373. $this->alreadyInValidation = true;
  1374. $retval = null;
  1375. $failureMap = array();
  1376. if (($retval = syndicationFeedPeer::doValidate($this, $columns)) !== true) {
  1377. $failureMap = array_merge($failureMap, $retval);
  1378. }
  1379. $this->alreadyInValidation = false;
  1380. }
  1381. return (!empty($failureMap) ? $failureMap : true);
  1382. }
  1383. /**
  1384. * Retrieves a field from the object by name passed in as a string.
  1385. *
  1386. * @param string $name name
  1387. * @param string $type The type of fieldname the $name is of:
  1388. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1389. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1390. * @return mixed Value of field.
  1391. */
  1392. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  1393. {
  1394. $pos = syndicationFeedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1395. $field = $this->getByPosition($pos);
  1396. return $field;
  1397. }
  1398. /**
  1399. * Retrieves a field from the object by Position as specified in the xml schema.
  1400. * Zero-based.
  1401. *
  1402. * @param int $pos position in xml schema
  1403. * @return mixed Value of field at $pos
  1404. */
  1405. public function getByPosition($pos)
  1406. {
  1407. switch($pos) {
  1408. case 0:
  1409. return $this->getId();
  1410. break;
  1411. case 1:
  1412. return $this->getIntId();
  1413. break;
  1414. case 2:
  1415. return $this->getPartnerId();
  1416. break;
  1417. case 3:
  1418. return $this->getPlaylistId();
  1419. break;
  1420. case 4:
  1421. return $this->getName();
  1422. break;
  1423. case 5:
  1424. return $this->getStatus();
  1425. break;
  1426. case 6:
  1427. return $this->getType();
  1428. break;
  1429. case 7:
  1430. return $this->getLandingPage();
  1431. break;
  1432. case 8:
  1433. return $this->getFlavorParamId();
  1434. break;
  1435. case 9:
  1436. return $this->getPlayerUiconfId();
  1437. break;
  1438. case 10:
  1439. return $this->getAllowEmbed();
  1440. break;
  1441. case 11:
  1442. return $this->getAdultContent();
  1443. break;
  1444. case 12:
  1445. return $this->getTranscodeExistingContent();
  1446. break;
  1447. case 13:
  1448. return $this->getAddToDefaultConversionProfile();
  1449. break;
  1450. case 14:
  1451. return $this->getCategories();
  1452. break;
  1453. case 15:
  1454. return $this->getFeedDescription();
  1455. break;
  1456. case 16:
  1457. return $this->getLanguage();
  1458. break;
  1459. case 17:
  1460. return $this->getFeedLandingPage();
  1461. break;
  1462. case 18:
  1463. return $this->getOwnerName();
  1464. break;
  1465. case 19:
  1466. return $this->getOwnerEmail();
  1467. break;
  1468. case 20:
  1469. return $this->getFeedImageUrl();
  1470. break;
  1471. case 21:
  1472. return $this->getFeedAuthor();
  1473. break;
  1474. case 22:
  1475. return $this->getCreatedAt();
  1476. break;
  1477. case 23:
  1478. return $this->getCustomData();
  1479. break;
  1480. case 24:
  1481. return $this->getDisplayInSearch();
  1482. break;
  1483. default:
  1484. return null;
  1485. break;
  1486. } // switch()
  1487. }
  1488. /**
  1489. * Exports the object as an array.
  1490. *
  1491. * You can specify the key type of the array by passing one of the class
  1492. * type constants.
  1493. *
  1494. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1495. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  1496. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  1497. * @return an associative array containing the field names (as keys) and field values
  1498. */
  1499. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  1500. {
  1501. $keys = syndicationFeedPeer::getFieldNames($keyType);
  1502. $result = array(
  1503. $keys[0] => $this->getId(),
  1504. $keys[1] => $this->getIntId(),
  1505. $keys[2] => $this->getPartnerId(),
  1506. $keys[3] => $this->getPlaylistId(),
  1507. $keys[4] => $this->getName(),
  1508. $keys[5] => $this->getStatus(),
  1509. $keys[6] => $this->getType(),
  1510. $keys[7] => $this->getLandingPage(),
  1511. $keys[8] => $this->getFlavorParamId(),
  1512. $keys[9] => $this->getPlayerUiconfId(),
  1513. $keys[10] => $this->getAllowEmbed(),
  1514. $keys[11] => $this->getAdultContent(),
  1515. $keys[12] => $this->getTranscodeExistingContent(),
  1516. $keys[13] => $this->getAddToDefaultConversionProfile(),
  1517. $keys[14] => $this->getCategories(),
  1518. $keys[15] => $this->getFeedDescription(),
  1519. $keys[16] => $this->getLanguage(),
  1520. $keys[17] => $this->getFeedLandingPage(),
  1521. $keys[18] => $this->getOwnerName(),
  1522. $keys[19] => $this->getOwnerEmail(),
  1523. $keys[20] => $this->getFeedImageUrl(),
  1524. $keys[21] => $this->getFeedAuthor(),
  1525. $keys[22] => $this->getCreatedAt(),
  1526. $keys[23] => $this->getCustomData(),
  1527. $keys[24] => $this->getDisplayInSearch(),
  1528. );
  1529. return $result;
  1530. }
  1531. /**
  1532. * Sets a field from the object by name passed in as a string.
  1533. *
  1534. * @param string $name peer name
  1535. * @param mixed $value field value
  1536. * @param string $type The type of fieldname the $name is of:
  1537. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1538. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1539. * @return void
  1540. */
  1541. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  1542. {
  1543. $pos = syndicationFeedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1544. return $this->setByPosition($pos, $value);
  1545. }
  1546. /**
  1547. * Sets a field from the object by Position as specified in the xml schema.
  1548. * Zero-based.
  1549. *
  1550. * @param int $pos position in xml schema
  1551. * @param mixed $value field value
  1552. * @return void
  1553. */
  1554. public function setByPosition($pos, $value)
  1555. {
  1556. switch($pos) {
  1557. case 0:
  1558. $this->setId($value);
  1559. break;
  1560. case 1:
  1561. $this->setIntId($value);
  1562. break;
  1563. case 2:
  1564. $this->setPartnerId($value);
  1565. break;
  1566. case 3:
  1567. $this->setPlaylistId($value);
  1568. break;
  1569. case 4:
  1570. $this->setName($value);
  1571. break;
  1572. case 5:
  1573. $this->setStatus($value);
  1574. break;
  1575. case 6:
  1576. $this->setType($value);
  1577. break;
  1578. case 7:
  1579. $this->setLandingPage($value);
  1580. break;
  1581. case 8:
  1582. $this->setFlavorParamId($value);
  1583. break;
  1584. case 9:
  1585. $this->setPlayerUiconfId($value);
  1586. break;
  1587. case 10:
  1588. $this->setAllowEmbed($value);
  1589. break;
  1590. case 11:
  1591. $this->setAdultContent($value);
  1592. break;
  1593. case 12:
  1594. $this->setTranscodeExistingContent($value);
  1595. break;
  1596. case 13:
  1597. $this->setAddToDefaultConversionProfile($value);
  1598. break;
  1599. case 14:
  1600. $this->setCategories($value);
  1601. break;
  1602. case 15:
  1603. $this->setFeedDescription($value);
  1604. break;
  1605. case 16:
  1606. $this->setLanguage($value);
  1607. break;
  1608. case 17:
  1609. $this->setFeedLandingPage($value);
  1610. break;
  1611. case 18:
  1612. $this->setOwnerName($value);
  1613. break;
  1614. case 19:
  1615. $this->setOwnerEmail($value);
  1616. break;
  1617. case 20:
  1618. $this->setFeedImageUrl($value);
  1619. break;
  1620. case 21:
  1621. $this->setFeedAuthor($value);
  1622. break;
  1623. case 22:
  1624. $this->setCreatedAt($value);
  1625. break;
  1626. case 23:
  1627. $this->setCustomData($value);
  1628. break;
  1629. case 24:
  1630. $this->setDisplayInSearch($value);
  1631. break;
  1632. } // switch()
  1633. }
  1634. /**
  1635. * Populates the object using an array.
  1636. *
  1637. * This is particularly useful when populating an object from one of the
  1638. * request arrays (e.g. $_POST). This method goes through the column
  1639. * names, checking to see whether a matching key exists in populated
  1640. * array. If so the setByName() method is called for that column.
  1641. *
  1642. * You can specify the key type of the array by additionally passing one
  1643. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  1644. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  1645. * The default key type is the column's phpname (e.g. 'AuthorId')
  1646. *
  1647. * @param array $arr An array to populate the object from.
  1648. * @param string $keyType The type of keys the array uses.
  1649. * @return void
  1650. */
  1651. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  1652. {
  1653. $keys = syndicationFeedPeer::getFieldNames($keyType);
  1654. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  1655. if (array_key_exists($keys[1], $arr)) $this->setIntId($arr[$keys[1]]);
  1656. if (array_key_exists($keys[2], $arr)) $this->setPartnerId($arr[$keys[2]]);
  1657. if (array_key_exists($keys[3], $arr)) $this->setPlaylistId($arr[$keys[3]]);
  1658. if (array_key_exists($keys[4], $arr)) $this->setName($arr[$keys[4]]);
  1659. if (array_key_exists($keys[5], $arr)) $this->setStatus($arr[$keys[5]]);
  1660. if (array_key_exists($keys[6], $arr)) $this->setType($arr[$keys[6]]);
  1661. if (array_key_exists($keys[7], $arr)) $this->setLandingPage($arr[$keys[7]]);
  1662. if (array_key_exists($keys[8], $arr)) $this->setFlavorParamId($arr[$keys[8]]);
  1663. if (array_key_exists($keys[9], $arr)) $this->setPlayerUiconfId($arr[$keys[9]]);
  1664. if (array_key_exists($keys[10], $arr)) $this->setAllowEmbed($arr[$keys[10]]);
  1665. if (array_key_exists($keys[11], $arr)) $this->setAdultContent($arr[$keys[

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