PageRenderTime 63ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

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

https://bitbucket.org/pandaos/kaltura
PHP | 3713 lines | 1987 code | 499 blank | 1227 comment | 398 complexity | 6ad3af9db06e5943a0f26fb92d39406f MD5 | raw file
Possible License(s): AGPL-3.0, GPL-3.0, BSD-3-Clause, LGPL-2.1, GPL-2.0, LGPL-3.0, JSON, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'flavor_params' table.
  4. *
  5. *
  6. *
  7. * @package Core
  8. * @subpackage model.om
  9. */
  10. abstract class BaseassetParams 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 assetParamsPeer
  16. */
  17. protected static $peer;
  18. /**
  19. * The value for the id field.
  20. * @var int
  21. */
  22. protected $id;
  23. /**
  24. * The value for the version field.
  25. * @var int
  26. */
  27. protected $version;
  28. /**
  29. * The value for the partner_id field.
  30. * @var int
  31. */
  32. protected $partner_id;
  33. /**
  34. * The value for the name field.
  35. * Note: this column has a database default value of: ''
  36. * @var string
  37. */
  38. protected $name;
  39. /**
  40. * The value for the system_name field.
  41. * Note: this column has a database default value of: ''
  42. * @var string
  43. */
  44. protected $system_name;
  45. /**
  46. * The value for the tags field.
  47. * @var string
  48. */
  49. protected $tags;
  50. /**
  51. * The value for the description field.
  52. * Note: this column has a database default value of: ''
  53. * @var string
  54. */
  55. protected $description;
  56. /**
  57. * The value for the ready_behavior field.
  58. * @var int
  59. */
  60. protected $ready_behavior;
  61. /**
  62. * The value for the created_at field.
  63. * @var string
  64. */
  65. protected $created_at;
  66. /**
  67. * The value for the updated_at field.
  68. * @var string
  69. */
  70. protected $updated_at;
  71. /**
  72. * The value for the deleted_at field.
  73. * @var string
  74. */
  75. protected $deleted_at;
  76. /**
  77. * The value for the is_default field.
  78. * Note: this column has a database default value of: 0
  79. * @var int
  80. */
  81. protected $is_default;
  82. /**
  83. * The value for the format field.
  84. * @var string
  85. */
  86. protected $format;
  87. /**
  88. * The value for the video_codec field.
  89. * @var string
  90. */
  91. protected $video_codec;
  92. /**
  93. * The value for the video_bitrate field.
  94. * Note: this column has a database default value of: 0
  95. * @var int
  96. */
  97. protected $video_bitrate;
  98. /**
  99. * The value for the audio_codec field.
  100. * @var string
  101. */
  102. protected $audio_codec;
  103. /**
  104. * The value for the audio_bitrate field.
  105. * Note: this column has a database default value of: 0
  106. * @var int
  107. */
  108. protected $audio_bitrate;
  109. /**
  110. * The value for the audio_channels field.
  111. * Note: this column has a database default value of: 0
  112. * @var int
  113. */
  114. protected $audio_channels;
  115. /**
  116. * The value for the audio_sample_rate field.
  117. * Note: this column has a database default value of: 0
  118. * @var int
  119. */
  120. protected $audio_sample_rate;
  121. /**
  122. * The value for the audio_resolution field.
  123. * Note: this column has a database default value of: 0
  124. * @var int
  125. */
  126. protected $audio_resolution;
  127. /**
  128. * The value for the width field.
  129. * Note: this column has a database default value of: 0
  130. * @var int
  131. */
  132. protected $width;
  133. /**
  134. * The value for the height field.
  135. * Note: this column has a database default value of: 0
  136. * @var int
  137. */
  138. protected $height;
  139. /**
  140. * The value for the frame_rate field.
  141. * Note: this column has a database default value of: 0
  142. * @var double
  143. */
  144. protected $frame_rate;
  145. /**
  146. * The value for the gop_size field.
  147. * Note: this column has a database default value of: 0
  148. * @var int
  149. */
  150. protected $gop_size;
  151. /**
  152. * The value for the two_pass field.
  153. * Note: this column has a database default value of: false
  154. * @var boolean
  155. */
  156. protected $two_pass;
  157. /**
  158. * The value for the conversion_engines field.
  159. * @var string
  160. */
  161. protected $conversion_engines;
  162. /**
  163. * The value for the conversion_engines_extra_params field.
  164. * @var string
  165. */
  166. protected $conversion_engines_extra_params;
  167. /**
  168. * The value for the custom_data field.
  169. * @var string
  170. */
  171. protected $custom_data;
  172. /**
  173. * The value for the view_order field.
  174. * @var int
  175. */
  176. protected $view_order;
  177. /**
  178. * The value for the creation_mode field.
  179. * Note: this column has a database default value of: 1
  180. * @var int
  181. */
  182. protected $creation_mode;
  183. /**
  184. * The value for the deinterlice field.
  185. * @var int
  186. */
  187. protected $deinterlice;
  188. /**
  189. * The value for the rotate field.
  190. * @var int
  191. */
  192. protected $rotate;
  193. /**
  194. * The value for the operators field.
  195. * @var string
  196. */
  197. protected $operators;
  198. /**
  199. * The value for the engine_version field.
  200. * @var int
  201. */
  202. protected $engine_version;
  203. /**
  204. * The value for the type field.
  205. * Note: this column has a database default value of: 0
  206. * @var int
  207. */
  208. protected $type;
  209. /**
  210. * @var array assetParamsOutput[] Collection to store aggregation of assetParamsOutput objects.
  211. */
  212. protected $collassetParamsOutputs;
  213. /**
  214. * @var Criteria The criteria used to select the current contents of collassetParamsOutputs.
  215. */
  216. private $lastassetParamsOutputCriteria = null;
  217. /**
  218. * @var array asset[] Collection to store aggregation of asset objects.
  219. */
  220. protected $collassets;
  221. /**
  222. * @var Criteria The criteria used to select the current contents of collassets.
  223. */
  224. private $lastassetCriteria = null;
  225. /**
  226. * @var array flavorParamsConversionProfile[] Collection to store aggregation of flavorParamsConversionProfile objects.
  227. */
  228. protected $collflavorParamsConversionProfiles;
  229. /**
  230. * @var Criteria The criteria used to select the current contents of collflavorParamsConversionProfiles.
  231. */
  232. private $lastflavorParamsConversionProfileCriteria = null;
  233. /**
  234. * Flag to prevent endless save loop, if this object is referenced
  235. * by another object which falls in this transaction.
  236. * @var boolean
  237. */
  238. protected $alreadyInSave = false;
  239. /**
  240. * Flag to prevent endless validation loop, if this object is referenced
  241. * by another object which falls in this transaction.
  242. * @var boolean
  243. */
  244. protected $alreadyInValidation = false;
  245. /**
  246. * Store columns old values before the changes
  247. * @var array
  248. */
  249. protected $oldColumnsValues = array();
  250. /**
  251. * @return array
  252. */
  253. public function getColumnsOldValues()
  254. {
  255. return $this->oldColumnsValues;
  256. }
  257. /**
  258. * Applies default values to this object.
  259. * This method should be called from the object's constructor (or
  260. * equivalent initialization method).
  261. * @see __construct()
  262. */
  263. public function applyDefaultValues()
  264. {
  265. $this->name = '';
  266. $this->system_name = '';
  267. $this->description = '';
  268. $this->is_default = 0;
  269. $this->video_bitrate = 0;
  270. $this->audio_bitrate = 0;
  271. $this->audio_channels = 0;
  272. $this->audio_sample_rate = 0;
  273. $this->audio_resolution = 0;
  274. $this->width = 0;
  275. $this->height = 0;
  276. $this->frame_rate = 0;
  277. $this->gop_size = 0;
  278. $this->two_pass = false;
  279. $this->creation_mode = 1;
  280. $this->type = 0;
  281. }
  282. /**
  283. * Initializes internal state of BaseassetParams object.
  284. * @see applyDefaults()
  285. */
  286. public function __construct()
  287. {
  288. parent::__construct();
  289. $this->applyDefaultValues();
  290. }
  291. /**
  292. * Get the [id] column value.
  293. *
  294. * @return int
  295. */
  296. public function getId()
  297. {
  298. return $this->id;
  299. }
  300. /**
  301. * Get the [version] column value.
  302. *
  303. * @return int
  304. */
  305. public function getVersion()
  306. {
  307. return $this->version;
  308. }
  309. /**
  310. * Get the [partner_id] column value.
  311. *
  312. * @return int
  313. */
  314. public function getPartnerId()
  315. {
  316. return $this->partner_id;
  317. }
  318. /**
  319. * Get the [name] column value.
  320. *
  321. * @return string
  322. */
  323. public function getName()
  324. {
  325. return $this->name;
  326. }
  327. /**
  328. * Get the [system_name] column value.
  329. *
  330. * @return string
  331. */
  332. public function getSystemName()
  333. {
  334. return $this->system_name;
  335. }
  336. /**
  337. * Get the [tags] column value.
  338. *
  339. * @return string
  340. */
  341. public function getTags()
  342. {
  343. return $this->tags;
  344. }
  345. /**
  346. * Get the [description] column value.
  347. *
  348. * @return string
  349. */
  350. public function getDescription()
  351. {
  352. return $this->description;
  353. }
  354. /**
  355. * Get the [ready_behavior] column value.
  356. *
  357. * @return int
  358. */
  359. public function getReadyBehavior()
  360. {
  361. return $this->ready_behavior;
  362. }
  363. /**
  364. * Get the [optionally formatted] temporal [created_at] column value.
  365. *
  366. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  367. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  368. *
  369. * @param string $format The date/time format string (either date()-style or strftime()-style).
  370. * If format is NULL, then the raw unix timestamp integer will be returned.
  371. * @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
  372. * @throws PropelException - if unable to parse/validate the date/time value.
  373. */
  374. public function getCreatedAt($format = 'Y-m-d H:i:s')
  375. {
  376. if ($this->created_at === null) {
  377. return null;
  378. }
  379. if ($this->created_at === '0000-00-00 00:00:00') {
  380. // while technically this is not a default value of NULL,
  381. // this seems to be closest in meaning.
  382. return null;
  383. } else {
  384. try {
  385. $dt = new DateTime($this->created_at);
  386. } catch (Exception $x) {
  387. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
  388. }
  389. }
  390. if ($format === null) {
  391. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  392. return (int) $dt->format('U');
  393. } elseif (strpos($format, '%') !== false) {
  394. return strftime($format, $dt->format('U'));
  395. } else {
  396. return $dt->format($format);
  397. }
  398. }
  399. /**
  400. * Get the [optionally formatted] temporal [updated_at] column value.
  401. *
  402. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  403. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  404. *
  405. * @param string $format The date/time format string (either date()-style or strftime()-style).
  406. * If format is NULL, then the raw unix timestamp integer will be returned.
  407. * @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
  408. * @throws PropelException - if unable to parse/validate the date/time value.
  409. */
  410. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  411. {
  412. if ($this->updated_at === null) {
  413. return null;
  414. }
  415. if ($this->updated_at === '0000-00-00 00:00:00') {
  416. // while technically this is not a default value of NULL,
  417. // this seems to be closest in meaning.
  418. return null;
  419. } else {
  420. try {
  421. $dt = new DateTime($this->updated_at);
  422. } catch (Exception $x) {
  423. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
  424. }
  425. }
  426. if ($format === null) {
  427. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  428. return (int) $dt->format('U');
  429. } elseif (strpos($format, '%') !== false) {
  430. return strftime($format, $dt->format('U'));
  431. } else {
  432. return $dt->format($format);
  433. }
  434. }
  435. /**
  436. * Get the [optionally formatted] temporal [deleted_at] column value.
  437. *
  438. * This accessor only only work with unix epoch dates. Consider enabling the propel.useDateTimeClass
  439. * option in order to avoid converstions to integers (which are limited in the dates they can express).
  440. *
  441. * @param string $format The date/time format string (either date()-style or strftime()-style).
  442. * If format is NULL, then the raw unix timestamp integer will be returned.
  443. * @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
  444. * @throws PropelException - if unable to parse/validate the date/time value.
  445. */
  446. public function getDeletedAt($format = 'Y-m-d H:i:s')
  447. {
  448. if ($this->deleted_at === null) {
  449. return null;
  450. }
  451. if ($this->deleted_at === '0000-00-00 00:00:00') {
  452. // while technically this is not a default value of NULL,
  453. // this seems to be closest in meaning.
  454. return null;
  455. } else {
  456. try {
  457. $dt = new DateTime($this->deleted_at);
  458. } catch (Exception $x) {
  459. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->deleted_at, true), $x);
  460. }
  461. }
  462. if ($format === null) {
  463. // We cast here to maintain BC in API; obviously we will lose data if we're dealing with pre-/post-epoch dates.
  464. return (int) $dt->format('U');
  465. } elseif (strpos($format, '%') !== false) {
  466. return strftime($format, $dt->format('U'));
  467. } else {
  468. return $dt->format($format);
  469. }
  470. }
  471. /**
  472. * Get the [is_default] column value.
  473. *
  474. * @return int
  475. */
  476. public function getIsDefault()
  477. {
  478. return $this->is_default;
  479. }
  480. /**
  481. * Get the [format] column value.
  482. *
  483. * @return string
  484. */
  485. public function getFormat()
  486. {
  487. return $this->format;
  488. }
  489. /**
  490. * Get the [video_codec] column value.
  491. *
  492. * @return string
  493. */
  494. public function getVideoCodec()
  495. {
  496. return $this->video_codec;
  497. }
  498. /**
  499. * Get the [video_bitrate] column value.
  500. *
  501. * @return int
  502. */
  503. public function getVideoBitrate()
  504. {
  505. return $this->video_bitrate;
  506. }
  507. /**
  508. * Get the [audio_codec] column value.
  509. *
  510. * @return string
  511. */
  512. public function getAudioCodec()
  513. {
  514. return $this->audio_codec;
  515. }
  516. /**
  517. * Get the [audio_bitrate] column value.
  518. *
  519. * @return int
  520. */
  521. public function getAudioBitrate()
  522. {
  523. return $this->audio_bitrate;
  524. }
  525. /**
  526. * Get the [audio_channels] column value.
  527. *
  528. * @return int
  529. */
  530. public function getAudioChannels()
  531. {
  532. return $this->audio_channels;
  533. }
  534. /**
  535. * Get the [audio_sample_rate] column value.
  536. *
  537. * @return int
  538. */
  539. public function getAudioSampleRate()
  540. {
  541. return $this->audio_sample_rate;
  542. }
  543. /**
  544. * Get the [audio_resolution] column value.
  545. *
  546. * @return int
  547. */
  548. public function getAudioResolution()
  549. {
  550. return $this->audio_resolution;
  551. }
  552. /**
  553. * Get the [width] column value.
  554. *
  555. * @return int
  556. */
  557. public function getWidth()
  558. {
  559. return $this->width;
  560. }
  561. /**
  562. * Get the [height] column value.
  563. *
  564. * @return int
  565. */
  566. public function getHeight()
  567. {
  568. return $this->height;
  569. }
  570. /**
  571. * Get the [frame_rate] column value.
  572. *
  573. * @return double
  574. */
  575. public function getFrameRate()
  576. {
  577. return $this->frame_rate;
  578. }
  579. /**
  580. * Get the [gop_size] column value.
  581. *
  582. * @return int
  583. */
  584. public function getGopSize()
  585. {
  586. return $this->gop_size;
  587. }
  588. /**
  589. * Get the [two_pass] column value.
  590. *
  591. * @return boolean
  592. */
  593. public function getTwoPass()
  594. {
  595. return $this->two_pass;
  596. }
  597. /**
  598. * Get the [conversion_engines] column value.
  599. *
  600. * @return string
  601. */
  602. public function getConversionEngines()
  603. {
  604. return $this->conversion_engines;
  605. }
  606. /**
  607. * Get the [conversion_engines_extra_params] column value.
  608. *
  609. * @return string
  610. */
  611. public function getConversionEnginesExtraParams()
  612. {
  613. return $this->conversion_engines_extra_params;
  614. }
  615. /**
  616. * Get the [custom_data] column value.
  617. *
  618. * @return string
  619. */
  620. public function getCustomData()
  621. {
  622. return $this->custom_data;
  623. }
  624. /**
  625. * Get the [view_order] column value.
  626. *
  627. * @return int
  628. */
  629. public function getViewOrder()
  630. {
  631. return $this->view_order;
  632. }
  633. /**
  634. * Get the [creation_mode] column value.
  635. *
  636. * @return int
  637. */
  638. public function getCreationMode()
  639. {
  640. return $this->creation_mode;
  641. }
  642. /**
  643. * Get the [deinterlice] column value.
  644. *
  645. * @return int
  646. */
  647. public function getDeinterlice()
  648. {
  649. return $this->deinterlice;
  650. }
  651. /**
  652. * Get the [rotate] column value.
  653. *
  654. * @return int
  655. */
  656. public function getRotate()
  657. {
  658. return $this->rotate;
  659. }
  660. /**
  661. * Get the [operators] column value.
  662. *
  663. * @return string
  664. */
  665. public function getOperators()
  666. {
  667. return $this->operators;
  668. }
  669. /**
  670. * Get the [engine_version] column value.
  671. *
  672. * @return int
  673. */
  674. public function getEngineVersion()
  675. {
  676. return $this->engine_version;
  677. }
  678. /**
  679. * Get the [type] column value.
  680. *
  681. * @return int
  682. */
  683. public function getType()
  684. {
  685. return $this->type;
  686. }
  687. /**
  688. * Set the value of [id] column.
  689. *
  690. * @param int $v new value
  691. * @return assetParams The current object (for fluent API support)
  692. */
  693. public function setId($v)
  694. {
  695. if(!isset($this->oldColumnsValues[assetParamsPeer::ID]))
  696. $this->oldColumnsValues[assetParamsPeer::ID] = $this->id;
  697. if ($v !== null) {
  698. $v = (int) $v;
  699. }
  700. if ($this->id !== $v) {
  701. $this->id = $v;
  702. $this->modifiedColumns[] = assetParamsPeer::ID;
  703. }
  704. return $this;
  705. } // setId()
  706. /**
  707. * Set the value of [version] column.
  708. *
  709. * @param int $v new value
  710. * @return assetParams The current object (for fluent API support)
  711. */
  712. public function setVersion($v)
  713. {
  714. if(!isset($this->oldColumnsValues[assetParamsPeer::VERSION]))
  715. $this->oldColumnsValues[assetParamsPeer::VERSION] = $this->version;
  716. if ($v !== null) {
  717. $v = (int) $v;
  718. }
  719. if ($this->version !== $v) {
  720. $this->version = $v;
  721. $this->modifiedColumns[] = assetParamsPeer::VERSION;
  722. }
  723. return $this;
  724. } // setVersion()
  725. /**
  726. * Set the value of [partner_id] column.
  727. *
  728. * @param int $v new value
  729. * @return assetParams The current object (for fluent API support)
  730. */
  731. public function setPartnerId($v)
  732. {
  733. if(!isset($this->oldColumnsValues[assetParamsPeer::PARTNER_ID]))
  734. $this->oldColumnsValues[assetParamsPeer::PARTNER_ID] = $this->partner_id;
  735. if ($v !== null) {
  736. $v = (int) $v;
  737. }
  738. if ($this->partner_id !== $v) {
  739. $this->partner_id = $v;
  740. $this->modifiedColumns[] = assetParamsPeer::PARTNER_ID;
  741. }
  742. return $this;
  743. } // setPartnerId()
  744. /**
  745. * Set the value of [name] column.
  746. *
  747. * @param string $v new value
  748. * @return assetParams The current object (for fluent API support)
  749. */
  750. public function setName($v)
  751. {
  752. if(!isset($this->oldColumnsValues[assetParamsPeer::NAME]))
  753. $this->oldColumnsValues[assetParamsPeer::NAME] = $this->name;
  754. if ($v !== null) {
  755. $v = (string) $v;
  756. }
  757. if ($this->name !== $v || $this->isNew()) {
  758. $this->name = $v;
  759. $this->modifiedColumns[] = assetParamsPeer::NAME;
  760. }
  761. return $this;
  762. } // setName()
  763. /**
  764. * Set the value of [system_name] column.
  765. *
  766. * @param string $v new value
  767. * @return assetParams The current object (for fluent API support)
  768. */
  769. public function setSystemName($v)
  770. {
  771. if(!isset($this->oldColumnsValues[assetParamsPeer::SYSTEM_NAME]))
  772. $this->oldColumnsValues[assetParamsPeer::SYSTEM_NAME] = $this->system_name;
  773. if ($v !== null) {
  774. $v = (string) $v;
  775. }
  776. if ($this->system_name !== $v || $this->isNew()) {
  777. $this->system_name = $v;
  778. $this->modifiedColumns[] = assetParamsPeer::SYSTEM_NAME;
  779. }
  780. return $this;
  781. } // setSystemName()
  782. /**
  783. * Set the value of [tags] column.
  784. *
  785. * @param string $v new value
  786. * @return assetParams The current object (for fluent API support)
  787. */
  788. public function setTags($v)
  789. {
  790. if(!isset($this->oldColumnsValues[assetParamsPeer::TAGS]))
  791. $this->oldColumnsValues[assetParamsPeer::TAGS] = $this->tags;
  792. if ($v !== null) {
  793. $v = (string) $v;
  794. }
  795. if ($this->tags !== $v) {
  796. $this->tags = $v;
  797. $this->modifiedColumns[] = assetParamsPeer::TAGS;
  798. }
  799. return $this;
  800. } // setTags()
  801. /**
  802. * Set the value of [description] column.
  803. *
  804. * @param string $v new value
  805. * @return assetParams The current object (for fluent API support)
  806. */
  807. public function setDescription($v)
  808. {
  809. if(!isset($this->oldColumnsValues[assetParamsPeer::DESCRIPTION]))
  810. $this->oldColumnsValues[assetParamsPeer::DESCRIPTION] = $this->description;
  811. if ($v !== null) {
  812. $v = (string) $v;
  813. }
  814. if ($this->description !== $v || $this->isNew()) {
  815. $this->description = $v;
  816. $this->modifiedColumns[] = assetParamsPeer::DESCRIPTION;
  817. }
  818. return $this;
  819. } // setDescription()
  820. /**
  821. * Set the value of [ready_behavior] column.
  822. *
  823. * @param int $v new value
  824. * @return assetParams The current object (for fluent API support)
  825. */
  826. public function setReadyBehavior($v)
  827. {
  828. if(!isset($this->oldColumnsValues[assetParamsPeer::READY_BEHAVIOR]))
  829. $this->oldColumnsValues[assetParamsPeer::READY_BEHAVIOR] = $this->ready_behavior;
  830. if ($v !== null) {
  831. $v = (int) $v;
  832. }
  833. if ($this->ready_behavior !== $v) {
  834. $this->ready_behavior = $v;
  835. $this->modifiedColumns[] = assetParamsPeer::READY_BEHAVIOR;
  836. }
  837. return $this;
  838. } // setReadyBehavior()
  839. /**
  840. * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  841. *
  842. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  843. * be treated as NULL for temporal objects.
  844. * @return assetParams The current object (for fluent API support)
  845. */
  846. public function setCreatedAt($v)
  847. {
  848. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  849. // -- which is unexpected, to say the least.
  850. if ($v === null || $v === '') {
  851. $dt = null;
  852. } elseif ($v instanceof DateTime) {
  853. $dt = $v;
  854. } else {
  855. // some string/numeric value passed; we normalize that so that we can
  856. // validate it.
  857. try {
  858. if (is_numeric($v)) { // if it's a unix timestamp
  859. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  860. // We have to explicitly specify and then change the time zone because of a
  861. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  862. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  863. } else {
  864. $dt = new DateTime($v);
  865. }
  866. } catch (Exception $x) {
  867. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  868. }
  869. }
  870. if ( $this->created_at !== null || $dt !== null ) {
  871. // (nested ifs are a little easier to read in this case)
  872. $currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  873. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  874. if ( ($currNorm !== $newNorm) // normalized values don't match
  875. )
  876. {
  877. $this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  878. $this->modifiedColumns[] = assetParamsPeer::CREATED_AT;
  879. }
  880. } // if either are not null
  881. return $this;
  882. } // setCreatedAt()
  883. /**
  884. * Sets the value of [updated_at] column to a normalized version of the date/time value specified.
  885. *
  886. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  887. * be treated as NULL for temporal objects.
  888. * @return assetParams The current object (for fluent API support)
  889. */
  890. public function setUpdatedAt($v)
  891. {
  892. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  893. // -- which is unexpected, to say the least.
  894. if ($v === null || $v === '') {
  895. $dt = null;
  896. } elseif ($v instanceof DateTime) {
  897. $dt = $v;
  898. } else {
  899. // some string/numeric value passed; we normalize that so that we can
  900. // validate it.
  901. try {
  902. if (is_numeric($v)) { // if it's a unix timestamp
  903. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  904. // We have to explicitly specify and then change the time zone because of a
  905. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  906. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  907. } else {
  908. $dt = new DateTime($v);
  909. }
  910. } catch (Exception $x) {
  911. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  912. }
  913. }
  914. if ( $this->updated_at !== null || $dt !== null ) {
  915. // (nested ifs are a little easier to read in this case)
  916. $currNorm = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  917. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  918. if ( ($currNorm !== $newNorm) // normalized values don't match
  919. )
  920. {
  921. $this->updated_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  922. $this->modifiedColumns[] = assetParamsPeer::UPDATED_AT;
  923. }
  924. } // if either are not null
  925. return $this;
  926. } // setUpdatedAt()
  927. /**
  928. * Sets the value of [deleted_at] column to a normalized version of the date/time value specified.
  929. *
  930. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  931. * be treated as NULL for temporal objects.
  932. * @return assetParams The current object (for fluent API support)
  933. */
  934. public function setDeletedAt($v)
  935. {
  936. if(!isset($this->oldColumnsValues[assetParamsPeer::DELETED_AT]))
  937. $this->oldColumnsValues[assetParamsPeer::DELETED_AT] = $this->deleted_at;
  938. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  939. // -- which is unexpected, to say the least.
  940. if ($v === null || $v === '') {
  941. $dt = null;
  942. } elseif ($v instanceof DateTime) {
  943. $dt = $v;
  944. } else {
  945. // some string/numeric value passed; we normalize that so that we can
  946. // validate it.
  947. try {
  948. if (is_numeric($v)) { // if it's a unix timestamp
  949. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  950. // We have to explicitly specify and then change the time zone because of a
  951. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  952. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  953. } else {
  954. $dt = new DateTime($v);
  955. }
  956. } catch (Exception $x) {
  957. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  958. }
  959. }
  960. if ( $this->deleted_at !== null || $dt !== null ) {
  961. // (nested ifs are a little easier to read in this case)
  962. $currNorm = ($this->deleted_at !== null && $tmpDt = new DateTime($this->deleted_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
  963. $newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;
  964. if ( ($currNorm !== $newNorm) // normalized values don't match
  965. )
  966. {
  967. $this->deleted_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
  968. $this->modifiedColumns[] = assetParamsPeer::DELETED_AT;
  969. }
  970. } // if either are not null
  971. return $this;
  972. } // setDeletedAt()
  973. /**
  974. * Set the value of [is_default] column.
  975. *
  976. * @param int $v new value
  977. * @return assetParams The current object (for fluent API support)
  978. */
  979. public function setIsDefault($v)
  980. {
  981. if(!isset($this->oldColumnsValues[assetParamsPeer::IS_DEFAULT]))
  982. $this->oldColumnsValues[assetParamsPeer::IS_DEFAULT] = $this->is_default;
  983. if ($v !== null) {
  984. $v = (int) $v;
  985. }
  986. if ($this->is_default !== $v || $this->isNew()) {
  987. $this->is_default = $v;
  988. $this->modifiedColumns[] = assetParamsPeer::IS_DEFAULT;
  989. }
  990. return $this;
  991. } // setIsDefault()
  992. /**
  993. * Set the value of [format] column.
  994. *
  995. * @param string $v new value
  996. * @return assetParams The current object (for fluent API support)
  997. */
  998. public function setFormat($v)
  999. {
  1000. if(!isset($this->oldColumnsValues[assetParamsPeer::FORMAT]))
  1001. $this->oldColumnsValues[assetParamsPeer::FORMAT] = $this->format;
  1002. if ($v !== null) {
  1003. $v = (string) $v;
  1004. }
  1005. if ($this->format !== $v) {
  1006. $this->format = $v;
  1007. $this->modifiedColumns[] = assetParamsPeer::FORMAT;
  1008. }
  1009. return $this;
  1010. } // setFormat()
  1011. /**
  1012. * Set the value of [video_codec] column.
  1013. *
  1014. * @param string $v new value
  1015. * @return assetParams The current object (for fluent API support)
  1016. */
  1017. public function setVideoCodec($v)
  1018. {
  1019. if(!isset($this->oldColumnsValues[assetParamsPeer::VIDEO_CODEC]))
  1020. $this->oldColumnsValues[assetParamsPeer::VIDEO_CODEC] = $this->video_codec;
  1021. if ($v !== null) {
  1022. $v = (string) $v;
  1023. }
  1024. if ($this->video_codec !== $v) {
  1025. $this->video_codec = $v;
  1026. $this->modifiedColumns[] = assetParamsPeer::VIDEO_CODEC;
  1027. }
  1028. return $this;
  1029. } // setVideoCodec()
  1030. /**
  1031. * Set the value of [video_bitrate] column.
  1032. *
  1033. * @param int $v new value
  1034. * @return assetParams The current object (for fluent API support)
  1035. */
  1036. public function setVideoBitrate($v)
  1037. {
  1038. if(!isset($this->oldColumnsValues[assetParamsPeer::VIDEO_BITRATE]))
  1039. $this->oldColumnsValues[assetParamsPeer::VIDEO_BITRATE] = $this->video_bitrate;
  1040. if ($v !== null) {
  1041. $v = (int) $v;
  1042. }
  1043. if ($this->video_bitrate !== $v || $this->isNew()) {
  1044. $this->video_bitrate = $v;
  1045. $this->modifiedColumns[] = assetParamsPeer::VIDEO_BITRATE;
  1046. }
  1047. return $this;
  1048. } // setVideoBitrate()
  1049. /**
  1050. * Set the value of [audio_codec] column.
  1051. *
  1052. * @param string $v new value
  1053. * @return assetParams The current object (for fluent API support)
  1054. */
  1055. public function setAudioCodec($v)
  1056. {
  1057. if(!isset($this->oldColumnsValues[assetParamsPeer::AUDIO_CODEC]))
  1058. $this->oldColumnsValues[assetParamsPeer::AUDIO_CODEC] = $this->audio_codec;
  1059. if ($v !== null) {
  1060. $v = (string) $v;
  1061. }
  1062. if ($this->audio_codec !== $v) {
  1063. $this->audio_codec = $v;
  1064. $this->modifiedColumns[] = assetParamsPeer::AUDIO_CODEC;
  1065. }
  1066. return $this;
  1067. } // setAudioCodec()
  1068. /**
  1069. * Set the value of [audio_bitrate] column.
  1070. *
  1071. * @param int $v new value
  1072. * @return assetParams The current object (for fluent API support)
  1073. */
  1074. public function setAudioBitrate($v)
  1075. {
  1076. if(!isset($this->oldColumnsValues[assetParamsPeer::AUDIO_BITRATE]))
  1077. $this->oldColumnsValues[assetParamsPeer::AUDIO_BITRATE] = $this->audio_bitrate;
  1078. if ($v !== null) {
  1079. $v = (int) $v;
  1080. }
  1081. if ($this->audio_bitrate !== $v || $this->isNew()) {
  1082. $this->audio_bitrate = $v;
  1083. $this->modifiedColumns[] = assetParamsPeer::AUDIO_BITRATE;
  1084. }
  1085. return $this;
  1086. } // setAudioBitrate()
  1087. /**
  1088. * Set the value of [audio_channels] column.
  1089. *
  1090. * @param int $v new value
  1091. * @return assetParams The current object (for fluent API support)
  1092. */
  1093. public function setAudioChannels($v)
  1094. {
  1095. if(!isset($this->oldColumnsValues[assetParamsPeer::AUDIO_CHANNELS]))
  1096. $this->oldColumnsValues[assetParamsPeer::AUDIO_CHANNELS] = $this->audio_channels;
  1097. if ($v !== null) {
  1098. $v = (int) $v;
  1099. }
  1100. if ($this->audio_channels !== $v || $this->isNew()) {
  1101. $this->audio_channels = $v;
  1102. $this->modifiedColumns[] = assetParamsPeer::AUDIO_CHANNELS;
  1103. }
  1104. return $this;
  1105. } // setAudioChannels()
  1106. /**
  1107. * Set the value of [audio_sample_rate] column.
  1108. *
  1109. * @param int $v new value
  1110. * @return assetParams The current object (for fluent API support)
  1111. */
  1112. public function setAudioSampleRate($v)
  1113. {
  1114. if(!isset($this->oldColumnsValues[assetParamsPeer::AUDIO_SAMPLE_RATE]))
  1115. $this->oldColumnsValues[assetParamsPeer::AUDIO_SAMPLE_RATE] = $this->audio_sample_rate;
  1116. if ($v !== null) {
  1117. $v = (int) $v;
  1118. }
  1119. if ($this->audio_sample_rate !== $v || $this->isNew()) {
  1120. $this->audio_sample_rate = $v;
  1121. $this->modifiedColumns[] = assetParamsPeer::AUDIO_SAMPLE_RATE;
  1122. }
  1123. return $this;
  1124. } // setAudioSampleRate()
  1125. /**
  1126. * Set the value of [audio_resolution] column.
  1127. *
  1128. * @param int $v new value
  1129. * @return assetParams The current object (for fluent API support)
  1130. */
  1131. public function setAudioResolution($v)
  1132. {
  1133. if(!isset($this->oldColumnsValues[assetParamsPeer::AUDIO_RESOLUTION]))
  1134. $this->oldColumnsValues[assetParamsPeer::AUDIO_RESOLUTION] = $this->audio_resolution;
  1135. if ($v !== null) {
  1136. $v = (int) $v;
  1137. }
  1138. if ($this->audio_resolution !== $v || $this->isNew()) {
  1139. $this->audio_resolution = $v;
  1140. $this->modifiedColumns[] = assetParamsPeer::AUDIO_RESOLUTION;
  1141. }
  1142. return $this;
  1143. } // setAudioResolution()
  1144. /**
  1145. * Set the value of [width] column.
  1146. *
  1147. * @param int $v new value
  1148. * @return assetParams The current object (for fluent API support)
  1149. */
  1150. public function setWidth($v)
  1151. {
  1152. if(!isset($this->oldColumnsValues[assetParamsPeer::WIDTH]))
  1153. $this->oldColumnsValues[assetParamsPeer::WIDTH] = $this->width;
  1154. if ($v !== null) {
  1155. $v = (int) $v;
  1156. }
  1157. if ($this->width !== $v || $this->isNew()) {
  1158. $this->width = $v;
  1159. $this->modifiedColumns[] = assetParamsPeer::WIDTH;
  1160. }
  1161. return $this;
  1162. } // setWidth()
  1163. /**
  1164. * Set the value of [height] column.
  1165. *
  1166. * @param int $v new value
  1167. * @return assetParams The current object (for fluent API support)
  1168. */
  1169. public function setHeight($v)
  1170. {
  1171. if(!isset($this->oldColumnsValues[assetParamsPeer::HEIGHT]))
  1172. $this->oldColumnsValues[assetParamsPeer::HEIGHT] = $this->height;
  1173. if ($v !== null) {
  1174. $v = (int) $v;
  1175. }
  1176. if ($this->height !== $v || $this->isNew()) {
  1177. $this->height = $v;
  1178. $this->modifiedColumns[] = assetParamsPeer::HEIGHT;
  1179. }
  1180. return $this;
  1181. } // setHeight()
  1182. /**
  1183. * Set the value of [frame_rate] column.
  1184. *
  1185. * @param double $v new value
  1186. * @return assetParams The current object (for fluent API support)
  1187. */
  1188. public function setFrameRate($v)
  1189. {
  1190. if(!isset($this->oldColumnsValues[assetParamsPeer::FRAME_RATE]))
  1191. $this->oldColumnsValues[assetParamsPeer::FRAME_RATE] = $this->frame_rate;
  1192. if ($v !== null) {
  1193. $v = (double) $v;
  1194. }
  1195. if ($this->frame_rate !== $v || $this->isNew()) {
  1196. $this->frame_rate = $v;
  1197. $this->modifiedColumns[] = assetParamsPeer::FRAME_RATE;
  1198. }
  1199. return $this;
  1200. } // setFrameRate()
  1201. /**
  1202. * Set the value of [gop_size] column.
  1203. *
  1204. * @param int $v new value
  1205. * @return assetParams The current object (for fluent API support)
  1206. */
  1207. public function setGopSize($v)
  1208. {
  1209. if(!isset($this->oldColumnsValues[assetParamsPeer::GOP_SIZE]))
  1210. $this->oldColumnsValues[assetParamsPeer::GOP_SIZE] = $this->gop_size;
  1211. if ($v !== null) {
  1212. $v = (int) $v;
  1213. }
  1214. if ($this->gop_size !== $v || $this->isNew()) {
  1215. $this->gop_size = $v;
  1216. $this->modifiedColumns[] = assetParamsPeer::GOP_SIZE;
  1217. }
  1218. return $this;
  1219. } // setGopSize()
  1220. /**
  1221. * Set the value of [two_pass] column.
  1222. *
  1223. * @param boolean $v new value
  1224. * @return assetParams The current object (for fluent API support)
  1225. */
  1226. public function setTwoPass($v)
  1227. {
  1228. if(!isset($this->oldColumnsValues[assetParamsPeer::TWO_PASS]))
  1229. $this->oldColumnsValues[assetParamsPeer::TWO_PASS] = $this->two_pass;
  1230. if ($v !== null) {
  1231. $v = (boolean) $v;
  1232. }
  1233. if ($this->two_pass !== $v || $this->isNew()) {
  1234. $this->two_pass = $v;
  1235. $this->modifiedColumns[] = assetParamsPeer::TWO_PASS;
  1236. }
  1237. return $this;
  1238. } // setTwoPass()
  1239. /**
  1240. * Set the value of [conversion_engines] column.
  1241. *
  1242. * @param string $v new value
  1243. * @return assetParams The current object (for fluent API support)
  1244. */
  1245. public function setConversionEngines($v)
  1246. {
  1247. if(!isset($this->oldColumnsValues[assetParamsPeer::CONVERSION_ENGINES]))
  1248. $this->oldColumnsValues[assetParamsPeer::CONVERSION_ENGINES] = $this->conversion_engines;
  1249. if ($v !== null) {
  1250. $v = (string) $v;
  1251. }
  1252. if ($this->conversion_engines !== $v) {
  1253. $this->conversion_engines = $v;
  1254. $this->modifiedColumns[] = assetParamsPeer::CONVERSION_ENGINES;
  1255. }
  1256. return $this;
  1257. } // setConversionEngines()
  1258. /**
  1259. * Set the value of [conversion_engines_extra_params] column.
  1260. *
  1261. * @param string $v new value
  1262. * @return assetParams The current object (for fluent API support)
  1263. */
  1264. public function setConversionEnginesExtraParams($v)
  1265. {
  1266. if(!isset($this->oldColumnsValues[assetParamsPeer::CONVERSION_ENGINES_EXTRA_PARAMS]))
  1267. $this->oldColumnsValues[assetParamsPeer::CONVERSION_ENGINES_EXTRA_PARAMS] = $this->conversion_engines_extra_params;
  1268. if ($v !== null) {
  1269. $v = (string) $v;
  1270. }
  1271. if ($this->conversion_engines_extra_params !== $v) {
  1272. $this->conversion_engines_extra_params = $v;
  1273. $this->modifiedColumns[] = assetParamsPeer::CONVERSION_ENGINES_EXTRA_PARAMS;
  1274. }
  1275. return $this;
  1276. } // setConversionEnginesExtraParams()
  1277. /**
  1278. * Set the value of [custom_data] column.
  1279. *
  1280. * @param string $v new value
  1281. * @return assetParams The current object (for fluent API support)
  1282. */
  1283. public function setCustomData($v)
  1284. {
  1285. if ($v !== null) {
  1286. $v = (string) $v;
  1287. }
  1288. if ($this->custom_data !== $v) {
  1289. $this->custom_data = $v;
  1290. $this->modifiedColumns[] = assetParamsPeer::CUSTOM_DATA;
  1291. }
  1292. return $this;
  1293. } // setCustomData()
  1294. /**
  1295. * Set the value of [view_order] column.
  1296. *
  1297. * @param int $v new value
  1298. * @return assetParams The current object (for fluent API support)
  1299. */
  1300. public function setViewOrder($v)
  1301. {
  1302. if(!isset($this->oldColumnsValues[assetParamsPeer::VIEW_ORDER]))
  1303. $this->oldColumnsValues[assetParamsPeer::VIEW_ORDER] = $this->view_order;
  1304. if ($v !== null) {
  1305. $v = (int) $v;
  1306. }
  1307. if ($this->view_order !== $v) {
  1308. $this->view_order = $v;
  1309. $this->modifiedColumns[] = assetParamsPeer::VIEW_ORDER;
  1310. }
  1311. return $this;
  1312. } // setViewOrder()
  1313. /**
  1314. * Set the value of [creation_mode] column.
  1315. *
  1316. * @param int $v new value
  1317. * @return assetParams The current object (for fluent API support)
  1318. */
  1319. public function setCreationMode($v)
  1320. {
  1321. if(!isset($this->oldColumnsValues[assetParamsPeer::CREATION_MODE]))
  1322. $this->oldColumnsValues[assetParamsPeer::CREATION_MODE] = $this->creation_mode;
  1323. if ($v !== null) {
  1324. $v = (int) $v;
  1325. }
  1326. if ($this->creation_mode !== $v || $this->isNew()) {
  1327. $this->creation_mode = $v;
  1328. $this->modifiedColumns[] = assetParamsPeer::CREATION_MODE;
  1329. }
  1330. return $this;
  1331. } // setCreationMode()
  1332. /**
  1333. * Set the value of [deinterlice] column.
  1334. *
  1335. * @param int $v new value
  1336. * @return assetParams The current object (for fluent API support)
  1337. */
  1338. public function setDeinterlice($v)
  1339. {
  1340. if(!isset($this->oldColumnsValues[assetParamsPeer::DEINTERLICE]))
  1341. $this->oldColumnsValues[assetParamsPeer::DEINTERLICE] = $this->deinterlice;
  1342. if ($v !== null) {
  1343. $v = (int) $v;
  1344. }
  1345. if ($this->deinterlice !== $v) {
  1346. $this->deinterlice = $v;
  1347. $this->modifiedColumns[] = assetParamsPeer::DEINTERLICE;
  1348. }
  1349. return $this;
  1350. } // setDeinterlice()
  1351. /**
  1352. * Set the value of [rotate] column.
  1353. *
  1354. * @param int $v new value
  1355. * @return assetParams The current object (for fluent API support)
  1356. */
  1357. public function setRotate($v)
  1358. {
  1359. if(!isset($this->oldColumnsValues[assetParamsPeer::ROTATE]))
  1360. $this->oldColumnsValues[assetParamsPeer::ROTATE] = $this->rotate;
  1361. if ($v !== null) {
  1362. $v = (int) $v;
  1363. }
  1364. if ($this->rotate !== $v) {
  1365. $this->rotate = $v;
  1366. $this->modifiedColumns[] = assetParamsPeer::ROTATE;
  1367. }
  1368. return $this;
  1369. } // setRotate()
  1370. /**
  1371. * Set the value of [operators] column.
  1372. *
  1373. * @param string $v new value
  1374. * @return assetParams The current object (for fluent API support)
  1375. */
  1376. public function setOperators($v)
  1377. {
  1378. if(!isset($this->oldColumnsValues[assetParamsPeer::OPERATORS]))
  1379. $this->oldColumnsValues[assetParamsPeer::OPERATORS] = $this->operators;
  1380. if ($v !== null) {
  1381. $v = (string) $v;
  1382. }
  1383. if ($this->operators !== $v) {
  1384. $this->operators = $v;
  1385. $this->modifiedColumns[] = assetParamsPeer::OPERATORS;
  1386. }
  1387. return $this;
  1388. } // setOperators()
  1389. /**
  1390. * Set the value of [engine_version] column.
  1391. *
  1392. * @param int $v new value
  1393. * @return assetParams The current object (for fluent API support)
  1394. */
  1395. public function setEngineVersion($v)
  1396. {
  1397. if(!isset($this->oldColumnsValues[assetParamsPeer::ENGINE_VERSION]))
  1398. $this->oldColumnsValues[assetParamsPeer::ENGINE_VERSION] = $this->engine_version;
  1399. if ($v !== null) {
  1400. $v = (int) $v;
  1401. }
  1402. if ($this->engine_version !== $v) {
  1403. $this->engine_version = $v;
  1404. $this->modifiedColumns[] = assetParamsPeer::ENGINE_VERSION;
  1405. }
  1406. return $this;
  1407. } // setEngineVersion()
  1408. /**
  1409. * Set the value of [type] column.
  1410. *
  1411. * @param int $v new value
  1412. * @return assetParams The current object (for fluent API support)
  1413. */
  1414. public function setType($v)
  1415. {
  1416. if(!isset($this->oldColumnsValues[assetParamsPeer::TYPE]))
  1417. $this->oldColumnsValues[assetParamsPeer::TYPE] = $this->type;
  1418. if ($v !== null) {
  1419. $v = (int) $v;
  1420. }
  1421. if ($this->type !== $v || $this->isNew()) {
  1422. $this->type = $v;
  1423. $this->modifiedColumns[] = assetParamsPeer::TYPE;
  1424. }
  1425. return $this;
  1426. } // setType()
  1427. /**
  1428. * Indicates whether the columns in this object are only set to default values.
  1429. *
  1430. * This method can be used in conjunction with isModified() to indicate whether an object is both
  1431. * modified _and_ has some values set which are non-default.
  1432. *
  1433. * @return boolean Whether the columns in this object are only been set with default values.
  1434. */
  1435. public function hasOnlyDefaultValues()
  1436. {
  1437. if ($this->name !== '') {
  1438. return false;
  1439. }
  1440. if ($this->system_name !== '') {
  1441. return false;
  1442. }
  1443. if ($this->description !== '') {
  1444. return false;
  1445. }
  1446. if ($this->is_default !== 0) {
  1447. return false;
  1448. }
  1449. if ($this->video_bitrate !== 0) {
  1450. return false;
  1451. }
  1452. if ($this->audio_bitrate !== 0) {
  1453. return false;
  1454. }
  1455. if ($this->audio_channels !== 0) {
  1456. return false;
  1457. }
  1458. if ($this->audio_sample_rate !== 0) {
  1459. return false;
  1460. }
  1461. if ($this->audio_resolution !== 0) {
  1462. return false;
  1463. }
  1464. if ($this->width !== 0) {
  1465. return false;
  1466. }
  1467. if ($this->height !== 0) {
  1468. return false;
  1469. }
  1470. if ($this->frame_rate !== 0) {
  1471. return false;
  1472. }
  1473. if ($this->gop_size !== 0) {
  1474. return false;
  1475. }
  1476. if ($this->two_pass !== false) {
  1477. return false;
  1478. }
  1479. if ($this->creation_mode !== 1) {
  1480. return false;
  1481. }
  1482. if ($this->type !== 0) {
  1483. return false;
  1484. }
  1485. // otherwise, everything was equal, so return TRUE
  1486. return true;
  1487. } // hasOnlyDefaultValues()
  1488. /**
  1489. * Hydrates (populates) the object variables with values from the database resultset.
  1490. *
  1491. * An offset (0-based "start column") is specified so that objects can be hydrated
  1492. * with a subset of the columns in the resultset rows. This is needed, for example,
  1493. * for results of JOIN queries where the resultset row includes columns from two or
  1494. * more tables.
  1495. *
  1496. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  1497. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  1498. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  1499. * @return int next starting column
  1500. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  1501. */
  1502. public function hydrate($row, $startcol = 0, $rehydrate = false)
  1503. {
  1504. try {
  1505. $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
  1506. $this->version = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
  1507. $this->partner_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
  1508. $this->name = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
  1509. $this->system_name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
  1510. $this->tags = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
  1511. $this->description = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
  1512. $this->ready_behavior = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
  1513. $this->created_at = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
  1514. $this->updated_at = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
  1515. $this->deleted_at = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
  1516. $this->is_default = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
  1517. $this->format = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
  1518. $this->video_codec = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
  1519. $this->video_bitrate = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
  1520. $this->audio_codec = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
  1521. $this->audio_bitrate = ($row[$startcol + 16] !== null) ? (int) $row[$startcol + 16] : null;
  1522. $this->audio_channels = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null;
  1523. $this->audio_sample_rate = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null;
  1524. $this->audio_resolution = ($row[$startcol + 19] !== null) ? (int) $row[$startcol + 19] : null;
  1525. $this->width = ($row[$startcol + 20] !== null) ? (int) $row[$startcol + 20] : null;
  1526. $this->height = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null;
  1527. $this->frame_rate = ($row[$startcol + 22] !== null) ? (double) $row[$startcol + 22] : null;
  1528. $this->gop_size = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null;
  1529. $this->two_pass = ($row[$startcol + 24] !== null) ? (boolean) $row[$startcol + 24] : null;
  1530. $this->conversion_engines = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null;
  1531. $this->conversion_engines_extra_params = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
  1532. $this->custom_data = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
  1533. $this->view_order = ($row[$startcol + 28] !== null) ? (int) $row[$startcol + 28] : null;
  1534. $this->creation_mode = ($row[$startcol + 29] !== null) ? (int) $row[$startcol + 29] : null;
  1535. $this->deinterlice = ($row[$startcol + 30] !== null) ? (int) $row[$startcol + 30] : null;
  1536. $this->rotate = ($row[$startcol + 31] !== null) ? (int) $row[$startcol + 31] : null;
  1537. $this->operators = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
  1538. $this->engine_version = ($row[$startcol + 33] !== null) ? (int) $row[$startcol + 33] : null;
  1539. $this->type = ($row[$startcol + 34] !== null) ? (int) $row[$startcol + 34] : null;
  1540. $this->resetModified();
  1541. $this->setNew(false);
  1542. if ($rehydrate) {
  1543. $this->ensureConsistency();
  1544. }
  1545. // FIXME - using NUM_COLUMNS may be clearer.
  1546. return $startcol + 35; // 35 = assetParamsPeer::NUM_COLUMNS - assetParamsPeer::NUM_LAZY_LOAD_COLUMNS).
  1547. } catch (Exception $e) {
  1548. throw new PropelException("Error populating assetParams object", $e);
  1549. }
  1550. }
  1551. /**
  1552. * Checks and repairs the internal consistency of the object.
  1553. *
  1554. * This method is executed after an already-instantiated object is re-hydrated
  1555. * from the database. It exists to check any foreign keys to make sure that
  1556. * the objects related to the current object are correct based on foreign key.
  1557. *
  1558. * You can override this method in the stub class, but you should always invoke
  1559. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  1560. * in case your model changes.
  1561. *
  1562. * @throws PropelException
  1563. */
  1564. public function ensureConsistency()
  1565. {
  1566. } // ensureConsistency
  1567. /**
  1568. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  1569. *
  1570. * This will only work if the object has been saved and has a valid primary key set.
  1571. *
  1572. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  1573. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  1574. * @return void
  1575. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  1576. */
  1577. public function reload($deep = false, PropelPDO $con = null)
  1578. {
  1579. if ($this->isDeleted()) {
  1580. throw new PropelException("Cannot reload a deleted object.");
  1581. }
  1582. if ($this->isNew()) {
  1583. throw new PropelException("Cannot reload an unsaved object.");
  1584. }
  1585. if ($con === null) {
  1586. $con = Propel::getConnection(assetParamsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  1587. }
  1588. // We don't need to alter the object instance pool; we're just modifying this instance
  1589. // already in the pool.
  1590. assetParamsPeer::setUseCriteriaFilter(false);
  1591. $stmt = assetParamsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  1592. assetParamsPeer::setUseCriteriaFilter(true);
  1593. $row = $stmt->fetch(PDO::FETCH_NUM);
  1594. $stmt->closeCursor();
  1595. if (!$row) {
  1596. throw new PropelException('Cannot find matching row in the database to reload object values.');
  1597. }
  1598. $this->hydrate($row, 0, true); // rehydrate
  1599. if ($deep) { // also de-associate any related objects?
  1600. $this->collassetParamsOutputs = null;
  1601. $this->lastassetParamsOutputCriteria = null;
  1602. $this->collassets = null;
  1603. $this->lastassetCriteria = null;
  1604. $this->collflavorParamsConversionProfiles = null;
  1605. $this->lastflavorParamsConversionProfileCriteria = null;
  1606. } // if (deep)
  1607. }
  1608. /**
  1609. * Removes this object from datastore and sets delete attribute.
  1610. *
  1611. * @param PropelPDO $con
  1612. * @return void
  1613. * @throws PropelException
  1614. * @see BaseObject::setDeleted()
  1615. * @see BaseObject::isDeleted()
  1616. */
  1617. public function delete(PropelPDO $con = null)
  1618. {
  1619. if ($this->isDeleted()) {
  1620. throw new PropelException("This object has already been deleted.");
  1621. }
  1622. if ($con === null) {
  1623. $con = Propel::getConnection(assetParamsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  1624. }
  1625. $con->beginTransaction();
  1626. try {
  1627. $ret = $this->preDelete($con);
  1628. if ($ret) {
  1629. assetParamsPeer::doDelete($this, $con);
  1630. $this->postDelete($con);
  1631. $this->setDeleted(true);
  1632. $con->commit();
  1633. } else {
  1634. $con->commit();
  1635. }
  1636. } catch (PropelException $e) {
  1637. $con->rollBack();
  1638. throw $e;
  1639. }
  1640. }
  1641. /**
  1642. * Persists this object to the database.
  1643. *
  1644. * If the object is new, it inserts it; otherwise an update is performed.
  1645. * All modified related objects will also be persisted in the doSave()
  1646. * method. This method wraps all precipitate database operations in a
  1647. * single transaction.
  1648. *
  1649. * @param PropelPDO $con
  1650. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1651. * @throws PropelException
  1652. * @see doSave()
  1653. */
  1654. public function save(PropelPDO $con = null)
  1655. {
  1656. if ($this->isDeleted()) {
  1657. throw new PropelException("You cannot save an object that has been deleted.");
  1658. }
  1659. if ($con === null) {
  1660. $con = Propel::getConnection(assetParamsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  1661. }
  1662. $con->beginTransaction();
  1663. $isInsert = $this->isNew();
  1664. try {
  1665. $ret = $this->preSave($con);
  1666. if ($isInsert) {
  1667. $ret = $ret && $this->preInsert($con);
  1668. } else {
  1669. $ret = $ret && $this->preUpdate($con);
  1670. }
  1671. if ($ret) {
  1672. $affectedRows = $this->doSave($con);
  1673. if ($isInsert) {
  1674. $this->postInsert($con);
  1675. } else {
  1676. $this->postUpdate($con);
  1677. }
  1678. $this->postSave($con);
  1679. assetParamsPeer::addInstanceToPool($this);
  1680. } else {
  1681. $affectedRows = 0;
  1682. }
  1683. $con->commit();
  1684. return $affectedRows;
  1685. } catch (PropelException $e) {
  1686. $con->rollBack();
  1687. throw $e;
  1688. }
  1689. }
  1690. /**
  1691. * Performs the work of inserting or updating the row in the database.
  1692. *
  1693. * If the object is new, it inserts it; otherwise an update is performed.
  1694. * All related objects are also updated in this method.
  1695. *
  1696. * @param PropelPDO $con
  1697. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  1698. * @throws PropelException
  1699. * @see save()
  1700. */
  1701. protected function doSave(PropelPDO $con)
  1702. {
  1703. $affectedRows = 0; // initialize var to track total num of affected rows
  1704. if (!$this->alreadyInSave) {
  1705. $this->alreadyInSave = true;
  1706. if ($this->isNew() ) {
  1707. $this->modifiedColumns[] = assetParamsPeer::ID;
  1708. }
  1709. // If this object has been modified, then save it to the database.
  1710. if ($this->isModified()) {
  1711. if ($this->isNew()) {
  1712. $pk = assetParamsPeer::doInsert($this, $con);
  1713. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  1714. // should always be true here (even though technically
  1715. // BasePeer::doInsert() can insert multiple rows).
  1716. $this->setId($pk); //[IMV] update autoincrement primary key
  1717. $this->setNew(false);
  1718. } else {
  1719. $affectedRows += assetParamsPeer::doUpdate($this, $con);
  1720. }
  1721. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  1722. }
  1723. if ($this->collassetParamsOutputs !== null) {
  1724. foreach ($this->collassetParamsOutputs as $referrerFK) {
  1725. if (!$referrerFK->isDeleted()) {
  1726. $affectedRows += $referrerFK->save($con);
  1727. }
  1728. }
  1729. }
  1730. if ($this->collassets !== null) {
  1731. foreach ($this->collassets as $referrerFK) {
  1732. if (!$referrerFK->isDeleted()) {
  1733. $affectedRows += $referrerFK->save($con);
  1734. }
  1735. }
  1736. }
  1737. if ($this->collflavorParamsConversionProfiles !== null) {
  1738. foreach ($this->collflavorParamsConversionProfiles as $referrerFK) {
  1739. if (!$referrerFK->isDeleted()) {
  1740. $affectedRows += $referrerFK->save($con);
  1741. }
  1742. }
  1743. }
  1744. $this->alreadyInSave = false;
  1745. }
  1746. return $affectedRows;
  1747. } // doSave()
  1748. /**
  1749. * Override in order to use the query cache.
  1750. * Cache invalidation keys are used to determine when cached queries are valid.
  1751. * Before returning a query result from the cache, the time of the cached query
  1752. * is compared to the time saved in the invalidation key.
  1753. * A cached query will only be used if it's newer than the matching invalidation key.
  1754. *
  1755. * @return array Array of keys that will should be updated when this object is modified.
  1756. */
  1757. public function getCacheInvalidationKeys()
  1758. {
  1759. return array();
  1760. }
  1761. /**
  1762. * Code to be run before persisting the object
  1763. * @param PropelPDO $con
  1764. * @return bloolean
  1765. */
  1766. public function preSave(PropelPDO $con = null)
  1767. {
  1768. $this->setCustomDataObj();
  1769. return parent::preSave($con);
  1770. }
  1771. /**
  1772. * Code to be run after persisting the object
  1773. * @param PropelPDO $con
  1774. */
  1775. public function postSave(PropelPDO $con = null)
  1776. {
  1777. $this->oldColumnsValues = array();
  1778. $this->oldCustomDataValues = array();
  1779. }
  1780. /**
  1781. * Code to be run before inserting to database
  1782. * @param PropelPDO $con
  1783. * @return boolean
  1784. */
  1785. public function preInsert(PropelPDO $con = null)
  1786. {
  1787. $this->setCreatedAt(time());
  1788. $this->setUpdatedAt(time());
  1789. return true;
  1790. }
  1791. /**
  1792. * Code to be run after inserting to database
  1793. * @param PropelPDO $con
  1794. */
  1795. public function postInsert(PropelPDO $con = null)
  1796. {
  1797. kQueryCache::invalidateQueryCache($this);
  1798. kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
  1799. if($this->copiedFrom)
  1800. kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
  1801. }
  1802. /**
  1803. * Code to be run after updating the object in database
  1804. * @param PropelPDO $con
  1805. */
  1806. public function postUpdate(PropelPDO $con = null)
  1807. {
  1808. if ($this->alreadyInSave)
  1809. {
  1810. return;
  1811. }
  1812. if($this->isModified())
  1813. {
  1814. kQueryCache::invalidateQueryCache($this);
  1815. kEventsManager::raiseEvent(new kObjectChangedEvent($this, $this->tempModifiedColumns));
  1816. }
  1817. $this->tempModifiedColumns = array();
  1818. }
  1819. /**
  1820. * Saves the modified columns temporarily while saving
  1821. * @var array
  1822. */
  1823. private $tempModifiedColumns = array();
  1824. /**
  1825. * Returns whether the object has been modified.
  1826. *
  1827. * @return boolean True if the object has been modified.
  1828. */
  1829. public function isModified()
  1830. {
  1831. if(!empty($this->tempModifiedColumns))
  1832. return true;
  1833. return !empty($this->modifiedColumns);
  1834. }
  1835. /**
  1836. * Has specified column been modified?
  1837. *
  1838. * @param string $col
  1839. * @return boolean True if $col has been modified.
  1840. */
  1841. public function isColumnModified($col)
  1842. {
  1843. if(in_array($col, $this->tempModifiedColumns))
  1844. return true;
  1845. return in_array($col, $this->modifiedColumns);
  1846. }
  1847. /**
  1848. * Code to be run before updating the object in database
  1849. * @param PropelPDO $con
  1850. * @return boolean
  1851. */
  1852. public function preUpdate(PropelPDO $con = null)
  1853. {
  1854. if ($this->alreadyInSave)
  1855. {
  1856. return true;
  1857. }
  1858. if($this->isModified())
  1859. $this->setUpdatedAt(time());
  1860. $this->tempModifiedColumns = $this->modifiedColumns;
  1861. return true;
  1862. }
  1863. /**
  1864. * Array of ValidationFailed objects.
  1865. * @var array ValidationFailed[]
  1866. */
  1867. protected $validationFailures = array();
  1868. /**
  1869. * Gets any ValidationFailed objects that resulted from last call to validate().
  1870. *
  1871. *
  1872. * @return array ValidationFailed[]
  1873. * @see validate()
  1874. */
  1875. public function getValidationFailures()
  1876. {
  1877. return $this->validationFailures;
  1878. }
  1879. /**
  1880. * Validates the objects modified field values and all objects related to this table.
  1881. *
  1882. * If $columns is either a column name or an array of column names
  1883. * only those columns are validated.
  1884. *
  1885. * @param mixed $columns Column name or an array of column names.
  1886. * @return boolean Whether all columns pass validation.
  1887. * @see doValidate()
  1888. * @see getValidationFailures()
  1889. */
  1890. public function validate($columns = null)
  1891. {
  1892. $res = $this->doValidate($columns);
  1893. if ($res === true) {
  1894. $this->validationFailures = array();
  1895. return true;
  1896. } else {
  1897. $this->validationFailures = $res;
  1898. return false;
  1899. }
  1900. }
  1901. /**
  1902. * This function performs the validation work for complex object models.
  1903. *
  1904. * In addition to checking the current object, all related objects will
  1905. * also be validated. If all pass then <code>true</code> is returned; otherwise
  1906. * an aggreagated array of ValidationFailed objects will be returned.
  1907. *
  1908. * @param array $columns Array of column names to validate.
  1909. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  1910. */
  1911. protected function doValidate($columns = null)
  1912. {
  1913. if (!$this->alreadyInValidation) {
  1914. $this->alreadyInValidation = true;
  1915. $retval = null;
  1916. $failureMap = array();
  1917. if (($retval = assetParamsPeer::doValidate($this, $columns)) !== true) {
  1918. $failureMap = array_merge($failureMap, $retval);
  1919. }
  1920. if ($this->collassetParamsOutputs !== null) {
  1921. foreach ($this->collassetParamsOutputs as $referrerFK) {
  1922. if (!$referrerFK->validate($columns)) {
  1923. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1924. }
  1925. }
  1926. }
  1927. if ($this->collassets !== null) {
  1928. foreach ($this->collassets as $referrerFK) {
  1929. if (!$referrerFK->validate($columns)) {
  1930. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1931. }
  1932. }
  1933. }
  1934. if ($this->collflavorParamsConversionProfiles !== null) {
  1935. foreach ($this->collflavorParamsConversionProfiles as $referrerFK) {
  1936. if (!$referrerFK->validate($columns)) {
  1937. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1938. }
  1939. }
  1940. }
  1941. $this->alreadyInValidation = false;
  1942. }
  1943. return (!empty($failureMap) ? $failureMap : true);
  1944. }
  1945. /**
  1946. * Retrieves a field from the object by name passed in as a string.
  1947. *
  1948. * @param string $name name
  1949. * @param string $type The type of fieldname the $name is of:
  1950. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1951. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1952. * @return mixed Value of field.
  1953. */
  1954. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  1955. {
  1956. $pos = assetParamsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1957. $field = $this->getByPosition($pos);
  1958. return $field;
  1959. }
  1960. /**
  1961. * Retrieves a field from the object by Position as specified in the xml schema.
  1962. * Zero-based.
  1963. *
  1964. * @param int $pos position in xml schema
  1965. * @return mixed Value of field at $pos
  1966. */
  1967. public function getByPosition($pos)
  1968. {
  1969. switch($pos) {
  1970. case 0:
  1971. return $this->getId();
  1972. break;
  1973. case 1:
  1974. return $this->getVersion();
  1975. break;
  1976. case 2:
  1977. return $this->getPartnerId();
  1978. break;
  1979. case 3:
  1980. return $this->getName();
  1981. break;
  1982. case 4:
  1983. return $this->getSystemName();
  1984. break;
  1985. case 5:
  1986. return $this->getTags();
  1987. break;
  1988. case 6:
  1989. return $this->getDescription();
  1990. break;
  1991. case 7:
  1992. return $this->getReadyBehavior();
  1993. break;
  1994. case 8:
  1995. return $this->getCreatedAt();
  1996. break;
  1997. case 9:
  1998. return $this->getUpdatedAt();
  1999. break;
  2000. case 10:
  2001. return $this->getDeletedAt();
  2002. break;
  2003. case 11:
  2004. return $this->getIsDefault();
  2005. break;
  2006. case 12:
  2007. return $this->getFormat();
  2008. break;
  2009. case 13:
  2010. return $this->getVideoCodec();
  2011. break;
  2012. case 14:
  2013. return $this->getVideoBitrate();
  2014. break;
  2015. case 15:
  2016. return $this->getAudioCodec();
  2017. break;
  2018. case 16:
  2019. return $this->getAudioBitrate();
  2020. break;
  2021. case 17:
  2022. return $this->getAudioChannels();
  2023. break;
  2024. case 18:
  2025. return $this->getAudioSampleRate();
  2026. break;
  2027. case 19:
  2028. return $this->getAudioResolution();
  2029. break;
  2030. case 20:
  2031. return $this->getWidth();
  2032. break;
  2033. case 21:
  2034. return $this->getHeight();
  2035. break;
  2036. case 22:
  2037. return $this->getFrameRate();
  2038. break;
  2039. case 23:
  2040. return $this->getGopSize();
  2041. break;
  2042. case 24:
  2043. return $this->getTwoPass();
  2044. break;
  2045. case 25:
  2046. return $this->getConversionEngines();
  2047. break;
  2048. case 26:
  2049. return $this->getConversionEnginesExtraParams();
  2050. break;
  2051. case 27:
  2052. return $this->getCustomData();
  2053. break;
  2054. case 28:
  2055. return $this->getViewOrder();
  2056. break;
  2057. case 29:
  2058. return $this->getCreationMode();
  2059. break;
  2060. case 30:
  2061. return $this->getDeinterlice();
  2062. break;
  2063. case 31:
  2064. return $this->getRotate();
  2065. break;
  2066. case 32:
  2067. return $this->getOperators();
  2068. break;
  2069. case 33:
  2070. return $this->getEngineVersion();
  2071. break;
  2072. case 34:
  2073. return $this->getType();
  2074. break;
  2075. default:
  2076. return null;
  2077. break;
  2078. } // switch()
  2079. }
  2080. /**
  2081. * Exports the object as an array.
  2082. *
  2083. * You can specify the key type of the array by passing one of the class
  2084. * type constants.
  2085. *
  2086. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  2087. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  2088. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  2089. * @return an associative array containing the field names (as keys) and field values
  2090. */
  2091. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  2092. {
  2093. $keys = assetParamsPeer::getFieldNames($keyType);
  2094. $result = array(
  2095. $keys[0] => $this->getId(),
  2096. $keys[1] => $this->getVersion(),
  2097. $keys[2] => $this->getPartnerId(),
  2098. $keys[3] => $this->getName(),
  2099. $keys[4] => $this->getSystemName(),
  2100. $keys[5] => $this->getTags(),
  2101. $keys[6] => $this->getDescription(),
  2102. $keys[7] => $this->getReadyBehavior(),
  2103. $keys[8] => $this->getCreatedAt(),
  2104. $keys[9] => $this->getUpdatedAt(),
  2105. $keys[10] => $this->getDeletedAt(),
  2106. $keys[11] => $this->getIsDefault(),
  2107. $keys[12] => $this->getFormat(),
  2108. $keys[13] => $this->getVideoCodec(),
  2109. $keys[14] => $this->getVideoBitrate(),
  2110. $keys[15] => $this->getAudioCodec(),
  2111. $keys[16] => $this->getAudioBitrate(),
  2112. $keys[17] => $this->getAudioChannels(),
  2113. $keys[18] => $this->getAudioSampleRate(),
  2114. $keys[19] => $this->getAudioResolution(),
  2115. $keys[20] => $this->getWidth(),
  2116. $keys[21] => $this->getHeight(),
  2117. $keys[22] => $this->getFrameRate(),
  2118. $keys[23] => $this->getGopSize(),
  2119. $keys[24] => $this->getTwoPass(),
  2120. $keys[25] => $this->getConversionEngines(),
  2121. $keys[26] => $this->getConversionEnginesExtraParams(),
  2122. $keys[27] => $this->getCustomData(),
  2123. $keys[28] => $this->getViewOrder(),
  2124. $keys[29] => $this->getCreationMode(),
  2125. $keys[30] => $this->getDeinterlice(),
  2126. $keys[31] => $this->getRotate(),
  2127. $keys[32] => $this->getOperators(),
  2128. $keys[33] => $this->getEngineVersion(),
  2129. $keys[34] => $this->getType(),
  2130. );
  2131. return $result;
  2132. }
  2133. /**
  2134. * Sets a field from the object by name passed in as a string.
  2135. *
  2136. * @param string $name peer name
  2137. * @param mixed $value field value
  2138. * @param string $type The type of fieldname the $name is of:
  2139. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  2140. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  2141. * @return void
  2142. */
  2143. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  2144. {
  2145. $pos = assetParamsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  2146. return $this->setByPosition($pos, $value);
  2147. }
  2148. /**
  2149. * Sets a field from the object by Position as specified in the xml schema.
  2150. * Zero-based.
  2151. *
  2152. * @param int $pos position in xml schema
  2153. * @param mixed $value field value
  2154. * @return void
  2155. */
  2156. public function setByPosition($pos, $value)
  2157. {
  2158. switch($pos) {
  2159. case 0:
  2160. $this->setId($value);
  2161. break;
  2162. case 1:
  2163. $this->setVersion($value);
  2164. break;
  2165. case 2:
  2166. $this->setPartnerId($value);
  2167. break;
  2168. case 3:
  2169. $this->setName($value);
  2170. break;
  2171. case 4:
  2172. $this->setSystemName($value);
  2173. break;
  2174. case 5:
  2175. $this->setTags($value);
  2176. break;
  2177. case 6:
  2178. $this->setDescription($value);
  2179. break;
  2180. case 7:
  2181. $this->setReadyBehavior($value);
  2182. break;
  2183. case 8:
  2184. $this->setCreatedAt($value);
  2185. break;
  2186. case 9:
  2187. $this->setUpdatedAt($value);
  2188. break;
  2189. case 10:
  2190. $this->setDeletedAt($value);
  2191. break;
  2192. case 11:
  2193. $this->setIsDefault($value);
  2194. break;
  2195. case 12:
  2196. $this->setFormat($value);
  2197. break;
  2198. case 13:
  2199. $this->setVideoCodec($value);
  2200. break;
  2201. case 14:
  2202. $this->setVideoBitrate($value);
  2203. break;
  2204. case 15:
  2205. $this->setAudioCodec($value);
  2206. break;
  2207. case 16:
  2208. $this->setAudioBitrate($value);
  2209. break;
  2210. case 17:
  2211. $this->setAudioChannels($value);
  2212. break;
  2213. case 18:
  2214. $this->setAudioSampleRate($value);
  2215. break;
  2216. case 19:
  2217. $this->setAudioResolution($value);
  2218. break;
  2219. case 20:
  2220. $this->setWidth($value);
  2221. break;
  2222. case 21:
  2223. $this->setHeight($value);
  2224. break;
  2225. case 22:
  2226. $this->setFrameRate($value);
  2227. break;
  2228. case 23:
  2229. $this->setGopSize($value);
  2230. break;
  2231. case 24:
  2232. $this->setTwoPass($value);
  2233. break;
  2234. case 25:
  2235. $this->setConversionEngines($value);
  2236. break;
  2237. case 26:
  2238. $this->setConversionEnginesExtraParams($value);
  2239. break;
  2240. case 27:
  2241. $this->setCustomData($value);
  2242. break;
  2243. case 28:
  2244. $this->setViewOrder($value);
  2245. break;
  2246. case 29:
  2247. $this->setCreationMode($value);
  2248. break;
  2249. case 30:
  2250. $this->setDeinterlice($value);
  2251. break;
  2252. case 31:
  2253. $this->setRotate($value);
  2254. break;
  2255. case 32:
  2256. $this->setOperators($value);
  2257. break;
  2258. case 33:
  2259. $this->setEngineVersion($value);
  2260. break;
  2261. case 34:
  2262. $this->setType($value);
  2263. break;
  2264. } // switch()
  2265. }
  2266. /**
  2267. * Populates the object using an array.
  2268. *
  2269. * This is particularly useful when populating an object from one of the
  2270. * request arrays (e.g. $_POST). This method goes through the column
  2271. * names, checking to see whether a matching key exists in populated
  2272. * array. If so the setByName() method is called for that column.
  2273. *
  2274. * You can specify the key type of the array by additionally passing one
  2275. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  2276. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  2277. * The default key type is the column's phpname (e.g. 'AuthorId')
  2278. *
  2279. * @param array $arr An array to populate the object from.
  2280. * @param string $keyType The type of keys the array uses.
  2281. * @return void
  2282. */
  2283. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  2284. {
  2285. $keys = assetParamsPeer::getFieldNames($keyType);
  2286. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  2287. if (array_key_exists($keys[1], $arr)) $this->setVersion($arr[$keys[1]]);
  2288. if (array_key_exists($keys[2], $arr)) $this->setPartnerId($arr[$keys[2]]);
  2289. if (array_key_exists($keys[3], $arr)) $this->setName($arr[$keys[3]]);
  2290. if (array_key_exists($keys[4], $arr)) $this->setSystemName($arr[$keys[4]]);
  2291. if (array_key_exists($keys[5], $arr)) $this->setTags($arr[$keys[5]]);
  2292. if (array_key_exists($keys[6], $arr)) $this->setDescription($arr[$keys[6]]);
  2293. if (array_key_exists($keys[7], $arr)) $this->setReadyBehavior($arr[$keys[7]]);
  2294. if (array_key_exists($keys[8], $arr)) $this->setCreatedAt($arr[$keys[8]]);
  2295. if (array_key_exists($keys[9], $arr)) $this->setUpdatedAt($arr[$keys[9]]);
  2296. if (array_key_exists($keys[10], $arr)) $this->setDeletedAt($arr[$keys[10]]);
  2297. if (array_key_exists($keys[11], $arr)) $this->setIsDefault($arr[$keys[11]]);
  2298. if (array_key_exists($keys[12], $arr)) $this->setFormat($arr[$keys[12]]);
  2299. if (array_key_exists($keys[13], $arr)) $this->setVideoCodec($arr[$keys[13]]);
  2300. if (array_key_exists($keys[14], $arr)) $this->setVideoBitrate($arr[$keys[14]]);
  2301. if (array_key_exists($keys[15], $arr)) $this->setAudioCodec($arr[$keys[15]]);
  2302. if (array_key_exists($keys[16], $arr)) $this->setAudioBitrate($arr[$keys[16]]);
  2303. if (array_key_exists($keys[17], $arr)) $this->setAudioChannels($arr[$keys[17]]);
  2304. if (array_key_exists($keys[18], $arr)) $this->setAudioSampleRate($arr[$keys[18]]);
  2305. if (array_key_exists($keys[19], $arr)) $this->setAudioResolution($arr[$keys[19]]);
  2306. if (array_key_exists($keys[20], $arr)) $this->setWidth($arr[$keys[20]]);
  2307. if (array_key_exists($keys[21], $arr)) $this->setHeight($arr[$keys[21]]);
  2308. if (array_key_exists($keys[22], $arr)) $this->setFrameRate($arr[$keys[22]]);
  2309. if (array_key_exists($keys[23], $arr)) $this->setGopSize($arr[$keys[23]]);
  2310. if (array_key_exists($keys[24], $arr)) $this->setTwoPass($arr[$keys[24]]);
  2311. if (array_key_exists($keys[25], $arr)) $this->setConversionEngines($arr[$keys[25]]);
  2312. if (array_key_exists($keys[26], $arr)) $this->setConversionEnginesExtraParams($arr[$keys[26]]);
  2313. if (array_key_exists($keys[27], $arr)) $this->setCustomData($arr[$keys[27]]);
  2314. if (array_key_exists($keys[28], $arr)) $this->setViewOrder($arr[$keys[28]]);
  2315. if (array_key_exists($keys[29], $arr)) $this->setCreationMode($arr[$keys[29]]);
  2316. if (array_key_exists($keys[30], $arr)) $this->setDeinterlice($arr[$keys[30]]);
  2317. if (array_key_exists($keys[31], $arr)) $this->setRotate($arr[$keys[31]]);
  2318. if (array_key_exists($keys[32], $arr)) $this->setOperators($arr[$keys[32]]);
  2319. if (array_key_exists($keys[33], $arr)) $this->setEngineVersion($arr[$keys[33]]);
  2320. if (array_key_exists($keys[34], $arr)) $this->setType($arr[$keys[34]]);
  2321. }
  2322. /**
  2323. * Build a Criteria object containing the values of all modified columns in this object.
  2324. *
  2325. * @return Criteria The Criteria object containing all modified values.
  2326. */
  2327. public function buildCriteria()
  2328. {
  2329. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2330. if ($this->isColumnModified(assetParamsPeer::ID)) $criteria->add(assetParamsPeer::ID, $this->id);
  2331. if ($this->isColumnModified(assetParamsPeer::VERSION)) $criteria->add(assetParamsPeer::VERSION, $this->version);
  2332. if ($this->isColumnModified(assetParamsPeer::PARTNER_ID)) $criteria->add(assetParamsPeer::PARTNER_ID, $this->partner_id);
  2333. if ($this->isColumnModified(assetParamsPeer::NAME)) $criteria->add(assetParamsPeer::NAME, $this->name);
  2334. if ($this->isColumnModified(assetParamsPeer::SYSTEM_NAME)) $criteria->add(assetParamsPeer::SYSTEM_NAME, $this->system_name);
  2335. if ($this->isColumnModified(assetParamsPeer::TAGS)) $criteria->add(assetParamsPeer::TAGS, $this->tags);
  2336. if ($this->isColumnModified(assetParamsPeer::DESCRIPTION)) $criteria->add(assetParamsPeer::DESCRIPTION, $this->description);
  2337. if ($this->isColumnModified(assetParamsPeer::READY_BEHAVIOR)) $criteria->add(assetParamsPeer::READY_BEHAVIOR, $this->ready_behavior);
  2338. if ($this->isColumnModified(assetParamsPeer::CREATED_AT)) $criteria->add(assetParamsPeer::CREATED_AT, $this->created_at);
  2339. if ($this->isColumnModified(assetParamsPeer::UPDATED_AT)) $criteria->add(assetParamsPeer::UPDATED_AT, $this->updated_at);
  2340. if ($this->isColumnModified(assetParamsPeer::DELETED_AT)) $criteria->add(assetParamsPeer::DELETED_AT, $this->deleted_at);
  2341. if ($this->isColumnModified(assetParamsPeer::IS_DEFAULT)) $criteria->add(assetParamsPeer::IS_DEFAULT, $this->is_default);
  2342. if ($this->isColumnModified(assetParamsPeer::FORMAT)) $criteria->add(assetParamsPeer::FORMAT, $this->format);
  2343. if ($this->isColumnModified(assetParamsPeer::VIDEO_CODEC)) $criteria->add(assetParamsPeer::VIDEO_CODEC, $this->video_codec);
  2344. if ($this->isColumnModified(assetParamsPeer::VIDEO_BITRATE)) $criteria->add(assetParamsPeer::VIDEO_BITRATE, $this->video_bitrate);
  2345. if ($this->isColumnModified(assetParamsPeer::AUDIO_CODEC)) $criteria->add(assetParamsPeer::AUDIO_CODEC, $this->audio_codec);
  2346. if ($this->isColumnModified(assetParamsPeer::AUDIO_BITRATE)) $criteria->add(assetParamsPeer::AUDIO_BITRATE, $this->audio_bitrate);
  2347. if ($this->isColumnModified(assetParamsPeer::AUDIO_CHANNELS)) $criteria->add(assetParamsPeer::AUDIO_CHANNELS, $this->audio_channels);
  2348. if ($this->isColumnModified(assetParamsPeer::AUDIO_SAMPLE_RATE)) $criteria->add(assetParamsPeer::AUDIO_SAMPLE_RATE, $this->audio_sample_rate);
  2349. if ($this->isColumnModified(assetParamsPeer::AUDIO_RESOLUTION)) $criteria->add(assetParamsPeer::AUDIO_RESOLUTION, $this->audio_resolution);
  2350. if ($this->isColumnModified(assetParamsPeer::WIDTH)) $criteria->add(assetParamsPeer::WIDTH, $this->width);
  2351. if ($this->isColumnModified(assetParamsPeer::HEIGHT)) $criteria->add(assetParamsPeer::HEIGHT, $this->height);
  2352. if ($this->isColumnModified(assetParamsPeer::FRAME_RATE)) $criteria->add(assetParamsPeer::FRAME_RATE, $this->frame_rate);
  2353. if ($this->isColumnModified(assetParamsPeer::GOP_SIZE)) $criteria->add(assetParamsPeer::GOP_SIZE, $this->gop_size);
  2354. if ($this->isColumnModified(assetParamsPeer::TWO_PASS)) $criteria->add(assetParamsPeer::TWO_PASS, $this->two_pass);
  2355. if ($this->isColumnModified(assetParamsPeer::CONVERSION_ENGINES)) $criteria->add(assetParamsPeer::CONVERSION_ENGINES, $this->conversion_engines);
  2356. if ($this->isColumnModified(assetParamsPeer::CONVERSION_ENGINES_EXTRA_PARAMS)) $criteria->add(assetParamsPeer::CONVERSION_ENGINES_EXTRA_PARAMS, $this->conversion_engines_extra_params);
  2357. if ($this->isColumnModified(assetParamsPeer::CUSTOM_DATA)) $criteria->add(assetParamsPeer::CUSTOM_DATA, $this->custom_data);
  2358. if ($this->isColumnModified(assetParamsPeer::VIEW_ORDER)) $criteria->add(assetParamsPeer::VIEW_ORDER, $this->view_order);
  2359. if ($this->isColumnModified(assetParamsPeer::CREATION_MODE)) $criteria->add(assetParamsPeer::CREATION_MODE, $this->creation_mode);
  2360. if ($this->isColumnModified(assetParamsPeer::DEINTERLICE)) $criteria->add(assetParamsPeer::DEINTERLICE, $this->deinterlice);
  2361. if ($this->isColumnModified(assetParamsPeer::ROTATE)) $criteria->add(assetParamsPeer::ROTATE, $this->rotate);
  2362. if ($this->isColumnModified(assetParamsPeer::OPERATORS)) $criteria->add(assetParamsPeer::OPERATORS, $this->operators);
  2363. if ($this->isColumnModified(assetParamsPeer::ENGINE_VERSION)) $criteria->add(assetParamsPeer::ENGINE_VERSION, $this->engine_version);
  2364. if ($this->isColumnModified(assetParamsPeer::TYPE)) $criteria->add(assetParamsPeer::TYPE, $this->type);
  2365. return $criteria;
  2366. }
  2367. /**
  2368. * Builds a Criteria object containing the primary key for this object.
  2369. *
  2370. * Unlike buildCriteria() this method includes the primary key values regardless
  2371. * of whether or not they have been modified.
  2372. *
  2373. * @return Criteria The Criteria object containing value(s) for primary key(s).
  2374. */
  2375. public function buildPkeyCriteria()
  2376. {
  2377. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2378. $criteria->add(assetParamsPeer::ID, $this->id);
  2379. return $criteria;
  2380. }
  2381. /**
  2382. * Returns the primary key for this object (row).
  2383. * @return int
  2384. */
  2385. public function getPrimaryKey()
  2386. {
  2387. return $this->getId();
  2388. }
  2389. /**
  2390. * Generic method to set the primary key (id column).
  2391. *
  2392. * @param int $key Primary key.
  2393. * @return void
  2394. */
  2395. public function setPrimaryKey($key)
  2396. {
  2397. $this->setId($key);
  2398. }
  2399. /**
  2400. * Sets contents of passed object to values from current object.
  2401. *
  2402. * If desired, this method can also make copies of all associated (fkey referrers)
  2403. * objects.
  2404. *
  2405. * @param object $copyObj An object of assetParams (or compatible) type.
  2406. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  2407. * @throws PropelException
  2408. */
  2409. public function copyInto($copyObj, $deepCopy = false)
  2410. {
  2411. $copyObj->setVersion($this->version);
  2412. $copyObj->setPartnerId($this->partner_id);
  2413. $copyObj->setName($this->name);
  2414. $copyObj->setSystemName($this->system_name);
  2415. $copyObj->setTags($this->tags);
  2416. $copyObj->setDescription($this->description);
  2417. $copyObj->setReadyBehavior($this->ready_behavior);
  2418. $copyObj->setCreatedAt($this->created_at);
  2419. $copyObj->setUpdatedAt($this->updated_at);
  2420. $copyObj->setDeletedAt($this->deleted_at);
  2421. $copyObj->setIsDefault($this->is_default);
  2422. $copyObj->setFormat($this->format);
  2423. $copyObj->setVideoCodec($this->video_codec);
  2424. $copyObj->setVideoBitrate($this->video_bitrate);
  2425. $copyObj->setAudioCodec($this->audio_codec);
  2426. $copyObj->setAudioBitrate($this->audio_bitrate);
  2427. $copyObj->setAudioChannels($this->audio_channels);
  2428. $copyObj->setAudioSampleRate($this->audio_sample_rate);
  2429. $copyObj->setAudioResolution($this->audio_resolution);
  2430. $copyObj->setWidth($this->width);
  2431. $copyObj->setHeight($this->height);
  2432. $copyObj->setFrameRate($this->frame_rate);
  2433. $copyObj->setGopSize($this->gop_size);
  2434. $copyObj->setTwoPass($this->two_pass);
  2435. $copyObj->setConversionEngines($this->conversion_engines);
  2436. $copyObj->setConversionEnginesExtraParams($this->conversion_engines_extra_params);
  2437. $copyObj->setCustomData($this->custom_data);
  2438. $copyObj->setViewOrder($this->view_order);
  2439. $copyObj->setCreationMode($this->creation_mode);
  2440. $copyObj->setDeinterlice($this->deinterlice);
  2441. $copyObj->setRotate($this->rotate);
  2442. $copyObj->setOperators($this->operators);
  2443. $copyObj->setEngineVersion($this->engine_version);
  2444. $copyObj->setType($this->type);
  2445. if ($deepCopy) {
  2446. // important: temporarily setNew(false) because this affects the behavior of
  2447. // the getter/setter methods for fkey referrer objects.
  2448. $copyObj->setNew(false);
  2449. foreach ($this->getassetParamsOutputs() as $relObj) {
  2450. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  2451. $copyObj->addassetParamsOutput($relObj->copy($deepCopy));
  2452. }
  2453. }
  2454. foreach ($this->getassets() as $relObj) {
  2455. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  2456. $copyObj->addasset($relObj->copy($deepCopy));
  2457. }
  2458. }
  2459. foreach ($this->getflavorParamsConversionProfiles() as $relObj) {
  2460. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  2461. $copyObj->addflavorParamsConversionProfile($relObj->copy($deepCopy));
  2462. }
  2463. }
  2464. } // if ($deepCopy)
  2465. $copyObj->setNew(true);
  2466. $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
  2467. }
  2468. /**
  2469. * Makes a copy of this object that will be inserted as a new row in table when saved.
  2470. * It creates a new object filling in the simple attributes, but skipping any primary
  2471. * keys that are defined for the table.
  2472. *
  2473. * If desired, this method can also make copies of all associated (fkey referrers)
  2474. * objects.
  2475. *
  2476. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  2477. * @return assetParams Clone of current object.
  2478. * @throws PropelException
  2479. */
  2480. public function copy($deepCopy = false)
  2481. {
  2482. // we use get_class(), because this might be a subclass
  2483. $clazz = get_class($this);
  2484. $copyObj = new $clazz();
  2485. $this->copyInto($copyObj, $deepCopy);
  2486. $copyObj->setCopiedFrom($this);
  2487. return $copyObj;
  2488. }
  2489. /**
  2490. * Stores the source object that this object copied from
  2491. *
  2492. * @var assetParams Clone of current object.
  2493. */
  2494. protected $copiedFrom = null;
  2495. /**
  2496. * Stores the source object that this object copied from
  2497. *
  2498. * @param assetParams $copiedFrom Clone of current object.
  2499. */
  2500. public function setCopiedFrom(assetParams $copiedFrom)
  2501. {
  2502. $this->copiedFrom = $copiedFrom;
  2503. }
  2504. /**
  2505. * Returns a peer instance associated with this om.
  2506. *
  2507. * Since Peer classes are not to have any instance attributes, this method returns the
  2508. * same instance for all member of this class. The method could therefore
  2509. * be static, but this would prevent one from overriding the behavior.
  2510. *
  2511. * @return assetParamsPeer
  2512. */
  2513. public function getPeer()
  2514. {
  2515. if (self::$peer === null) {
  2516. self::$peer = new assetParamsPeer();
  2517. }
  2518. return self::$peer;
  2519. }
  2520. /**
  2521. * Clears out the collassetParamsOutputs collection (array).
  2522. *
  2523. * This does not modify the database; however, it will remove any associated objects, causing
  2524. * them to be refetched by subsequent calls to accessor method.
  2525. *
  2526. * @return void
  2527. * @see addassetParamsOutputs()
  2528. */
  2529. public function clearassetParamsOutputs()
  2530. {
  2531. $this->collassetParamsOutputs = null; // important to set this to NULL since that means it is uninitialized
  2532. }
  2533. /**
  2534. * Initializes the collassetParamsOutputs collection (array).
  2535. *
  2536. * By default this just sets the collassetParamsOutputs collection to an empty array (like clearcollassetParamsOutputs());
  2537. * however, you may wish to override this method in your stub class to provide setting appropriate
  2538. * to your application -- for example, setting the initial array to the values stored in database.
  2539. *
  2540. * @return void
  2541. */
  2542. public function initassetParamsOutputs()
  2543. {
  2544. $this->collassetParamsOutputs = array();
  2545. }
  2546. /**
  2547. * Gets an array of assetParamsOutput objects which contain a foreign key that references this object.
  2548. *
  2549. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  2550. * Otherwise if this assetParams has previously been saved, it will retrieve
  2551. * related assetParamsOutputs from storage. If this assetParams is new, it will return
  2552. * an empty collection or the current collection, the criteria is ignored on a new object.
  2553. *
  2554. * @param PropelPDO $con
  2555. * @param Criteria $criteria
  2556. * @return array assetParamsOutput[]
  2557. * @throws PropelException
  2558. */
  2559. public function getassetParamsOutputs($criteria = null, PropelPDO $con = null)
  2560. {
  2561. if ($criteria === null) {
  2562. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2563. }
  2564. elseif ($criteria instanceof Criteria)
  2565. {
  2566. $criteria = clone $criteria;
  2567. }
  2568. if ($this->collassetParamsOutputs === null) {
  2569. if ($this->isNew()) {
  2570. $this->collassetParamsOutputs = array();
  2571. } else {
  2572. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2573. assetParamsOutputPeer::addSelectColumns($criteria);
  2574. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelect($criteria, $con);
  2575. }
  2576. } else {
  2577. // criteria has no effect for a new object
  2578. if (!$this->isNew()) {
  2579. // the following code is to determine if a new query is
  2580. // called for. If the criteria is the same as the last
  2581. // one, just return the collection.
  2582. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2583. assetParamsOutputPeer::addSelectColumns($criteria);
  2584. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  2585. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelect($criteria, $con);
  2586. }
  2587. }
  2588. }
  2589. $this->lastassetParamsOutputCriteria = $criteria;
  2590. return $this->collassetParamsOutputs;
  2591. }
  2592. /**
  2593. * Returns the number of related assetParamsOutput objects.
  2594. *
  2595. * @param Criteria $criteria
  2596. * @param boolean $distinct
  2597. * @param PropelPDO $con
  2598. * @return int Count of related assetParamsOutput objects.
  2599. * @throws PropelException
  2600. */
  2601. public function countassetParamsOutputs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2602. {
  2603. if ($criteria === null) {
  2604. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2605. } else {
  2606. $criteria = clone $criteria;
  2607. }
  2608. if ($distinct) {
  2609. $criteria->setDistinct();
  2610. }
  2611. $count = null;
  2612. if ($this->collassetParamsOutputs === null) {
  2613. if ($this->isNew()) {
  2614. $count = 0;
  2615. } else {
  2616. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2617. $count = assetParamsOutputPeer::doCount($criteria, false, $con);
  2618. }
  2619. } else {
  2620. // criteria has no effect for a new object
  2621. if (!$this->isNew()) {
  2622. // the following code is to determine if a new query is
  2623. // called for. If the criteria is the same as the last
  2624. // one, just return count of the collection.
  2625. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2626. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  2627. $count = assetParamsOutputPeer::doCount($criteria, false, $con);
  2628. } else {
  2629. $count = count($this->collassetParamsOutputs);
  2630. }
  2631. } else {
  2632. $count = count($this->collassetParamsOutputs);
  2633. }
  2634. }
  2635. return $count;
  2636. }
  2637. /**
  2638. * Method called to associate a assetParamsOutput object to this object
  2639. * through the assetParamsOutput foreign key attribute.
  2640. *
  2641. * @param assetParamsOutput $l assetParamsOutput
  2642. * @return void
  2643. * @throws PropelException
  2644. */
  2645. public function addassetParamsOutput(assetParamsOutput $l)
  2646. {
  2647. if ($this->collassetParamsOutputs === null) {
  2648. $this->initassetParamsOutputs();
  2649. }
  2650. if (!in_array($l, $this->collassetParamsOutputs, true)) { // only add it if the **same** object is not already associated
  2651. array_push($this->collassetParamsOutputs, $l);
  2652. $l->setassetParams($this);
  2653. }
  2654. }
  2655. /**
  2656. * If this collection has already been initialized with
  2657. * an identical criteria, it returns the collection.
  2658. * Otherwise if this assetParams is new, it will return
  2659. * an empty collection; or if this assetParams has previously
  2660. * been saved, it will retrieve related assetParamsOutputs from storage.
  2661. *
  2662. * This method is protected by default in order to keep the public
  2663. * api reasonable. You can provide public methods for those you
  2664. * actually need in assetParams.
  2665. */
  2666. public function getassetParamsOutputsJoinentry($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  2667. {
  2668. if ($criteria === null) {
  2669. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2670. }
  2671. elseif ($criteria instanceof Criteria)
  2672. {
  2673. $criteria = clone $criteria;
  2674. }
  2675. if ($this->collassetParamsOutputs === null) {
  2676. if ($this->isNew()) {
  2677. $this->collassetParamsOutputs = array();
  2678. } else {
  2679. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2680. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinentry($criteria, $con, $join_behavior);
  2681. }
  2682. } else {
  2683. // the following code is to determine if a new query is
  2684. // called for. If the criteria is the same as the last
  2685. // one, just return the collection.
  2686. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2687. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  2688. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinentry($criteria, $con, $join_behavior);
  2689. }
  2690. }
  2691. $this->lastassetParamsOutputCriteria = $criteria;
  2692. return $this->collassetParamsOutputs;
  2693. }
  2694. /**
  2695. * If this collection has already been initialized with
  2696. * an identical criteria, it returns the collection.
  2697. * Otherwise if this assetParams is new, it will return
  2698. * an empty collection; or if this assetParams has previously
  2699. * been saved, it will retrieve related assetParamsOutputs from storage.
  2700. *
  2701. * This method is protected by default in order to keep the public
  2702. * api reasonable. You can provide public methods for those you
  2703. * actually need in assetParams.
  2704. */
  2705. public function getassetParamsOutputsJoinasset($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  2706. {
  2707. if ($criteria === null) {
  2708. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2709. }
  2710. elseif ($criteria instanceof Criteria)
  2711. {
  2712. $criteria = clone $criteria;
  2713. }
  2714. if ($this->collassetParamsOutputs === null) {
  2715. if ($this->isNew()) {
  2716. $this->collassetParamsOutputs = array();
  2717. } else {
  2718. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2719. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinasset($criteria, $con, $join_behavior);
  2720. }
  2721. } else {
  2722. // the following code is to determine if a new query is
  2723. // called for. If the criteria is the same as the last
  2724. // one, just return the collection.
  2725. $criteria->add(assetParamsOutputPeer::FLAVOR_PARAMS_ID, $this->id);
  2726. if (!isset($this->lastassetParamsOutputCriteria) || !$this->lastassetParamsOutputCriteria->equals($criteria)) {
  2727. $this->collassetParamsOutputs = assetParamsOutputPeer::doSelectJoinasset($criteria, $con, $join_behavior);
  2728. }
  2729. }
  2730. $this->lastassetParamsOutputCriteria = $criteria;
  2731. return $this->collassetParamsOutputs;
  2732. }
  2733. /**
  2734. * Clears out the collassets collection (array).
  2735. *
  2736. * This does not modify the database; however, it will remove any associated objects, causing
  2737. * them to be refetched by subsequent calls to accessor method.
  2738. *
  2739. * @return void
  2740. * @see addassets()
  2741. */
  2742. public function clearassets()
  2743. {
  2744. $this->collassets = null; // important to set this to NULL since that means it is uninitialized
  2745. }
  2746. /**
  2747. * Initializes the collassets collection (array).
  2748. *
  2749. * By default this just sets the collassets collection to an empty array (like clearcollassets());
  2750. * however, you may wish to override this method in your stub class to provide setting appropriate
  2751. * to your application -- for example, setting the initial array to the values stored in database.
  2752. *
  2753. * @return void
  2754. */
  2755. public function initassets()
  2756. {
  2757. $this->collassets = array();
  2758. }
  2759. /**
  2760. * Gets an array of asset objects which contain a foreign key that references this object.
  2761. *
  2762. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  2763. * Otherwise if this assetParams has previously been saved, it will retrieve
  2764. * related assets from storage. If this assetParams is new, it will return
  2765. * an empty collection or the current collection, the criteria is ignored on a new object.
  2766. *
  2767. * @param PropelPDO $con
  2768. * @param Criteria $criteria
  2769. * @return array asset[]
  2770. * @throws PropelException
  2771. */
  2772. public function getassets($criteria = null, PropelPDO $con = null)
  2773. {
  2774. if ($criteria === null) {
  2775. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2776. }
  2777. elseif ($criteria instanceof Criteria)
  2778. {
  2779. $criteria = clone $criteria;
  2780. }
  2781. if ($this->collassets === null) {
  2782. if ($this->isNew()) {
  2783. $this->collassets = array();
  2784. } else {
  2785. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2786. assetPeer::addSelectColumns($criteria);
  2787. $this->collassets = assetPeer::doSelect($criteria, $con);
  2788. }
  2789. } else {
  2790. // criteria has no effect for a new object
  2791. if (!$this->isNew()) {
  2792. // the following code is to determine if a new query is
  2793. // called for. If the criteria is the same as the last
  2794. // one, just return the collection.
  2795. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2796. assetPeer::addSelectColumns($criteria);
  2797. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  2798. $this->collassets = assetPeer::doSelect($criteria, $con);
  2799. }
  2800. }
  2801. }
  2802. $this->lastassetCriteria = $criteria;
  2803. return $this->collassets;
  2804. }
  2805. /**
  2806. * Returns the number of related asset objects.
  2807. *
  2808. * @param Criteria $criteria
  2809. * @param boolean $distinct
  2810. * @param PropelPDO $con
  2811. * @return int Count of related asset objects.
  2812. * @throws PropelException
  2813. */
  2814. public function countassets(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2815. {
  2816. if ($criteria === null) {
  2817. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2818. } else {
  2819. $criteria = clone $criteria;
  2820. }
  2821. if ($distinct) {
  2822. $criteria->setDistinct();
  2823. }
  2824. $count = null;
  2825. if ($this->collassets === null) {
  2826. if ($this->isNew()) {
  2827. $count = 0;
  2828. } else {
  2829. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2830. $count = assetPeer::doCount($criteria, false, $con);
  2831. }
  2832. } else {
  2833. // criteria has no effect for a new object
  2834. if (!$this->isNew()) {
  2835. // the following code is to determine if a new query is
  2836. // called for. If the criteria is the same as the last
  2837. // one, just return count of the collection.
  2838. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2839. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  2840. $count = assetPeer::doCount($criteria, false, $con);
  2841. } else {
  2842. $count = count($this->collassets);
  2843. }
  2844. } else {
  2845. $count = count($this->collassets);
  2846. }
  2847. }
  2848. return $count;
  2849. }
  2850. /**
  2851. * Method called to associate a asset object to this object
  2852. * through the asset foreign key attribute.
  2853. *
  2854. * @param asset $l asset
  2855. * @return void
  2856. * @throws PropelException
  2857. */
  2858. public function addasset(asset $l)
  2859. {
  2860. if ($this->collassets === null) {
  2861. $this->initassets();
  2862. }
  2863. if (!in_array($l, $this->collassets, true)) { // only add it if the **same** object is not already associated
  2864. array_push($this->collassets, $l);
  2865. $l->setassetParams($this);
  2866. }
  2867. }
  2868. /**
  2869. * If this collection has already been initialized with
  2870. * an identical criteria, it returns the collection.
  2871. * Otherwise if this assetParams is new, it will return
  2872. * an empty collection; or if this assetParams has previously
  2873. * been saved, it will retrieve related assets from storage.
  2874. *
  2875. * This method is protected by default in order to keep the public
  2876. * api reasonable. You can provide public methods for those you
  2877. * actually need in assetParams.
  2878. */
  2879. public function getassetsJoinentry($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  2880. {
  2881. if ($criteria === null) {
  2882. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2883. }
  2884. elseif ($criteria instanceof Criteria)
  2885. {
  2886. $criteria = clone $criteria;
  2887. }
  2888. if ($this->collassets === null) {
  2889. if ($this->isNew()) {
  2890. $this->collassets = array();
  2891. } else {
  2892. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2893. $this->collassets = assetPeer::doSelectJoinentry($criteria, $con, $join_behavior);
  2894. }
  2895. } else {
  2896. // the following code is to determine if a new query is
  2897. // called for. If the criteria is the same as the last
  2898. // one, just return the collection.
  2899. $criteria->add(assetPeer::FLAVOR_PARAMS_ID, $this->id);
  2900. if (!isset($this->lastassetCriteria) || !$this->lastassetCriteria->equals($criteria)) {
  2901. $this->collassets = assetPeer::doSelectJoinentry($criteria, $con, $join_behavior);
  2902. }
  2903. }
  2904. $this->lastassetCriteria = $criteria;
  2905. return $this->collassets;
  2906. }
  2907. /**
  2908. * Clears out the collflavorParamsConversionProfiles collection (array).
  2909. *
  2910. * This does not modify the database; however, it will remove any associated objects, causing
  2911. * them to be refetched by subsequent calls to accessor method.
  2912. *
  2913. * @return void
  2914. * @see addflavorParamsConversionProfiles()
  2915. */
  2916. public function clearflavorParamsConversionProfiles()
  2917. {
  2918. $this->collflavorParamsConversionProfiles = null; // important to set this to NULL since that means it is uninitialized
  2919. }
  2920. /**
  2921. * Initializes the collflavorParamsConversionProfiles collection (array).
  2922. *
  2923. * By default this just sets the collflavorParamsConversionProfiles collection to an empty array (like clearcollflavorParamsConversionProfiles());
  2924. * however, you may wish to override this method in your stub class to provide setting appropriate
  2925. * to your application -- for example, setting the initial array to the values stored in database.
  2926. *
  2927. * @return void
  2928. */
  2929. public function initflavorParamsConversionProfiles()
  2930. {
  2931. $this->collflavorParamsConversionProfiles = array();
  2932. }
  2933. /**
  2934. * Gets an array of flavorParamsConversionProfile objects which contain a foreign key that references this object.
  2935. *
  2936. * If this collection has already been initialized with an identical Criteria, it returns the collection.
  2937. * Otherwise if this assetParams has previously been saved, it will retrieve
  2938. * related flavorParamsConversionProfiles from storage. If this assetParams is new, it will return
  2939. * an empty collection or the current collection, the criteria is ignored on a new object.
  2940. *
  2941. * @param PropelPDO $con
  2942. * @param Criteria $criteria
  2943. * @return array flavorParamsConversionProfile[]
  2944. * @throws PropelException
  2945. */
  2946. public function getflavorParamsConversionProfiles($criteria = null, PropelPDO $con = null)
  2947. {
  2948. if ($criteria === null) {
  2949. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2950. }
  2951. elseif ($criteria instanceof Criteria)
  2952. {
  2953. $criteria = clone $criteria;
  2954. }
  2955. if ($this->collflavorParamsConversionProfiles === null) {
  2956. if ($this->isNew()) {
  2957. $this->collflavorParamsConversionProfiles = array();
  2958. } else {
  2959. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  2960. flavorParamsConversionProfilePeer::addSelectColumns($criteria);
  2961. $this->collflavorParamsConversionProfiles = flavorParamsConversionProfilePeer::doSelect($criteria, $con);
  2962. }
  2963. } else {
  2964. // criteria has no effect for a new object
  2965. if (!$this->isNew()) {
  2966. // the following code is to determine if a new query is
  2967. // called for. If the criteria is the same as the last
  2968. // one, just return the collection.
  2969. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  2970. flavorParamsConversionProfilePeer::addSelectColumns($criteria);
  2971. if (!isset($this->lastflavorParamsConversionProfileCriteria) || !$this->lastflavorParamsConversionProfileCriteria->equals($criteria)) {
  2972. $this->collflavorParamsConversionProfiles = flavorParamsConversionProfilePeer::doSelect($criteria, $con);
  2973. }
  2974. }
  2975. }
  2976. $this->lastflavorParamsConversionProfileCriteria = $criteria;
  2977. return $this->collflavorParamsConversionProfiles;
  2978. }
  2979. /**
  2980. * Returns the number of related flavorParamsConversionProfile objects.
  2981. *
  2982. * @param Criteria $criteria
  2983. * @param boolean $distinct
  2984. * @param PropelPDO $con
  2985. * @return int Count of related flavorParamsConversionProfile objects.
  2986. * @throws PropelException
  2987. */
  2988. public function countflavorParamsConversionProfiles(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2989. {
  2990. if ($criteria === null) {
  2991. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  2992. } else {
  2993. $criteria = clone $criteria;
  2994. }
  2995. if ($distinct) {
  2996. $criteria->setDistinct();
  2997. }
  2998. $count = null;
  2999. if ($this->collflavorParamsConversionProfiles === null) {
  3000. if ($this->isNew()) {
  3001. $count = 0;
  3002. } else {
  3003. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  3004. $count = flavorParamsConversionProfilePeer::doCount($criteria, false, $con);
  3005. }
  3006. } else {
  3007. // criteria has no effect for a new object
  3008. if (!$this->isNew()) {
  3009. // the following code is to determine if a new query is
  3010. // called for. If the criteria is the same as the last
  3011. // one, just return count of the collection.
  3012. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  3013. if (!isset($this->lastflavorParamsConversionProfileCriteria) || !$this->lastflavorParamsConversionProfileCriteria->equals($criteria)) {
  3014. $count = flavorParamsConversionProfilePeer::doCount($criteria, false, $con);
  3015. } else {
  3016. $count = count($this->collflavorParamsConversionProfiles);
  3017. }
  3018. } else {
  3019. $count = count($this->collflavorParamsConversionProfiles);
  3020. }
  3021. }
  3022. return $count;
  3023. }
  3024. /**
  3025. * Method called to associate a flavorParamsConversionProfile object to this object
  3026. * through the flavorParamsConversionProfile foreign key attribute.
  3027. *
  3028. * @param flavorParamsConversionProfile $l flavorParamsConversionProfile
  3029. * @return void
  3030. * @throws PropelException
  3031. */
  3032. public function addflavorParamsConversionProfile(flavorParamsConversionProfile $l)
  3033. {
  3034. if ($this->collflavorParamsConversionProfiles === null) {
  3035. $this->initflavorParamsConversionProfiles();
  3036. }
  3037. if (!in_array($l, $this->collflavorParamsConversionProfiles, true)) { // only add it if the **same** object is not already associated
  3038. array_push($this->collflavorParamsConversionProfiles, $l);
  3039. $l->setassetParams($this);
  3040. }
  3041. }
  3042. /**
  3043. * If this collection has already been initialized with
  3044. * an identical criteria, it returns the collection.
  3045. * Otherwise if this assetParams is new, it will return
  3046. * an empty collection; or if this assetParams has previously
  3047. * been saved, it will retrieve related flavorParamsConversionProfiles from storage.
  3048. *
  3049. * This method is protected by default in order to keep the public
  3050. * api reasonable. You can provide public methods for those you
  3051. * actually need in assetParams.
  3052. */
  3053. public function getflavorParamsConversionProfilesJoinconversionProfile2($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  3054. {
  3055. if ($criteria === null) {
  3056. $criteria = new Criteria(assetParamsPeer::DATABASE_NAME);
  3057. }
  3058. elseif ($criteria instanceof Criteria)
  3059. {
  3060. $criteria = clone $criteria;
  3061. }
  3062. if ($this->collflavorParamsConversionProfiles === null) {
  3063. if ($this->isNew()) {
  3064. $this->collflavorParamsConversionProfiles = array();
  3065. } else {
  3066. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  3067. $this->collflavorParamsConversionProfiles = flavorParamsConversionProfilePeer::doSelectJoinconversionProfile2($criteria, $con, $join_behavior);
  3068. }
  3069. } else {
  3070. // the following code is to determine if a new query is
  3071. // called for. If the criteria is the same as the last
  3072. // one, just return the collection.
  3073. $criteria->add(flavorParamsConversionProfilePeer::FLAVOR_PARAMS_ID, $this->id);
  3074. if (!isset($this->lastflavorParamsConversionProfileCriteria) || !$this->lastflavorParamsConversionProfileCriteria->equals($criteria)) {
  3075. $this->collflavorParamsConversionProfiles = flavorParamsConversionProfilePeer::doSelectJoinconversionProfile2($criteria, $con, $join_behavior);
  3076. }
  3077. }
  3078. $this->lastflavorParamsConversionProfileCriteria = $criteria;
  3079. return $this->collflavorParamsConversionProfiles;
  3080. }
  3081. /**
  3082. * Resets all collections of referencing foreign keys.
  3083. *
  3084. * This method is a user-space workaround for PHP's inability to garbage collect objects
  3085. * with circular references. This is currently necessary when using Propel in certain
  3086. * daemon or large-volumne/high-memory operations.
  3087. *
  3088. * @param boolean $deep Whether to also clear the references on all associated objects.
  3089. */
  3090. public function clearAllReferences($deep = false)
  3091. {
  3092. if ($deep) {
  3093. if ($this->collassetParamsOutputs) {
  3094. foreach ((array) $this->collassetParamsOutputs as $o) {
  3095. $o->clearAllReferences($deep);
  3096. }
  3097. }
  3098. if ($this->collassets) {
  3099. foreach ((array) $this->collassets as $o) {
  3100. $o->clearAllReferences($deep);
  3101. }
  3102. }
  3103. if ($this->collflavorParamsConversionProfiles) {
  3104. foreach ((array) $this->collflavorParamsConversionProfiles as $o) {
  3105. $o->clearAllReferences($deep);
  3106. }
  3107. }
  3108. } // if ($deep)
  3109. $this->collassetParamsOutputs = null;
  3110. $this->collassets = null;
  3111. $this->collflavorParamsConversionProfiles = null;
  3112. }
  3113. /* ---------------------- CustomData functions ------------------------- */
  3114. /**
  3115. * @var myCustomData
  3116. */
  3117. protected $m_custom_data = null;
  3118. /**
  3119. * Store custom data old values before the changes
  3120. * @var array
  3121. */
  3122. protected $oldCustomDataValues = array();
  3123. /**
  3124. * @return array
  3125. */
  3126. public function getCustomDataOldValues()
  3127. {
  3128. return $this->oldCustomDataValues;
  3129. }
  3130. /**
  3131. * @param string $name
  3132. * @param string $value
  3133. * @param string $namespace
  3134. * @return string
  3135. */
  3136. public function putInCustomData ( $name , $value , $namespace = null )
  3137. {
  3138. $customData = $this->getCustomDataObj( );
  3139. $currentNamespace = '';
  3140. if($namespace)
  3141. $currentNamespace = $namespace;
  3142. if(!isset($this->oldCustomDataValues[$currentNamespace]))
  3143. $this->oldCustomDataValues[$currentNamespace] = array();
  3144. if(!isset($this->oldCustomDataValues[$currentNamespace][$name]))
  3145. $this->oldCustomDataValues[$currentNamespace][$name] = $customData->get($name, $namespace);
  3146. $customData->put ( $name , $value , $namespace );
  3147. }
  3148. /**
  3149. * @param string $name
  3150. * @param string $namespace
  3151. * @param string $defaultValue
  3152. * @return string
  3153. */
  3154. public function getFromCustomData ( $name , $namespace = null , $defaultValue = null )
  3155. {
  3156. $customData = $this->getCustomDataObj( );
  3157. $res = $customData->get ( $name , $namespace );
  3158. if ( $res === null ) return $defaultValue;
  3159. return $res;
  3160. }
  3161. /**
  3162. * @param string $name
  3163. * @param string $namespace
  3164. */
  3165. public function removeFromCustomData ( $name , $namespace = null)
  3166. {
  3167. $customData = $this->getCustomDataObj( );
  3168. return $customData->remove ( $name , $namespace );
  3169. }
  3170. /**
  3171. * @param string $name
  3172. * @param int $delta
  3173. * @param string $namespace
  3174. * @return string
  3175. */
  3176. public function incInCustomData ( $name , $delta = 1, $namespace = null)
  3177. {
  3178. $customData = $this->getCustomDataObj( );
  3179. return $customData->inc ( $name , $delta , $namespace );
  3180. }
  3181. /**
  3182. * @param string $name
  3183. * @param int $delta
  3184. * @param string $namespace
  3185. * @return string
  3186. */
  3187. public function decInCustomData ( $name , $delta = 1, $namespace = null)
  3188. {
  3189. $customData = $this->getCustomDataObj( );
  3190. return $customData->dec ( $name , $delta , $namespace );
  3191. }
  3192. /**
  3193. * @return myCustomData
  3194. */
  3195. public function getCustomDataObj( )
  3196. {
  3197. if ( ! $this->m_custom_data )
  3198. {
  3199. $this->m_custom_data = myCustomData::fromString ( $this->getCustomData() );
  3200. }
  3201. return $this->m_custom_data;
  3202. }
  3203. /**
  3204. * Must be called before saving the object
  3205. */
  3206. public function setCustomDataObj()
  3207. {
  3208. if ( $this->m_custom_data != null )
  3209. {
  3210. $this->setCustomData( $this->m_custom_data->toString() );
  3211. }
  3212. }
  3213. /* ---------------------- CustomData functions ------------------------- */
  3214. } // BaseassetParams