CC-3174 : showbuilder

overriding some propel setter/getters to support subseconds
or using fades in ss.uuuuuu time as a default.
This commit is contained in:
Naomi Aro 2012-02-07 13:29:50 +01:00
parent d9947b622a
commit f651024a6e
8 changed files with 244 additions and 300 deletions

View file

@ -1,11 +1,9 @@
<?php
require_once('Common.php');
/**
* Skeleton subclass for representing a row from the 'cc_files' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@ -15,16 +13,31 @@ require_once('Common.php');
*/
class CcFiles extends BaseCcFiles {
public function getDbLength()
public function getDbLength($format = "H:i:s.u")
{
return $this->length;
return parent::getDbCliplength($format);
}
public function setDbLength($time)
public function setDbLength($v)
{
$this->length = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH;
return Common::setTimeInSub($this, 'LENGTH', $time);
if ($v instanceof DateTime) {
$dt = $v;
}
else {
try {
$dt = new DateTime($v);
} catch (Exception $x) {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
$this->length = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcFilesPeer::LENGTH;
return $this;
}