コード例 #1
0
 /**
  * Returns a RecordEntity for an id
  * @param $record_id
  * @return RecordEntity|null
  */
 public static function getValidRecordWithId($record_id)
 {
     try {
         $record = Record::getRepository()->findOneBy(['is_hidden' => false, 'id' => $record_id]);
         if (!empty($record)) {
             return $record;
         } else {
             return null;
         }
     } catch (Exception $e) {
         return null;
     }
 }
コード例 #2
0
 /**
  * Wrapper function to simply send all records as XML
  * Potentially, a second version could be created which just takes a bunch of record ids (if one would
  * e.g. export the result of a search
  */
 public function downloadAllRecords()
 {
     $records = Record::getRepository()->findBy(['is_hidden' => false]);
     $this->getDataFromRecords($records);
 }