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

/package/app/app/plugins/mysql_search/lib/model/om/BaseSearchEntry.php

https://bitbucket.org/pandaos/kaltura
PHP | 2711 lines | 1457 code | 340 blank | 914 comment | 278 complexity | df2ace71244273bca1f897ea464e0fd7 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 'search_entry' table.
  4. *
  5. *
  6. *
  7. * @package plugins.contentDistribution
  8. * @subpackage model.om
  9. */
  10. abstract class BaseSearchEntry 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 SearchEntryPeer
  16. */
  17. protected static $peer;
  18. /**
  19. * The value for the entry_id field.
  20. * @var string
  21. */
  22. protected $entry_id;
  23. /**
  24. * The value for the kuser_id field.
  25. * @var int
  26. */
  27. protected $kuser_id;
  28. /**
  29. * The value for the name field.
  30. * @var string
  31. */
  32. protected $name;
  33. /**
  34. * The value for the type field.
  35. * @var int
  36. */
  37. protected $type;
  38. /**
  39. * The value for the media_type field.
  40. * @var int
  41. */
  42. protected $media_type;
  43. /**
  44. * The value for the views field.
  45. * Note: this column has a database default value of: 0
  46. * @var int
  47. */
  48. protected $views;
  49. /**
  50. * The value for the rank field.
  51. * Note: this column has a database default value of: 0
  52. * @var int
  53. */
  54. protected $rank;
  55. /**
  56. * The value for the tags field.
  57. * @var string
  58. */
  59. protected $tags;
  60. /**
  61. * The value for the entry_status field.
  62. * @var int
  63. */
  64. protected $entry_status;
  65. /**
  66. * The value for the source_link field.
  67. * @var string
  68. */
  69. protected $source_link;
  70. /**
  71. * The value for the duration field.
  72. * Note: this column has a database default value of: 0
  73. * @var int
  74. */
  75. protected $duration;
  76. /**
  77. * The value for the duration_type field.
  78. * @var string
  79. */
  80. protected $duration_type;
  81. /**
  82. * The value for the created_at field.
  83. * @var string
  84. */
  85. protected $created_at;
  86. /**
  87. * The value for the updated_at field.
  88. * @var string
  89. */
  90. protected $updated_at;
  91. /**
  92. * The value for the partner_id field.
  93. * Note: this column has a database default value of: 0
  94. * @var int
  95. */
  96. protected $partner_id;
  97. /**
  98. * The value for the display_in_search field.
  99. * @var int
  100. */
  101. protected $display_in_search;
  102. /**
  103. * The value for the group_id field.
  104. * @var string
  105. */
  106. protected $group_id;
  107. /**
  108. * The value for the plays field.
  109. * Note: this column has a database default value of: 0
  110. * @var int
  111. */
  112. protected $plays;
  113. /**
  114. * The value for the description field.
  115. * @var string
  116. */
  117. protected $description;
  118. /**
  119. * The value for the media_date field.
  120. * @var string
  121. */
  122. protected $media_date;
  123. /**
  124. * The value for the admin_tags field.
  125. * @var string
  126. */
  127. protected $admin_tags;
  128. /**
  129. * The value for the moderation_status field.
  130. * @var int
  131. */
  132. protected $moderation_status;
  133. /**
  134. * The value for the moderation_count field.
  135. * @var int
  136. */
  137. protected $moderation_count;
  138. /**
  139. * The value for the modified_at field.
  140. * @var string
  141. */
  142. protected $modified_at;
  143. /**
  144. * The value for the access_control_id field.
  145. * @var int
  146. */
  147. protected $access_control_id;
  148. /**
  149. * The value for the categories field.
  150. * @var string
  151. */
  152. protected $categories;
  153. /**
  154. * The value for the start_date field.
  155. * @var string
  156. */
  157. protected $start_date;
  158. /**
  159. * The value for the end_date field.
  160. * @var string
  161. */
  162. protected $end_date;
  163. /**
  164. * The value for the flavor_params field.
  165. * @var string
  166. */
  167. protected $flavor_params;
  168. /**
  169. * The value for the available_from field.
  170. * @var string
  171. */
  172. protected $available_from;
  173. /**
  174. * The value for the plugin_data field.
  175. * @var string
  176. */
  177. protected $plugin_data;
  178. /**
  179. * Flag to prevent endless save loop, if this object is referenced
  180. * by another object which falls in this transaction.
  181. * @var boolean
  182. */
  183. protected $alreadyInSave = false;
  184. /**
  185. * Flag to prevent endless validation loop, if this object is referenced
  186. * by another object which falls in this transaction.
  187. * @var boolean
  188. */
  189. protected $alreadyInValidation = false;
  190. /**
  191. * Store columns old values before the changes
  192. * @var array
  193. */
  194. protected $oldColumnsValues = array();
  195. /**
  196. * @return array
  197. */
  198. public function getColumnsOldValues()
  199. {
  200. return $this->oldColumnsValues;
  201. }
  202. /**
  203. * Applies default values to this object.
  204. * This method should be called from the object's constructor (or
  205. * equivalent initialization method).
  206. * @see __construct()
  207. */
  208. public function applyDefaultValues()
  209. {
  210. $this->views = 0;
  211. $this->rank = 0;
  212. $this->duration = 0;
  213. $this->partner_id = 0;
  214. $this->plays = 0;
  215. }
  216. /**
  217. * Initializes internal state of BaseSearchEntry object.
  218. * @see applyDefaults()
  219. */
  220. public function __construct()
  221. {
  222. parent::__construct();
  223. $this->applyDefaultValues();
  224. }
  225. /**
  226. * Get the [entry_id] column value.
  227. *
  228. * @return string
  229. */
  230. public function getEntryId()
  231. {
  232. return $this->entry_id;
  233. }
  234. /**
  235. * Get the [kuser_id] column value.
  236. *
  237. * @return int
  238. */
  239. public function getKuserId()
  240. {
  241. return $this->kuser_id;
  242. }
  243. /**
  244. * Get the [name] column value.
  245. *
  246. * @return string
  247. */
  248. public function getName()
  249. {
  250. return $this->name;
  251. }
  252. /**
  253. * Get the [type] column value.
  254. *
  255. * @return int
  256. */
  257. public function getType()
  258. {
  259. return $this->type;
  260. }
  261. /**
  262. * Get the [media_type] column value.
  263. *
  264. * @return int
  265. */
  266. public function getMediaType()
  267. {
  268. return $this->media_type;
  269. }
  270. /**
  271. * Get the [views] column value.
  272. *
  273. * @return int
  274. */
  275. public function getViews()
  276. {
  277. return $this->views;
  278. }
  279. /**
  280. * Get the [rank] column value.
  281. *
  282. * @return int
  283. */
  284. public function getRank()
  285. {
  286. return $this->rank;
  287. }
  288. /**
  289. * Get the [tags] column value.
  290. *
  291. * @return string
  292. */
  293. public function getTags()
  294. {
  295. return $this->tags;
  296. }
  297. /**
  298. * Get the [entry_status] column value.
  299. *
  300. * @return int
  301. */
  302. public function getEntryStatus()
  303. {
  304. return $this->entry_status;
  305. }
  306. /**
  307. * Get the [source_link] column value.
  308. *
  309. * @return string
  310. */
  311. public function getSourceLink()
  312. {
  313. return $this->source_link;
  314. }
  315. /**
  316. * Get the [duration] column value.
  317. *
  318. * @return int
  319. */
  320. public function getDuration()
  321. {
  322. return $this->duration;
  323. }
  324. /**
  325. * Get the [duration_type] column value.
  326. *
  327. * @return string
  328. */
  329. public function getDurationType()
  330. {
  331. return $this->duration_type;
  332. }
  333. /**
  334. * Get the [optionally formatted] temporal [created_at] column value.
  335. *
  336. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  337. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  338. *
  339. * @param string $format The date/time format string (either date()-style or strftime()-style).
  340. * If format is NULL, then the raw unix timestamp integer will be returned.
  341. * @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
  342. * @throws PropelException - if unable to parse/validate the date/time value.
  343. */
  344. public function getCreatedAt($format = 'Y-m-d H:i:s')
  345. {
  346. if ($this->created_at === null) {
  347. return null;
  348. }
  349. if ($this->created_at === '0000-00-00 00:00:00') {
  350. // while technically this is not a default value of NULL,
  351. // this seems to be closest in meaning.
  352. return null;
  353. } else {
  354. try {
  355. $dt = new DateTime($this->created_at);
  356. } catch (Exception $x) {
  357. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
  358. }
  359. }
  360. if ($format === null) {
  361. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  362. return (int) $dt->format('U');
  363. } elseif (strpos($format, '%') !== false) {
  364. return strftime($format, $dt->format('U'));
  365. } else {
  366. return $dt->format($format);
  367. }
  368. }
  369. /**
  370. * Get the [optionally formatted] temporal [updated_at] column value.
  371. *
  372. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  373. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  374. *
  375. * @param string $format The date/time format string (either date()-style or strftime()-style).
  376. * If format is NULL, then the raw unix timestamp integer will be returned.
  377. * @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
  378. * @throws PropelException - if unable to parse/validate the date/time value.
  379. */
  380. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  381. {
  382. if ($this->updated_at === null) {
  383. return null;
  384. }
  385. if ($this->updated_at === '0000-00-00 00:00:00') {
  386. // while technically this is not a default value of NULL,
  387. // this seems to be closest in meaning.
  388. return null;
  389. } else {
  390. try {
  391. $dt = new DateTime($this->updated_at);
  392. } catch (Exception $x) {
  393. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
  394. }
  395. }
  396. if ($format === null) {
  397. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  398. return (int) $dt->format('U');
  399. } elseif (strpos($format, '%') !== false) {
  400. return strftime($format, $dt->format('U'));
  401. } else {
  402. return $dt->format($format);
  403. }
  404. }
  405. /**
  406. * Get the [partner_id] column value.
  407. *
  408. * @return int
  409. */
  410. public function getPartnerId()
  411. {
  412. return $this->partner_id;
  413. }
  414. /**
  415. * Get the [display_in_search] column value.
  416. *
  417. * @return int
  418. */
  419. public function getDisplayInSearch()
  420. {
  421. return $this->display_in_search;
  422. }
  423. /**
  424. * Get the [group_id] column value.
  425. *
  426. * @return string
  427. */
  428. public function getGroupId()
  429. {
  430. return $this->group_id;
  431. }
  432. /**
  433. * Get the [plays] column value.
  434. *
  435. * @return int
  436. */
  437. public function getPlays()
  438. {
  439. return $this->plays;
  440. }
  441. /**
  442. * Get the [description] column value.
  443. *
  444. * @return string
  445. */
  446. public function getDescription()
  447. {
  448. return $this->description;
  449. }
  450. /**
  451. * Get the [optionally formatted] temporal [media_date] column value.
  452. *
  453. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  454. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  455. *
  456. * @param string $format The date/time format string (either date()-style or strftime()-style).
  457. * If format is NULL, then the raw unix timestamp integer will be returned.
  458. * @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
  459. * @throws PropelException - if unable to parse/validate the date/time value.
  460. */
  461. public function getMediaDate($format = 'Y-m-d H:i:s')
  462. {
  463. if ($this->media_date === null) {
  464. return null;
  465. }
  466. if ($this->media_date === '0000-00-00 00:00:00') {
  467. // while technically this is not a default value of NULL,
  468. // this seems to be closest in meaning.
  469. return null;
  470. } else {
  471. try {
  472. $dt = new DateTime($this->media_date);
  473. } catch (Exception $x) {
  474. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->media_date, true), $x);
  475. }
  476. }
  477. if ($format === null) {
  478. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  479. return (int) $dt->format('U');
  480. } elseif (strpos($format, '%') !== false) {
  481. return strftime($format, $dt->format('U'));
  482. } else {
  483. return $dt->format($format);
  484. }
  485. }
  486. /**
  487. * Get the [admin_tags] column value.
  488. *
  489. * @return string
  490. */
  491. public function getAdminTags()
  492. {
  493. return $this->admin_tags;
  494. }
  495. /**
  496. * Get the [moderation_status] column value.
  497. *
  498. * @return int
  499. */
  500. public function getModerationStatus()
  501. {
  502. return $this->moderation_status;
  503. }
  504. /**
  505. * Get the [moderation_count] column value.
  506. *
  507. * @return int
  508. */
  509. public function getModerationCount()
  510. {
  511. return $this->moderation_count;
  512. }
  513. /**
  514. * Get the [optionally formatted] temporal [modified_at] column value.
  515. *
  516. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  517. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  518. *
  519. * @param string $format The date/time format string (either date()-style or strftime()-style).
  520. * If format is NULL, then the raw unix timestamp integer will be returned.
  521. * @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
  522. * @throws PropelException - if unable to parse/validate the date/time value.
  523. */
  524. public function getModifiedAt($format = 'Y-m-d H:i:s')
  525. {
  526. if ($this->modified_at === null) {
  527. return null;
  528. }
  529. if ($this->modified_at === '0000-00-00 00:00:00') {
  530. // while technically this is not a default value of NULL,
  531. // this seems to be closest in meaning.
  532. return null;
  533. } else {
  534. try {
  535. $dt = new DateTime($this->modified_at);
  536. } catch (Exception $x) {
  537. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->modified_at, true), $x);
  538. }
  539. }
  540. if ($format === null) {
  541. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  542. return (int) $dt->format('U');
  543. } elseif (strpos($format, '%') !== false) {
  544. return strftime($format, $dt->format('U'));
  545. } else {
  546. return $dt->format($format);
  547. }
  548. }
  549. /**
  550. * Get the [access_control_id] column value.
  551. *
  552. * @return int
  553. */
  554. public function getAccessControlId()
  555. {
  556. return $this->access_control_id;
  557. }
  558. /**
  559. * Get the [categories] column value.
  560. *
  561. * @return string
  562. */
  563. public function getCategories()
  564. {
  565. return $this->categories;
  566. }
  567. /**
  568. * Get the [optionally formatted] temporal [start_date] column value.
  569. *
  570. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  571. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  572. *
  573. * @param string $format The date/time format string (either date()-style or strftime()-style).
  574. * If format is NULL, then the raw unix timestamp integer will be returned.
  575. * @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
  576. * @throws PropelException - if unable to parse/validate the date/time value.
  577. */
  578. public function getStartDate($format = 'Y-m-d H:i:s')
  579. {
  580. if ($this->start_date === null) {
  581. return null;
  582. }
  583. if ($this->start_date === '0000-00-00 00:00:00') {
  584. // while technically this is not a default value of NULL,
  585. // this seems to be closest in meaning.
  586. return null;
  587. } else {
  588. try {
  589. $dt = new DateTime($this->start_date);
  590. } catch (Exception $x) {
  591. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_date, true), $x);
  592. }
  593. }
  594. if ($format === null) {
  595. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  596. return (int) $dt->format('U');
  597. } elseif (strpos($format, '%') !== false) {
  598. return strftime($format, $dt->format('U'));
  599. } else {
  600. return $dt->format($format);
  601. }
  602. }
  603. /**
  604. * Get the [optionally formatted] temporal [end_date] column value.
  605. *
  606. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  607. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  608. *
  609. * @param string $format The date/time format string (either date()-style or strftime()-style).
  610. * If format is NULL, then the raw unix timestamp integer will be returned.
  611. * @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
  612. * @throws PropelException - if unable to parse/validate the date/time value.
  613. */
  614. public function getEndDate($format = 'Y-m-d H:i:s')
  615. {
  616. if ($this->end_date === null) {
  617. return null;
  618. }
  619. if ($this->end_date === '0000-00-00 00:00:00') {
  620. // while technically this is not a default value of NULL,
  621. // this seems to be closest in meaning.
  622. return null;
  623. } else {
  624. try {
  625. $dt = new DateTime($this->end_date);
  626. } catch (Exception $x) {
  627. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->end_date, true), $x);
  628. }
  629. }
  630. if ($format === null) {
  631. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  632. return (int) $dt->format('U');
  633. } elseif (strpos($format, '%') !== false) {
  634. return strftime($format, $dt->format('U'));
  635. } else {
  636. return $dt->format($format);
  637. }
  638. }
  639. /**
  640. * Get the [flavor_params] column value.
  641. *
  642. * @return string
  643. */
  644. public function getFlavorParams()
  645. {
  646. return $this->flavor_params;
  647. }
  648. /**
  649. * Get the [optionally formatted] temporal [available_from] column value.
  650. *
  651. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  652. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  653. *
  654. * @param string $format The date/time format string (either date()-style or strftime()-style).
  655. * If format is NULL, then the raw unix timestamp integer will be returned.
  656. * @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
  657. * @throws PropelException - if unable to parse/validate the date/time value.
  658. */
  659. public function getAvailableFrom($format = 'Y-m-d H:i:s')
  660. {
  661. if ($this->available_from === null) {
  662. return null;
  663. }
  664. if ($this->available_from === '0000-00-00 00:00:00') {
  665. // while technically this is not a default value of NULL,
  666. // this seems to be closest in meaning.
  667. return null;
  668. } else {
  669. try {
  670. $dt = new DateTime($this->available_from);
  671. } catch (Exception $x) {
  672. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->available_from, true), $x);
  673. }
  674. }
  675. if ($format === null) {
  676. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  677. return (int) $dt->format('U');
  678. } elseif (strpos($format, '%') !== false) {
  679. return strftime($format, $dt->format('U'));
  680. } else {
  681. return $dt->format($format);
  682. }
  683. }
  684. /**
  685. * Get the [plugin_data] column value.
  686. *
  687. * @return string
  688. */
  689. public function getPluginData()
  690. {
  691. return $this->plugin_data;
  692. }
  693. /**
  694. * Set the value of [entry_id] column.
  695. *
  696. * @param string $v new value
  697. * @return SearchEntry The current object (for fluent API support)
  698. */
  699. public function setEntryId($v)
  700. {
  701. if(!isset($this->oldColumnsValues[SearchEntryPeer::ENTRY_ID]))
  702. $this->oldColumnsValues[SearchEntryPeer::ENTRY_ID] = $this->entry_id;
  703. if ($v !== null) {
  704. $v = (string) $v;
  705. }
  706. if ($this->entry_id !== $v) {
  707. $this->entry_id = $v;
  708. $this->modifiedColumns[] = SearchEntryPeer::ENTRY_ID;
  709. }
  710. return $this;
  711. } // setEntryId()
  712. /**
  713. * Set the value of [kuser_id] column.
  714. *
  715. * @param int $v new value
  716. * @return SearchEntry The current object (for fluent API support)
  717. */
  718. public function setKuserId($v)
  719. {
  720. if(!isset($this->oldColumnsValues[SearchEntryPeer::KUSER_ID]))
  721. $this->oldColumnsValues[SearchEntryPeer::KUSER_ID] = $this->kuser_id;
  722. if ($v !== null) {
  723. $v = (int) $v;
  724. }
  725. if ($this->kuser_id !== $v) {
  726. $this->kuser_id = $v;
  727. $this->modifiedColumns[] = SearchEntryPeer::KUSER_ID;
  728. }
  729. return $this;
  730. } // setKuserId()
  731. /**
  732. * Set the value of [name] column.
  733. *
  734. * @param string $v new value
  735. * @return SearchEntry The current object (for fluent API support)
  736. */
  737. public function setName($v)
  738. {
  739. if(!isset($this->oldColumnsValues[SearchEntryPeer::NAME]))
  740. $this->oldColumnsValues[SearchEntryPeer::NAME] = $this->name;
  741. if ($v !== null) {
  742. $v = (string) $v;
  743. }
  744. if ($this->name !== $v) {
  745. $this->name = $v;
  746. $this->modifiedColumns[] = SearchEntryPeer::NAME;
  747. }
  748. return $this;
  749. } // setName()
  750. /**
  751. * Set the value of [type] column.
  752. *
  753. * @param int $v new value
  754. * @return SearchEntry The current object (for fluent API support)
  755. */
  756. public function setType($v)
  757. {
  758. if(!isset($this->oldColumnsValues[SearchEntryPeer::TYPE]))
  759. $this->oldColumnsValues[SearchEntryPeer::TYPE] = $this->type;
  760. if ($v !== null) {
  761. $v = (int) $v;
  762. }
  763. if ($this->type !== $v) {
  764. $this->type = $v;
  765. $this->modifiedColumns[] = SearchEntryPeer::TYPE;
  766. }
  767. return $this;
  768. } // setType()
  769. /**
  770. * Set the value of [media_type] column.
  771. *
  772. * @param int $v new value
  773. * @return SearchEntry The current object (for fluent API support)
  774. */
  775. public function setMediaType($v)
  776. {
  777. if(!isset($this->oldColumnsValues[SearchEntryPeer::MEDIA_TYPE]))
  778. $this->oldColumnsValues[SearchEntryPeer::MEDIA_TYPE] = $this->media_type;
  779. if ($v !== null) {
  780. $v = (int) $v;
  781. }
  782. if ($this->media_type !== $v) {
  783. $this->media_type = $v;
  784. $this->modifiedColumns[] = SearchEntryPeer::MEDIA_TYPE;
  785. }
  786. return $this;
  787. } // setMediaType()
  788. /**
  789. * Set the value of [views] column.
  790. *
  791. * @param int $v new value
  792. * @return SearchEntry The current object (for fluent API support)
  793. */
  794. public function setViews($v)
  795. {
  796. if(!isset($this->oldColumnsValues[SearchEntryPeer::VIEWS]))
  797. $this->oldColumnsValues[SearchEntryPeer::VIEWS] = $this->views;
  798. if ($v !== null) {
  799. $v = (int) $v;
  800. }
  801. if ($this->views !== $v || $this->isNew()) {
  802. $this->views = $v;
  803. $this->modifiedColumns[] = SearchEntryPeer::VIEWS;
  804. }
  805. return $this;
  806. } // setViews()
  807. /**
  808. * Set the value of [rank] column.
  809. *
  810. * @param int $v new value
  811. * @return SearchEntry The current object (for fluent API support)
  812. */
  813. public function setRank($v)
  814. {
  815. if(!isset($this->oldColumnsValues[SearchEntryPeer::RANK]))
  816. $this->oldColumnsValues[SearchEntryPeer::RANK] = $this->rank;
  817. if ($v !== null) {
  818. $v = (int) $v;
  819. }
  820. if ($this->rank !== $v || $this->isNew()) {
  821. $this->rank = $v;
  822. $this->modifiedColumns[] = SearchEntryPeer::RANK;
  823. }
  824. return $this;
  825. } // setRank()
  826. /**
  827. * Set the value of [tags] column.
  828. *
  829. * @param string $v new value
  830. * @return SearchEntry The current object (for fluent API support)
  831. */
  832. public function setTags($v)
  833. {
  834. if(!isset($this->oldColumnsValues[SearchEntryPeer::TAGS]))
  835. $this->oldColumnsValues[SearchEntryPeer::TAGS] = $this->tags;
  836. if ($v !== null) {
  837. $v = (string) $v;
  838. }
  839. if ($this->tags !== $v) {
  840. $this->tags = $v;
  841. $this->modifiedColumns[] = SearchEntryPeer::TAGS;
  842. }
  843. return $this;
  844. } // setTags()
  845. /**
  846. * Set the value of [entry_status] column.
  847. *
  848. * @param int $v new value
  849. * @return SearchEntry The current object (for fluent API support)
  850. */
  851. public function setEntryStatus($v)
  852. {
  853. if(!isset($this->oldColumnsValues[SearchEntryPeer::ENTRY_STATUS]))
  854. $this->oldColumnsValues[SearchEntryPeer::ENTRY_STATUS] = $this->entry_status;
  855. if ($v !== null) {
  856. $v = (int) $v;
  857. }
  858. if ($this->entry_status !== $v) {
  859. $this->entry_status = $v;
  860. $this->modifiedColumns[] = SearchEntryPeer::ENTRY_STATUS;
  861. }
  862. return $this;
  863. } // setEntryStatus()
  864. /**
  865. * Set the value of [source_link] column.
  866. *
  867. * @param string $v new value
  868. * @return SearchEntry The current object (for fluent API support)
  869. */
  870. public function setSourceLink($v)
  871. {
  872. if(!isset($this->oldColumnsValues[SearchEntryPeer::SOURCE_LINK]))
  873. $this->oldColumnsValues[SearchEntryPeer::SOURCE_LINK] = $this->source_link;
  874. if ($v !== null) {
  875. $v = (string) $v;
  876. }
  877. if ($this->source_link !== $v) {
  878. $this->source_link = $v;
  879. $this->modifiedColumns[] = SearchEntryPeer::SOURCE_LINK;
  880. }
  881. return $this;
  882. } // setSourceLink()
  883. /**
  884. * Set the value of [duration] column.
  885. *
  886. * @param int $v new value
  887. * @return SearchEntry The current object (for fluent API support)
  888. */
  889. public function setDuration($v)
  890. {
  891. if(!isset($this->oldColumnsValues[SearchEntryPeer::DURATION]))
  892. $this->oldColumnsValues[SearchEntryPeer::DURATION] = $this->duration;
  893. if ($v !== null) {
  894. $v = (int) $v;
  895. }
  896. if ($this->duration !== $v || $this->isNew()) {
  897. $this->duration = $v;
  898. $this->modifiedColumns[] = SearchEntryPeer::DURATION;
  899. }
  900. return $this;
  901. } // setDuration()
  902. /**
  903. * Set the value of [duration_type] column.
  904. *
  905. * @param string $v new value
  906. * @return SearchEntry The current object (for fluent API support)
  907. */
  908. public function setDurationType($v)
  909. {
  910. if(!isset($this->oldColumnsValues[SearchEntryPeer::DURATION_TYPE]))
  911. $this->oldColumnsValues[SearchEntryPeer::DURATION_TYPE] = $this->duration_type;
  912. if ($v !== null) {
  913. $v = (string) $v;
  914. }
  915. if ($this->duration_type !== $v) {
  916. $this->duration_type = $v;
  917. $this->modifiedColumns[] = SearchEntryPeer::DURATION_TYPE;
  918. }
  919. return $this;
  920. } // setDurationType()
  921. /**
  922. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  923. *
  924. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  925. * be treated as NULL for temporal objects.
  926. * @return SearchEntry The current object (for fluent API support)
  927. */
  928. public function setCreatedAt($v)
  929. {
  930. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  931. // -- which is unexpected, to say the least.
  932. if ($v === null || $v === '') {
  933. $dt = null;
  934. } elseif ($v instanceof DateTime) {
  935. $dt = $v;
  936. } else {
  937. // some string/numeric value passed; we normalize that so that we can
  938. // validate it.
  939. try {
  940. if (is_numeric($v)) { // if it's a unix timestamp
  941. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  942. // We have to explicitly specify and then change the time zone because of a
  943. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  944. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  945. } else {
  946. $dt = new DateTime($v);
  947. }
  948. } catch (Exception $x) {
  949. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  950. }
  951. }
  952. if ( $this->created_at !== null || $dt !== null ) {
  953. // (nested ifs are a little easier to read in this case)
  954. $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  955. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  956. if ( ($currNorm !== $newNorm) // normalized values don't match
  957. )
  958. {
  959. $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  960. $this->modifiedColumns[] = SearchEntryPeer::CREATED_AT;
  961. }
  962. } // if either are not null
  963. return $this;
  964. } // setCreatedAt()
  965. /**
  966. * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
  967. *
  968. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  969. * be treated as NULL for temporal objects.
  970. * @return SearchEntry The current object (for fluent API support)
  971. */
  972. public function setUpdatedAt($v)
  973. {
  974. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  975. // -- which is unexpected, to say the least.
  976. if ($v === null || $v === '') {
  977. $dt = null;
  978. } elseif ($v instanceof DateTime) {
  979. $dt = $v;
  980. } else {
  981. // some string/numeric value passed; we normalize that so that we can
  982. // validate it.
  983. try {
  984. if (is_numeric($v)) { // if it's a unix timestamp
  985. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  986. // We have to explicitly specify and then change the time zone because of a
  987. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  988. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  989. } else {
  990. $dt = new DateTime($v);
  991. }
  992. } catch (Exception $x) {
  993. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  994. }
  995. }
  996. if ( $this->updated_at !== null || $dt !== null ) {
  997. // (nested ifs are a little easier to read in this case)
  998. $currNorm = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  999. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1000. if ( ($currNorm !== $newNorm) // normalized values don't match
  1001. )
  1002. {
  1003. $this->updated_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1004. $this->modifiedColumns[] = SearchEntryPeer::UPDATED_AT;
  1005. }
  1006. } // if either are not null
  1007. return $this;
  1008. } // setUpdatedAt()
  1009. /**
  1010. * Set the value of [partner_id] column.
  1011. *
  1012. * @param int $v new value
  1013. * @return SearchEntry The current object (for fluent API support)
  1014. */
  1015. public function setPartnerId($v)
  1016. {
  1017. if(!isset($this->oldColumnsValues[SearchEntryPeer::PARTNER_ID]))
  1018. $this->oldColumnsValues[SearchEntryPeer::PARTNER_ID] = $this->partner_id;
  1019. if ($v !== null) {
  1020. $v = (int) $v;
  1021. }
  1022. if ($this->partner_id !== $v || $this->isNew()) {
  1023. $this->partner_id = $v;
  1024. $this->modifiedColumns[] = SearchEntryPeer::PARTNER_ID;
  1025. }
  1026. return $this;
  1027. } // setPartnerId()
  1028. /**
  1029. * Set the value of [display_in_search] column.
  1030. *
  1031. * @param int $v new value
  1032. * @return SearchEntry The current object (for fluent API support)
  1033. */
  1034. public function setDisplayInSearch($v)
  1035. {
  1036. if(!isset($this->oldColumnsValues[SearchEntryPeer::DISPLAY_IN_SEARCH]))
  1037. $this->oldColumnsValues[SearchEntryPeer::DISPLAY_IN_SEARCH] = $this->display_in_search;
  1038. if ($v !== null) {
  1039. $v = (int) $v;
  1040. }
  1041. if ($this->display_in_search !== $v) {
  1042. $this->display_in_search = $v;
  1043. $this->modifiedColumns[] = SearchEntryPeer::DISPLAY_IN_SEARCH;
  1044. }
  1045. return $this;
  1046. } // setDisplayInSearch()
  1047. /**
  1048. * Set the value of [group_id] column.
  1049. *
  1050. * @param string $v new value
  1051. * @return SearchEntry The current object (for fluent API support)
  1052. */
  1053. public function setGroupId($v)
  1054. {
  1055. if(!isset($this->oldColumnsValues[SearchEntryPeer::GROUP_ID]))
  1056. $this->oldColumnsValues[SearchEntryPeer::GROUP_ID] = $this->group_id;
  1057. if ($v !== null) {
  1058. $v = (string) $v;
  1059. }
  1060. if ($this->group_id !== $v) {
  1061. $this->group_id = $v;
  1062. $this->modifiedColumns[] = SearchEntryPeer::GROUP_ID;
  1063. }
  1064. return $this;
  1065. } // setGroupId()
  1066. /**
  1067. * Set the value of [plays] column.
  1068. *
  1069. * @param int $v new value
  1070. * @return SearchEntry The current object (for fluent API support)
  1071. */
  1072. public function setPlays($v)
  1073. {
  1074. if(!isset($this->oldColumnsValues[SearchEntryPeer::PLAYS]))
  1075. $this->oldColumnsValues[SearchEntryPeer::PLAYS] = $this->plays;
  1076. if ($v !== null) {
  1077. $v = (int) $v;
  1078. }
  1079. if ($this->plays !== $v || $this->isNew()) {
  1080. $this->plays = $v;
  1081. $this->modifiedColumns[] = SearchEntryPeer::PLAYS;
  1082. }
  1083. return $this;
  1084. } // setPlays()
  1085. /**
  1086. * Set the value of [description] column.
  1087. *
  1088. * @param string $v new value
  1089. * @return SearchEntry The current object (for fluent API support)
  1090. */
  1091. public function setDescription($v)
  1092. {
  1093. if(!isset($this->oldColumnsValues[SearchEntryPeer::DESCRIPTION]))
  1094. $this->oldColumnsValues[SearchEntryPeer::DESCRIPTION] = $this->description;
  1095. if ($v !== null) {
  1096. $v = (string) $v;
  1097. }
  1098. if ($this->description !== $v) {
  1099. $this->description = $v;
  1100. $this->modifiedColumns[] = SearchEntryPeer::DESCRIPTION;
  1101. }
  1102. return $this;
  1103. } // setDescription()
  1104. /**
  1105. * Sets the value of [media_date] column to a normalized version of the date/time value specified.
  1106. *
  1107. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1108. * be treated as NULL for temporal objects.
  1109. * @return SearchEntry The current object (for fluent API support)
  1110. */
  1111. public function setMediaDate($v)
  1112. {
  1113. if(!isset($this->oldColumnsValues[SearchEntryPeer::MEDIA_DATE]))
  1114. $this->oldColumnsValues[SearchEntryPeer::MEDIA_DATE] = $this->media_date;
  1115. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1116. // -- which is unexpected, to say the least.
  1117. if ($v === null || $v === '') {
  1118. $dt = null;
  1119. } elseif ($v instanceof DateTime) {
  1120. $dt = $v;
  1121. } else {
  1122. // some string/numeric value passed; we normalize that so that we can
  1123. // validate it.
  1124. try {
  1125. if (is_numeric($v)) { // if it's a unix timestamp
  1126. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1127. // We have to explicitly specify and then change the time zone because of a
  1128. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1129. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1130. } else {
  1131. $dt = new DateTime($v);
  1132. }
  1133. } catch (Exception $x) {
  1134. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1135. }
  1136. }
  1137. if ( $this->media_date !== null || $dt !== null ) {
  1138. // (nested ifs are a little easier to read in this case)
  1139. $currNorm = ($this->media_date !== null && $tmpDt = new DateTime($this->media_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1140. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1141. if ( ($currNorm !== $newNorm) // normalized values don't match
  1142. )
  1143. {
  1144. $this->media_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1145. $this->modifiedColumns[] = SearchEntryPeer::MEDIA_DATE;
  1146. }
  1147. } // if either are not null
  1148. return $this;
  1149. } // setMediaDate()
  1150. /**
  1151. * Set the value of [admin_tags] column.
  1152. *
  1153. * @param string $v new value
  1154. * @return SearchEntry The current object (for fluent API support)
  1155. */
  1156. public function setAdminTags($v)
  1157. {
  1158. if(!isset($this->oldColumnsValues[SearchEntryPeer::ADMIN_TAGS]))
  1159. $this->oldColumnsValues[SearchEntryPeer::ADMIN_TAGS] = $this->admin_tags;
  1160. if ($v !== null) {
  1161. $v = (string) $v;
  1162. }
  1163. if ($this->admin_tags !== $v) {
  1164. $this->admin_tags = $v;
  1165. $this->modifiedColumns[] = SearchEntryPeer::ADMIN_TAGS;
  1166. }
  1167. return $this;
  1168. } // setAdminTags()
  1169. /**
  1170. * Set the value of [moderation_status] column.
  1171. *
  1172. * @param int $v new value
  1173. * @return SearchEntry The current object (for fluent API support)
  1174. */
  1175. public function setModerationStatus($v)
  1176. {
  1177. if(!isset($this->oldColumnsValues[SearchEntryPeer::MODERATION_STATUS]))
  1178. $this->oldColumnsValues[SearchEntryPeer::MODERATION_STATUS] = $this->moderation_status;
  1179. if ($v !== null) {
  1180. $v = (int) $v;
  1181. }
  1182. if ($this->moderation_status !== $v) {
  1183. $this->moderation_status = $v;
  1184. $this->modifiedColumns[] = SearchEntryPeer::MODERATION_STATUS;
  1185. }
  1186. return $this;
  1187. } // setModerationStatus()
  1188. /**
  1189. * Set the value of [moderation_count] column.
  1190. *
  1191. * @param int $v new value
  1192. * @return SearchEntry The current object (for fluent API support)
  1193. */
  1194. public function setModerationCount($v)
  1195. {
  1196. if(!isset($this->oldColumnsValues[SearchEntryPeer::MODERATION_COUNT]))
  1197. $this->oldColumnsValues[SearchEntryPeer::MODERATION_COUNT] = $this->moderation_count;
  1198. if ($v !== null) {
  1199. $v = (int) $v;
  1200. }
  1201. if ($this->moderation_count !== $v) {
  1202. $this->moderation_count = $v;
  1203. $this->modifiedColumns[] = SearchEntryPeer::MODERATION_COUNT;
  1204. }
  1205. return $this;
  1206. } // setModerationCount()
  1207. /**
  1208. * Sets the value of [modified_at] column to a normalized version of the date/time value specified.
  1209. *
  1210. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1211. * be treated as NULL for temporal objects.
  1212. * @return SearchEntry The current object (for fluent API support)
  1213. */
  1214. public function setModifiedAt($v)
  1215. {
  1216. if(!isset($this->oldColumnsValues[SearchEntryPeer::MODIFIED_AT]))
  1217. $this->oldColumnsValues[SearchEntryPeer::MODIFIED_AT] = $this->modified_at;
  1218. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1219. // -- which is unexpected, to say the least.
  1220. if ($v === null || $v === '') {
  1221. $dt = null;
  1222. } elseif ($v instanceof DateTime) {
  1223. $dt = $v;
  1224. } else {
  1225. // some string/numeric value passed; we normalize that so that we can
  1226. // validate it.
  1227. try {
  1228. if (is_numeric($v)) { // if it's a unix timestamp
  1229. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1230. // We have to explicitly specify and then change the time zone because of a
  1231. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1232. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1233. } else {
  1234. $dt = new DateTime($v);
  1235. }
  1236. } catch (Exception $x) {
  1237. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1238. }
  1239. }
  1240. if ( $this->modified_at !== null || $dt !== null ) {
  1241. // (nested ifs are a little easier to read in this case)
  1242. $currNorm = ($this->modified_at !== null && $tmpDt = new DateTime($this->modified_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1243. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1244. if ( ($currNorm !== $newNorm) // normalized values don't match
  1245. )
  1246. {
  1247. $this->modified_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1248. $this->modifiedColumns[] = SearchEntryPeer::MODIFIED_AT;
  1249. }
  1250. } // if either are not null
  1251. return $this;
  1252. } // setModifiedAt()
  1253. /**
  1254. * Set the value of [access_control_id] column.
  1255. *
  1256. * @param int $v new value
  1257. * @return SearchEntry The current object (for fluent API support)
  1258. */
  1259. public function setAccessControlId($v)
  1260. {
  1261. if(!isset($this->oldColumnsValues[SearchEntryPeer::ACCESS_CONTROL_ID]))
  1262. $this->oldColumnsValues[SearchEntryPeer::ACCESS_CONTROL_ID] = $this->access_control_id;
  1263. if ($v !== null) {
  1264. $v = (int) $v;
  1265. }
  1266. if ($this->access_control_id !== $v) {
  1267. $this->access_control_id = $v;
  1268. $this->modifiedColumns[] = SearchEntryPeer::ACCESS_CONTROL_ID;
  1269. }
  1270. return $this;
  1271. } // setAccessControlId()
  1272. /**
  1273. * Set the value of [categories] column.
  1274. *
  1275. * @param string $v new value
  1276. * @return SearchEntry The current object (for fluent API support)
  1277. */
  1278. public function setCategories($v)
  1279. {
  1280. if(!isset($this->oldColumnsValues[SearchEntryPeer::CATEGORIES]))
  1281. $this->oldColumnsValues[SearchEntryPeer::CATEGORIES] = $this->categories;
  1282. if ($v !== null) {
  1283. $v = (string) $v;
  1284. }
  1285. if ($this->categories !== $v) {
  1286. $this->categories = $v;
  1287. $this->modifiedColumns[] = SearchEntryPeer::CATEGORIES;
  1288. }
  1289. return $this;
  1290. } // setCategories()
  1291. /**
  1292. * Sets the value of [start_date] column to a normalized version of the date/time value specified.
  1293. *
  1294. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1295. * be treated as NULL for temporal objects.
  1296. * @return SearchEntry The current object (for fluent API support)
  1297. */
  1298. public function setStartDate($v)
  1299. {
  1300. if(!isset($this->oldColumnsValues[SearchEntryPeer::START_DATE]))
  1301. $this->oldColumnsValues[SearchEntryPeer::START_DATE] = $this->start_date;
  1302. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1303. // -- which is unexpected, to say the least.
  1304. if ($v === null || $v === '') {
  1305. $dt = null;
  1306. } elseif ($v instanceof DateTime) {
  1307. $dt = $v;
  1308. } else {
  1309. // some string/numeric value passed; we normalize that so that we can
  1310. // validate it.
  1311. try {
  1312. if (is_numeric($v)) { // if it's a unix timestamp
  1313. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1314. // We have to explicitly specify and then change the time zone because of a
  1315. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1316. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1317. } else {
  1318. $dt = new DateTime($v);
  1319. }
  1320. } catch (Exception $x) {
  1321. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1322. }
  1323. }
  1324. if ( $this->start_date !== null || $dt !== null ) {
  1325. // (nested ifs are a little easier to read in this case)
  1326. $currNorm = ($this->start_date !== null && $tmpDt = new DateTime($this->start_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1327. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1328. if ( ($currNorm !== $newNorm) // normalized values don't match
  1329. )
  1330. {
  1331. $this->start_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1332. $this->modifiedColumns[] = SearchEntryPeer::START_DATE;
  1333. }
  1334. } // if either are not null
  1335. return $this;
  1336. } // setStartDate()
  1337. /**
  1338. * Sets the value of [end_date] column to a normalized version of the date/time value specified.
  1339. *
  1340. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1341. * be treated as NULL for temporal objects.
  1342. * @return SearchEntry The current object (for fluent API support)
  1343. */
  1344. public function setEndDate($v)
  1345. {
  1346. if(!isset($this->oldColumnsValues[SearchEntryPeer::END_DATE]))
  1347. $this->oldColumnsValues[SearchEntryPeer::END_DATE] = $this->end_date;
  1348. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1349. // -- which is unexpected, to say the least.
  1350. if ($v === null || $v === '') {
  1351. $dt = null;
  1352. } elseif ($v instanceof DateTime) {
  1353. $dt = $v;
  1354. } else {
  1355. // some string/numeric value passed; we normalize that so that we can
  1356. // validate it.
  1357. try {
  1358. if (is_numeric($v)) { // if it's a unix timestamp
  1359. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1360. // We have to explicitly specify and then change the time zone because of a
  1361. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1362. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1363. } else {
  1364. $dt = new DateTime($v);
  1365. }
  1366. } catch (Exception $x) {
  1367. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1368. }
  1369. }
  1370. if ( $this->end_date !== null || $dt !== null ) {
  1371. // (nested ifs are a little easier to read in this case)
  1372. $currNorm = ($this->end_date !== null && $tmpDt = new DateTime($this->end_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1373. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1374. if ( ($currNorm !== $newNorm) // normalized values don't match
  1375. )
  1376. {
  1377. $this->end_date = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1378. $this->modifiedColumns[] = SearchEntryPeer::END_DATE;
  1379. }
  1380. } // if either are not null
  1381. return $this;
  1382. } // setEndDate()
  1383. /**
  1384. * Set the value of [flavor_params] column.
  1385. *
  1386. * @param string $v new value
  1387. * @return SearchEntry The current object (for fluent API support)
  1388. */
  1389. public function setFlavorParams($v)
  1390. {
  1391. if(!isset($this->oldColumnsValues[SearchEntryPeer::FLAVOR_PARAMS]))
  1392. $this->oldColumnsValues[SearchEntryPeer::FLAVOR_PARAMS] = $this->flavor_params;
  1393. if ($v !== null) {
  1394. $v = (string) $v;
  1395. }
  1396. if ($this->flavor_params !== $v) {
  1397. $this->flavor_params = $v;
  1398. $this->modifiedColumns[] = SearchEntryPeer::FLAVOR_PARAMS;
  1399. }
  1400. return $this;
  1401. } // setFlavorParams()
  1402. /**
  1403. * Sets the value of [available_from] column to a normalized version of the date/time value specified.
  1404. *
  1405. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  1406. * be treated as NULL for temporal objects.
  1407. * @return SearchEntry The current object (for fluent API support)
  1408. */
  1409. public function setAvailableFrom($v)
  1410. {
  1411. if(!isset($this->oldColumnsValues[SearchEntryPeer::AVAILABLE_FROM]))
  1412. $this->oldColumnsValues[SearchEntryPeer::AVAILABLE_FROM] = $this->available_from;
  1413. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  1414. // -- which is unexpected, to say the least.
  1415. if ($v === null || $v === '') {
  1416. $dt = null;
  1417. } elseif ($v instanceof DateTime) {
  1418. $dt = $v;
  1419. } else {
  1420. // some string/numeric value passed; we normalize that so that we can
  1421. // validate it.
  1422. try {
  1423. if (is_numeric($v)) { // if it's a unix timestamp
  1424. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  1425. // We have to explicitly specify and then change the time zone because of a
  1426. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  1427. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  1428. } else {
  1429. $dt = new DateTime($v);
  1430. }
  1431. } catch (Exception $x) {
  1432. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  1433. }
  1434. }
  1435. if ( $this->available_from !== null || $dt !== null ) {
  1436. // (nested ifs are a little easier to read in this case)
  1437. $currNorm = ($this->available_from !== null && $tmpDt = new DateTime($this->available_from)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  1438. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  1439. if ( ($currNorm !== $newNorm) // normalized values don't match
  1440. )
  1441. {
  1442. $this->available_from = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  1443. $this->modifiedColumns[] = SearchEntryPeer::AVAILABLE_FROM;
  1444. }
  1445. } // if either are not null
  1446. return $this;
  1447. } // setAvailableFrom()
  1448. /**
  1449. * Set the value of [plugin_data] column.
  1450. *
  1451. * @param string $v new value
  1452. * @return SearchEntry The current object (for fluent API support)
  1453. */
  1454. public function setPluginData($v)
  1455. {
  1456. if(!isset($this->oldColumnsValues[SearchEntryPeer::PLUGIN_DATA]))
  1457. $this->oldColumnsValues[SearchEntryPeer::PLUGIN_DATA] = $this->plugin_data;
  1458. if ($v !== null) {
  1459. $v = (string) $v;
  1460. }
  1461. if ($this->plugin_data !== $v) {
  1462. $this->plugin_data = $v;
  1463. $this->modifiedColumns[] = SearchEntryPeer::PLUGIN_DATA;
  1464. }
  1465. return $this;
  1466. } // setPluginData()
  1467. /**
  1468. * Indicates whether the columns in this object are only set to default values.
  1469. *
  1470. * This method can be used in conjunction with isModified() to indicate whether an object is both
  1471. * modified _and_ has some values set which are non-default.
  1472. *
  1473. * @return boolean Whether the columns in this object are only been set with default values.
  1474. */
  1475. public function hasOnlyDefaultValues()
  1476. {
  1477. if ($this->views !== 0) {
  1478. return false;
  1479. }
  1480. if ($this->rank !== 0) {
  1481. return false;
  1482. }
  1483. if ($this->duration !== 0) {
  1484. return false;
  1485. }
  1486. if ($this->partner_id !== 0) {
  1487. return false;
  1488. }
  1489. if ($this->plays !== 0) {
  1490. return false;
  1491. }
  1492. // otherwise, everything was equal, so return TRUE
  1493. return true;
  1494. } // hasOnlyDefaultValues()
  1495. /**
  1496. * Hydrates (populates) the object variables with values from the database resultset.
  1497. *
  1498. * An offset (0-based "start column") is specified so that objects can be hydrated
  1499. * with a subset of the columns in the resultset rows. This is needed, for example,
  1500. * for results of JOIN queries where the resultset row includes columns from two or
  1501. * more tables.
  1502. *
  1503. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  1504. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  1505. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  1506. * @return int next starting column
  1507. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  1508. */
  1509. public function hydrate($row, $startcol = 0, $rehydrate = false)
  1510. {
  1511. try {
  1512. $this->entry_id = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
  1513. $this->kuser_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
  1514. $this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
  1515. $this->type = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
  1516. $this->media_type = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
  1517. $this->views = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
  1518. $this->rank = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
  1519. $this->tags = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
  1520. $this->entry_status = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
  1521. $this->source_link = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
  1522. $this->duration = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null;
  1523. $this->duration_type = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
  1524. $this->created_at = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
  1525. $this->updated_at = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
  1526. $this->partner_id = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
  1527. $this->display_in_search = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null;
  1528. $this->group_id = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
  1529. $this->plays = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null;
  1530. $this->description = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
  1531. $this->media_date = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
  1532. $this->admin_tags = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
  1533. $this->moderation_status = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null;
  1534. $this->moderation_count

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