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;
}

View File

@ -19,19 +19,9 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbFadein()
public function getDbFadein($format = "s.u")
{
if ($this->fadein === null) {
return null;
}
try {
$dt = new DateTime($this->fadein);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadein, true), $x);
}
return $dt->format("s.u");
parent::getDbFadein($format);
}
/**
@ -40,19 +30,9 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbFadeout()
public function getDbFadeout($format = "s.u")
{
if ($this->fadeout === null) {
return null;
}
try {
$dt = new DateTime($this->fadeout);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadein, true), $x);
}
return $dt->format("s.u");
parent::getDbFadeout($format);
}
/**
@ -110,7 +90,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
}
}
$this->fadein = ($dt ? $dt->format('H:i:s.u') : null);
$this->fadein = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
return $this;
@ -138,7 +118,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
}
}
$this->fadeout = ($dt ? $dt->format('H:i:s.u') : null);
$this->fadeout = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
return $this;

View File

@ -17,24 +17,7 @@ class CcSchedule extends BaseCcSchedule {
public function getDbClipLength($format = 'H:i:s.u')
{
if ($this->clip_length === null) {
return null;
}
try {
$dt = new DateTime($this->clip_length);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->clip_length, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
return parent::getDbClipLength($format);
}
/**
@ -46,26 +29,9 @@ class CcSchedule extends BaseCcSchedule {
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbStarts($format = 'Y-m-d H:i:s')
public function getDbStarts($format = 'Y-m-d H:i:s.u')
{
if ($this->starts === null) {
return null;
}
try {
$dt = new DateTime($this->starts, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
return parent::getDbStarts($format);
}
/**
@ -77,26 +43,192 @@ class CcSchedule extends BaseCcSchedule {
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbEnds($format = 'Y-m-d H:i:s')
public function getDbEnds($format = 'Y-m-d H:i:s.u')
{
if ($this->ends === null) {
return null;
}
try {
$dt = new DateTime($this->ends, new DateTimeZone("UTC"));
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
return parent::getDbEnds($format);
}
/**
* Get the [optionally formatted] temporal [fadein] column value.
*
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbFadeIn($format = "s.u")
{
parent::getDbFadein($format);
}
/**
* Get the [optionally formatted] temporal [fadein] column value.
*
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbFadeOut($format = "s.u")
{
parent::getDbFadeout($format);
}
/**
* Just changing the default format to return subseconds
*
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbCueIn($format = 'H:i:s.u')
{
return parent::getDbCuein($format);
}
/**
* Just changing the default format to return subseconds
*
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbCueOut($format = 'H:i:s.u')
{
return parent::getDbCueout($format);
}
/**
*
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
*
* @return CcPlaylistcontents The current object (for fluent API support)
*/
public function setDbFadeIn($v)
{
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
}
else {
try {
$dt = new DateTime($v);
} catch (Exception $x) {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
$this->fade_in = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcSchedulePeer::FADE_IN;
return $this;
} // setDbFadein()
/**
*
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
*
* @return CcPlaylistcontents The current object (for fluent API support)
*/
public function setDbFadeOut($v)
{
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
}
else {
try {
$dt = new DateTime($v);
} catch (Exception $x) {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
$this->fadeIout = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADE_OUT;
return $this;
} // setDbFadeout()
/**
* Sets the value of [cuein] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
*/
public function setDbCueIn($v)
{
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->cue_in = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUE_IN;
return $this;
} // setDbCuein()
/**
* Sets the value of [cueout] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
*/
public function setDbCueout($v)
{
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->cue_out = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUE_OUT;
return $this;
} // setDbCueout()
/**
* Sets the value of [cliplength] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
*/
public function setDbClipLength($v)
{
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->clip_length = $dt->format('H:i:s.u');
$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIP_LENGTH;
return $this;
} // setDbCliplength()
} // CcSchedule

View File

@ -4,7 +4,7 @@
/**
* Base class that represents a row from the 'cc_playlistcontents' table.
*
*
*
*
* @package propel.generator.airtime.om
*/
@ -137,7 +137,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [id] column value.
*
*
* @return int
*/
public function getDbId()
@ -147,7 +147,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [playlist_id] column value.
*
*
* @return int
*/
public function getDbPlaylistId()
@ -157,7 +157,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [file_id] column value.
*
*
* @return int
*/
public function getDbFileId()
@ -167,7 +167,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [position] column value.
*
*
* @return int
*/
public function getDbPosition()
@ -177,7 +177,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [optionally formatted] temporal [cliplength] column value.
*
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
@ -210,7 +210,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [optionally formatted] temporal [cuein] column value.
*
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
@ -243,7 +243,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [optionally formatted] temporal [cueout] column value.
*
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
@ -276,7 +276,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [optionally formatted] temporal [fadein] column value.
*
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
@ -289,8 +289,6 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
return null;
}
try {
$dt = new DateTime($this->fadein);
} catch (Exception $x) {
@ -309,7 +307,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Get the [optionally formatted] temporal [fadeout] column value.
*
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
@ -342,7 +340,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Set the value of [id] column.
*
*
* @param int $v new value
* @return CcPlaylistcontents The current object (for fluent API support)
*/
@ -362,7 +360,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Set the value of [playlist_id] column.
*
*
* @param int $v new value
* @return CcPlaylistcontents The current object (for fluent API support)
*/
@ -386,7 +384,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Set the value of [file_id] column.
*
*
* @param int $v new value
* @return CcPlaylistcontents The current object (for fluent API support)
*/
@ -410,7 +408,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Set the value of [position] column.
*
*
* @param int $v new value
* @return CcPlaylistcontents The current object (for fluent API support)
*/
@ -430,7 +428,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Sets the value of [cliplength] column to a normalized version of the date/time value specified.
*
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
@ -466,7 +464,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
$currNorm = ($this->cliplength !== null && $tmpDt = new DateTime($this->cliplength)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
if ( ($currNorm !== $newNorm) // normalized values don't match
|| ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default
)
{
@ -480,7 +478,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Sets the value of [cuein] column to a normalized version of the date/time value specified.
*
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
@ -516,7 +514,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
$currNorm = ($this->cuein !== null && $tmpDt = new DateTime($this->cuein)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
if ( ($currNorm !== $newNorm) // normalized values don't match
|| ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default
)
{
@ -530,7 +528,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Sets the value of [cueout] column to a normalized version of the date/time value specified.
*
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
@ -566,7 +564,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
$currNorm = ($this->cueout !== null && $tmpDt = new DateTime($this->cueout)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
if ( ($currNorm !== $newNorm) // normalized values don't match
|| ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default
)
{
@ -580,7 +578,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Sets the value of [fadein] column to a normalized version of the date/time value specified.
*
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
@ -616,7 +614,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
$currNorm = ($this->fadein !== null && $tmpDt = new DateTime($this->fadein)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
if ( ($currNorm !== $newNorm) // normalized values don't match
|| ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default
)
{
@ -630,7 +628,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
/**
* Sets the value of [fadeout] column to a normalized version of the date/time value specified.
*
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcPlaylistcontents The current object (for fluent API support)
@ -666,7 +664,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
$currNorm = ($this->fadeout !== null && $tmpDt = new DateTime($this->fadeout)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
if ( ($currNorm !== $newNorm) // normalized values don't match
|| ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default
)
{
@ -838,7 +836,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
if ($con === null) {
$con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
@ -880,7 +878,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
if ($con === null) {
$con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
$isInsert = $this->isNew();
try {
@ -1133,7 +1131,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
@ -1528,7 +1526,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
}
// aggregate_column_relation behavior
/**
* Update the aggregate column in the related CcPlaylist object
*

View File

@ -1,31 +0,0 @@
<?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
* long as it does not already exist in the output directory.
*
* @package propel.generator.campcaster
*/
class CcFiles extends BaseCcFiles {
public function getDbLength()
{
return $this->length;
}
public function setDbLength($time)
{
$this->length = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH;
return Common::setTimeInSub($this, 'LENGTH', $time);
}
} // CcFiles

View File

@ -1,48 +0,0 @@
<?php
/**
* Skeleton subclass for representing a row from the 'cc_playlist' 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.
*
* @package propel.generator.campcaster
*/
class CcPlaylist extends BaseCcPlaylist {
public function computeLastPosition()
{
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
$sql = 'SELECT MAX('.CcPlaylistcontentsPeer::POSITION.') AS pos'
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':p1', $this->getDbId());
$stmt->execute();
return $stmt->fetchColumn();
}
public function computeLength()
{
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
$sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length'
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':p1', $this->getDbId());
$stmt->execute();
return $stmt->fetchColumn();
}
} // CcPlaylist

View File

@ -1,81 +0,0 @@
<?php
require_once('Common.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.
*
* @package propel.generator.campcaster
*/
class CcPlaylistcontents extends BaseCcPlaylistcontents {
public function getDbFadein()
{
return $this->fadein;
}
public function setDbFadein($time)
{
$this->fadein = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
Common::setTimeInSub($this, 'FADEIN', $time);
}
public function getDbFadeout()
{
return $this->fadeout;
}
public function setDbFadeout($time)
{
$this->fadeout = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
Common::setTimeInSub($this, 'FADEOUT', $time);
}
public function getDbCuein()
{
return $this->cuein;
}
public function setDbCuein($time)
{
$this->cuein = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN;
Common::setTimeInSub($this, 'CUEIN', $time);
}
public function getDbCueout()
{
return $this->cueout;
}
public function setDbCueout($time)
{
$this->cueout = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT;
Common::setTimeInSub($this, 'CUEOUT', $time);
}
public function getDbCliplength()
{
return $this->cliplength;
}
public function setDbCliplength($time)
{
$this->cliplength = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH;
Common::setTimeInSub($this, 'CLIPLENGTH', $time);
}
} // CcPlaylistcontents

View File

@ -1,19 +0,0 @@
<?php
class Common {
public static function setTimeInSub($row, $col, $time)
{
$class = get_class($row).'Peer';
$con = Propel::getConnection($class::DATABASE_NAME);
$sql = 'UPDATE '.$class::TABLE_NAME
. ' SET '.$col.' = :f1'
. ' WHERE ' .$class::ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':f1', $time);
$stmt->bindValue(':p1', $row->getDbId());
$stmt->execute();
}
}