Cosmetic changes.

This commit is contained in:
Rudi Grinberg 2012-09-11 16:20:59 -04:00
parent 51d4f35c55
commit 0dd38920a3
1 changed files with 10 additions and 11 deletions

View File

@ -315,12 +315,13 @@ class Application_Model_StoredFile
*/ */
public function getPlaylists() public function getPlaylists()
{ {
global $CC_CONFIG;
$con = Propel::getConnection(); $con = Propel::getConnection();
$sql = "SELECT playlist_id " $sql = <<<SQL
." FROM cc_playlist" SELECT playlist_id
." WHERE file_id = :file_id"; FROM cc_playlist
WHERE file_id = :file_id
SQL;
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindParam(':file_id', $this->id, PDO::PARAM_INT); $stmt->bindParam(':file_id', $this->id, PDO::PARAM_INT);
@ -332,14 +333,13 @@ class Application_Model_StoredFile
throw new Exception("Error: $msg"); throw new Exception("Error: $msg");
} }
$playlists = array();
if (is_array($ids) && count($ids) > 0) { if (is_array($ids) && count($ids) > 0) {
foreach ($ids as $id) { return array_map( function ($id) {
$playlists[] = Application_Model_Playlist::Recall($id); return Application_Model_Playlist::Recall($id);
} }, $ids);
} else {
return array();
} }
return $playlists;
} }
/** /**
@ -593,7 +593,6 @@ class Application_Model_StoredFile
public function getName() public function getName()
{ {
$info = pathinfo($this->getFilePath()); $info = pathinfo($this->getFilePath());
return $info['filename']; return $info['filename'];
} }