diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index f1479409a..edc51a659 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -1,6 +1,6 @@ length; + } + + public function setDbLength($time) + { + $this->length = $time; + //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; + return Common::setTimeInSub($this, 'LENGTH', $time); + } + + } // CcFiles diff --git a/airtime_mvc/application/models/airtime/om/CcFiles.php b/airtime_mvc/application/models/airtime/om/CcFiles.php new file mode 100644 index 000000000..edc51a659 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/CcFiles.php @@ -0,0 +1,31 @@ +length; + } + + public function setDbLength($time) + { + $this->length = $time; + //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; + return Common::setTimeInSub($this, 'LENGTH', $time); + } + + +} // CcFiles diff --git a/airtime_mvc/application/models/airtime/om/CcPlaylist.php b/airtime_mvc/application/models/airtime/om/CcPlaylist.php new file mode 100644 index 000000000..0d3cff401 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/CcPlaylist.php @@ -0,0 +1,48 @@ +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 diff --git a/airtime_mvc/application/models/airtime/om/CcPlaylistcontents.php b/airtime_mvc/application/models/airtime/om/CcPlaylistcontents.php new file mode 100644 index 000000000..1b6417a66 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/CcPlaylistcontents.php @@ -0,0 +1,81 @@ +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 diff --git a/airtime_mvc/application/models/airtime/om/Common.php b/airtime_mvc/application/models/airtime/om/Common.php new file mode 100644 index 000000000..3e13c7fa3 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/Common.php @@ -0,0 +1,19 @@ +prepare($sql); + $stmt->bindValue(':f1', $time); + $stmt->bindValue(':p1', $row->getDbId()); + $stmt->execute(); + } +}