Example #1
0
 /**
  * Edits a Displays Name
  * @return 
  * @param $license Object
  * @param $display Object
  */
 public function EditDisplayName($license, $display)
 {
     Debug::LogEntry('audit', 'IN', 'DisplayGroup', 'EditDisplayName');
     try {
         $dbh = PDOConnect::init();
         // Update the display with its new name (using the licence as the key)
         $sth = $dbh->prepare('UPDATE display SET display = :display WHERE license = :license');
         $sth->execute(array('display' => $display, 'license' => $license));
         // Also need to update the display group name here.
         $displayGroupObject = new DisplayGroup($this->db);
         // Do we also want to update the linked Display Groups name (seeing as that is what we will be presenting to everyone)
         if (!$displayGroupObject->EditDisplayGroup($displayID, $display)) {
             $this->ThrowError(25015, __('Could not update this display with a new name.'));
         }
         Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'EditDisplayName');
         return true;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         if (!$this->IsError()) {
             $this->SetError(25015, __('Unable to edit display record.'));
         }
         return false;
     }
 }