last of changing database name, removing old files
This commit is contained in:
parent
53f49d987d
commit
9c23b86c53
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue