replacing propel files
This commit is contained in:
parent
e803b76fcf
commit
5f562b94ca
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('Common.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Skeleton subclass for representing a row from the 'cc_files' table.
|
* Skeleton subclass for representing a row from the 'cc_files' table.
|
||||||
|
@ -11,8 +11,21 @@
|
||||||
* application requirements. This class will only be generated as
|
* application requirements. This class will only be generated as
|
||||||
* long as it does not already exist in the output directory.
|
* long as it does not already exist in the output directory.
|
||||||
*
|
*
|
||||||
* @package propel.generator.airtime
|
* @package propel.generator.campcaster
|
||||||
*/
|
*/
|
||||||
class CcFiles extends BaseCcFiles {
|
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
|
} // CcFiles
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?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
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?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
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?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
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue