コード例 #1
0
 /**
  * Load the grouped work that this record is connected to.
  */
 public function loadGroupedWork()
 {
     require_once ROOT_DIR . '/sys/Grouping/GroupedWorkPrimaryIdentifier.php';
     require_once ROOT_DIR . '/sys/Grouping/GroupedWork.php';
     $groupedWork = new GroupedWork();
     $query = "SELECT grouped_work.* FROM grouped_work INNER JOIN grouped_work_primary_identifiers ON grouped_work.id = grouped_work_id WHERE type='overdrive' AND identifier = '" . $this->getUniqueID() . "'";
     $groupedWork->query($query);
     if ($groupedWork->N == 1) {
         $groupedWork->fetch();
         $this->groupedWork = clone $groupedWork;
     }
 }
コード例 #2
0
ファイル: AJAX.php プロジェクト: victorfcm/VuFind-Plus
 function forceReindex()
 {
     require_once ROOT_DIR . '/RecordDrivers/GroupedWorkDriver.php';
     require_once ROOT_DIR . '/sys/Grouping/GroupedWork.php';
     $id = $_REQUEST['id'];
     $groupedWork = new GroupedWork();
     $groupedWork->permanent_id = $id;
     if ($groupedWork->find(true)) {
         $groupedWork->date_updated = null;
         $numRows = $groupedWork->query("UPDATE grouped_work set date_updated = null where id = " . $groupedWork->id);
         if ($numRows == 1) {
             return json_encode(array('success' => true, 'message' => 'This title will be indexed again next time the index is run.'));
         } else {
             return json_encode(array('success' => false, 'message' => 'Unable to mark the title for indexing. Could not update the title.'));
         }
     } else {
         return json_encode(array('success' => false, 'message' => 'Unable to mark the title for indexing. Could not find the title.'));
     }
 }