CcBlockcontents.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /**
  3. * Skeleton subclass for representing a row from the 'cc_blockcontents' table.
  4. *
  5. *
  6. *
  7. * You should add additional methods to this class to meet the
  8. * application requirements. This class will only be generated as
  9. * long as it does not already exist in the output directory.
  10. *
  11. * @package propel.generator.airtime
  12. */
  13. class CcBlockcontents extends BaseCcBlockcontents {
  14. /**
  15. * Get the [optionally formatted] temporal [fadein] column value.
  16. *
  17. * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
  18. * @throws PropelException - if unable to parse/validate the date/time value.
  19. */
  20. public function getDbFadein($format = "s.u")
  21. {
  22. return parent::getDbFadein($format);
  23. }
  24. /**
  25. * Get the [optionally formatted] temporal [fadein] column value.
  26. *
  27. * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
  28. * @throws PropelException - if unable to parse/validate the date/time value.
  29. */
  30. public function getDbFadeout($format = "s.u")
  31. {
  32. return parent::getDbFadeout($format);
  33. }
  34. /**
  35. *
  36. * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
  37. *
  38. * @return CcBlockcontents The current object (for fluent API support)
  39. */
  40. public function setDbFadein($v)
  41. {
  42. $microsecond = 0;
  43. if ($v instanceof DateTime) {
  44. $dt = $v;
  45. }
  46. else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
  47. // in php 5.3.2 createFromFormat() with "u" is not supported(bug)
  48. // Hence we need to do parsing.
  49. $info = explode('.', $v);
  50. $microsecond = $info[1];
  51. $dt = DateTime::createFromFormat("s", $info[0]);
  52. }
  53. else {
  54. try {
  55. $dt = new DateTime($v);
  56. } catch (Exception $x) {
  57. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  58. }
  59. }
  60. if ($microsecond == 0) {
  61. $this->fadein = $dt->format('H:i:s.u');
  62. } else {
  63. $this->fadein = $dt->format('H:i:s').".".$microsecond;
  64. }
  65. $this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN;
  66. return $this;
  67. } // setDbFadein()
  68. /**
  69. *
  70. * @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
  71. *
  72. * @return CcBlockcontents The current object (for fluent API support)
  73. */
  74. public function setDbFadeout($v)
  75. {
  76. $microsecond = 0;
  77. if ($v instanceof DateTime) {
  78. $dt = $v;
  79. }
  80. else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
  81. // in php 5.3.2 createFromFormat() with "u" is not supported(bug)
  82. // Hence we need to do parsing.
  83. $info = explode('.', $v);
  84. $microsecond = $info[1];
  85. $dt = DateTime::createFromFormat("s", $info[0]);
  86. }
  87. else {
  88. try {
  89. $dt = new DateTime($v);
  90. } catch (Exception $x) {
  91. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  92. }
  93. }
  94. if ($microsecond == 0) {
  95. $this->fadeout = $dt->format('H:i:s.u');
  96. } else {
  97. $this->fadeout = $dt->format('H:i:s').".".$microsecond;
  98. }
  99. $this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT;
  100. return $this;
  101. } // setDbFadeout()
  102. } // CcBlockcontents