converting more of playlist.php to propel ORM.
This commit is contained in:
parent
d5546c3952
commit
9f79b1bf89
20 changed files with 537 additions and 570 deletions
|
@ -15,4 +15,18 @@
|
|||
*/
|
||||
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();
|
||||
}
|
||||
} // CcPlaylist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue