2011-01-10 19:24:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Skeleton subclass for representing a row from the 'cc_playlistcontents' table.
|
|
|
|
*
|
|
|
|
* You should add additional methods to this class to meet the
|
|
|
|
* application requirements. This class will only be generated as
|
|
|
|
* long as it does not already exist in the output directory.
|
|
|
|
*/
|
2021-10-11 16:10:47 +02:00
|
|
|
class CcPlaylistcontents extends BaseCcPlaylistcontents
|
|
|
|
{
|
2012-02-06 18:46:53 +01:00
|
|
|
/**
|
|
|
|
* Get the [optionally formatted] temporal [fadein] column value.
|
|
|
|
*
|
2021-10-11 16:10:47 +02:00
|
|
|
* @param mixed $format
|
|
|
|
*
|
|
|
|
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
2022-09-12 13:16:14 +02:00
|
|
|
*
|
|
|
|
* @throws propelException - if unable to parse/validate the date/time value
|
2012-02-06 18:46:53 +01:00
|
|
|
*/
|
2021-10-11 16:10:47 +02:00
|
|
|
public function getDbFadein($format = 's.u')
|
2012-02-06 18:46:53 +01:00
|
|
|
{
|
2012-02-07 17:52:04 +01:00
|
|
|
return parent::getDbFadein($format);
|
2012-02-06 18:46:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the [optionally formatted] temporal [fadein] column value.
|
|
|
|
*
|
2021-10-11 16:10:47 +02:00
|
|
|
* @param mixed $format
|
|
|
|
*
|
|
|
|
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
2022-09-12 13:16:14 +02:00
|
|
|
*
|
|
|
|
* @throws propelException - if unable to parse/validate the date/time value
|
2012-02-06 18:46:53 +01:00
|
|
|
*/
|
2021-10-11 16:10:47 +02:00
|
|
|
public function getDbFadeout($format = 's.u')
|
2012-02-06 18:46:53 +01:00
|
|
|
{
|
2021-10-11 16:10:47 +02:00
|
|
|
return parent::getDbFadeout($format);
|
2012-02-06 18:46:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-10-11 16:10:47 +02:00
|
|
|
* @param string in format SS.uuuuuu, Datetime, or DateTime accepted string.
|
|
|
|
* @param mixed $v
|
2012-02-06 18:46:53 +01:00
|
|
|
*
|
|
|
|
* @return CcPlaylistcontents The current object (for fluent API support)
|
|
|
|
*/
|
|
|
|
public function setDbFadein($v)
|
|
|
|
{
|
2012-10-16 22:22:44 +02:00
|
|
|
$microsecond = 0;
|
2012-02-06 18:46:53 +01:00
|
|
|
if ($v instanceof DateTime) {
|
|
|
|
$dt = $v;
|
2021-10-11 16:10:47 +02:00
|
|
|
} elseif (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
2012-10-16 22:22:44 +02:00
|
|
|
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
|
|
|
|
// Hence we need to do parsing.
|
|
|
|
$info = explode('.', $v);
|
|
|
|
$microsecond = $info[1];
|
2021-10-11 16:10:47 +02:00
|
|
|
$dt = DateTime::createFromFormat('s', $info[0]);
|
|
|
|
} else {
|
2012-02-06 18:46:53 +01:00
|
|
|
try {
|
|
|
|
$dt = new DateTime($v);
|
|
|
|
} catch (Exception $x) {
|
|
|
|
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-18 18:09:48 +02:00
|
|
|
if ($microsecond == 0) {
|
|
|
|
$this->fadein = $dt->format('H:i:s.u');
|
|
|
|
} else {
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->fadein = $dt->format('H:i:s') . '.' . $microsecond;
|
2012-10-18 18:09:48 +02:00
|
|
|
}
|
2012-02-06 18:46:53 +01:00
|
|
|
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
2013-01-02 17:41:33 +01:00
|
|
|
$this->save();
|
2015-09-05 00:35:11 +02:00
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// FIXME(XXX): Propel silently drops the milliseconds from our fadein time. :(
|
2015-09-05 00:35:11 +02:00
|
|
|
|
2012-02-06 18:46:53 +01:00
|
|
|
return $this;
|
|
|
|
} // setDbFadein()
|
|
|
|
|
|
|
|
/**
|
2021-10-11 16:10:47 +02:00
|
|
|
* @param string in format SS.uuuuuu, Datetime, or DateTime accepted string.
|
|
|
|
* @param mixed $v
|
|
|
|
*
|
|
|
|
* @return CcPlaylistcontents The current object (for fluent API support)
|
|
|
|
*/
|
2012-02-06 18:46:53 +01:00
|
|
|
public function setDbFadeout($v)
|
|
|
|
{
|
2012-10-16 22:22:44 +02:00
|
|
|
$microsecond = 0;
|
2012-02-06 18:46:53 +01:00
|
|
|
if ($v instanceof DateTime) {
|
|
|
|
$dt = $v;
|
2021-10-11 16:10:47 +02:00
|
|
|
} elseif (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
2012-10-16 22:22:44 +02:00
|
|
|
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
|
|
|
|
// Hence we need to do parsing.
|
|
|
|
$info = explode('.', $v);
|
|
|
|
$microsecond = $info[1];
|
2021-10-11 16:10:47 +02:00
|
|
|
$dt = DateTime::createFromFormat('s', $info[0]);
|
|
|
|
} else {
|
2012-02-06 18:46:53 +01:00
|
|
|
try {
|
|
|
|
$dt = new DateTime($v);
|
|
|
|
} catch (Exception $x) {
|
|
|
|
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-18 18:09:48 +02:00
|
|
|
if ($microsecond == 0) {
|
|
|
|
$this->fadeout = $dt->format('H:i:s.u');
|
|
|
|
} else {
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->fadeout = $dt->format('H:i:s') . '.' . $microsecond;
|
2012-10-18 18:09:48 +02:00
|
|
|
}
|
2012-02-06 18:46:53 +01:00
|
|
|
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
2013-01-02 17:41:33 +01:00
|
|
|
$this->save();
|
2015-09-05 00:35:11 +02:00
|
|
|
|
2022-03-14 11:15:04 +01:00
|
|
|
// FIXME(XXX): Propel silently drops the milliseconds from our fadeout time. :(
|
2021-10-11 16:10:47 +02:00
|
|
|
|
2012-02-06 18:46:53 +01:00
|
|
|
return $this;
|
|
|
|
} // setDbFadeout()
|
2011-01-10 19:24:21 +01:00
|
|
|
} // CcPlaylistcontents
|