From 3b43efefe0932a51ae95c074fee157bab58836df Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 12 Sep 2012 17:26:41 -0400 Subject: [PATCH] CC-4413: Unused local variables in models. -done --- airtime_mvc/application/models/Block.php | 9 ++------- airtime_mvc/application/models/Datatables.php | 1 - airtime_mvc/application/models/Email.php | 2 +- airtime_mvc/application/models/MusicDir.php | 1 - airtime_mvc/application/models/Playlist.php | 3 --- airtime_mvc/application/models/Preference.php | 3 --- airtime_mvc/application/models/Schedule.php | 1 - airtime_mvc/application/models/Scheduler.php | 1 - airtime_mvc/application/models/Show.php | 11 ----------- 9 files changed, 3 insertions(+), 29 deletions(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 96fc1e9db..a91e0fb66 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -189,8 +189,7 @@ class Application_Model_Block implements Application_Model_LibraryEditable public function getContents($filterFiles=false) { Logging::info("Getting contents for block {$this->id}"); - - $files = array(); + $sql = <<con->beginTransaction(); - $errArray= array(); - try { $row = CcBlockcontentsQuery::create()->findPK($id); @@ -1030,8 +1027,7 @@ SQL; $blockType = $data['etc']['sp_type'] == 0 ? 'static':'dynamic'; $this->saveType($blockType); $this->storeCriteriaIntoDb($data); - //get number of files that meet the criteria - $files = $this->getListofFilesMeetCriteria(); + // if the block is dynamic, put null to the length // as it cannot be calculated if ($blockType == 'dynamic') { @@ -1360,7 +1356,6 @@ SQL; } if (in_array($fieldName, $fieldNames)) { - $rowNum = intval(substr($ele['name'], $index+1)); $output['criteria'][$critIndex][$lastChar][$fieldName] = trim($ele['value']); } else { $output['etc'][$ele['name']] = $ele['value']; diff --git a/airtime_mvc/application/models/Datatables.php b/airtime_mvc/application/models/Datatables.php index 016ff0362..61c74c7fa 100644 --- a/airtime_mvc/application/models/Datatables.php +++ b/airtime_mvc/application/models/Datatables.php @@ -116,7 +116,6 @@ class Application_Model_Datatables $simpleWhere = array(); foreach ($searchTerms as $term) { - $innerCond = array(); foreach ($searchCols as $col) { $simpleWhere['clause']["simple_".$col] = "{$col}::text ILIKE :simple_".$col; diff --git a/airtime_mvc/application/models/Email.php b/airtime_mvc/application/models/Email.php index cedec8e6f..234f20397 100644 --- a/airtime_mvc/application/models/Email.php +++ b/airtime_mvc/application/models/Email.php @@ -20,7 +20,7 @@ class Application_Model_Email $mailServer = Application_Model_Preference::GetMailServer(); $mailServerPort = Application_Model_Preference::GetMailServerPort(); if (!empty($mailServerPort)) { - $port = Application_Model_Preference::GetMailServerPort(); + $port = $mailServerPort; } if ($mailServerRequiresAuth) { diff --git a/airtime_mvc/application/models/MusicDir.php b/airtime_mvc/application/models/MusicDir.php index 373ad35f1..3d28f2e75 100644 --- a/airtime_mvc/application/models/MusicDir.php +++ b/airtime_mvc/application/models/MusicDir.php @@ -75,7 +75,6 @@ class Application_Model_MusicDir */ public function remove($userAddedWatchedDir=true) { - $con = Propel::getConnection(); $music_dir_id = $this->getId(); diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 852ff33a7..232a52f04 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -154,7 +154,6 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable public function getContents($filterFiles=false) { Logging::info("Getting contents for playlist {$this->id}"); - $files = array(); $sql = <<con->beginTransaction(); - $errArray= array(); - try { $row = CcPlaylistcontentsQuery::create()->findPK($id); diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 82e83abcc..e227ff403 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -6,8 +6,6 @@ class Application_Model_Preference public static function setValue($key, $value, $isUserValue = false) { try { - $con = Propel::getConnection(); - //called from a daemon process if (!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) { $id = NULL; @@ -425,7 +423,6 @@ class Application_Model_Preference { self::setValue("timezone", $timezone); date_default_timezone_set($timezone); - $md = array("timezone" => $timezone); } public static function GetTimezone() diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 29eb3c354..000736b8e 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -75,7 +75,6 @@ SQL; return; } - $con = Propel::getConnection(); $sql = "SELECT %%columns%% st.starts as starts, st.ends as ends, st.media_item_played as media_item_played, si.ends as show_ends %%tables%% WHERE "; diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 68e8bf8ad..95454eeb4 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -613,7 +613,6 @@ class Application_Model_Scheduler Logging::debug("inserting after removing gaps."); Logging::debug(floatval($endProfile) - floatval($startProfile)); - $afterInstanceId = $afterInstance->getDbId(); $modified = array_keys($modifiedMap); //need to adjust shows we have moved items from. foreach ($modified as $instanceId) { diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index c595fc7da..2462121a7 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -127,8 +127,6 @@ class Application_Model_Show public function getHosts() { - $con = Propel::getConnection(); - $sql = <<