/** * {@inheritdoc} */ public function check(EntityManager $em, File $file) { $boolean = !count(\record_adapter::get_record_by_uuid($this->app, $file->getCollection()->get_databox(), $file->getUUID())); return new Response($boolean, $this); }
/** * Get an array of records that can be substitued by the Lazaret file * * @return array */ public function getRecordsToSubstitute(Application $app) { $ret = []; $shaRecords = \record_adapter::get_record_by_sha($app, $this->getCollection($app)->get_sbas_id(), $this->getSha256()); $uuidRecords = \record_adapter::get_record_by_uuid($app, $this->getCollection($app)->get_databox(), $this->getUuid()); $merged = array_merge($uuidRecords, $shaRecords); foreach ($merged as $record) { if (!in_array($record, $ret)) { $ret[] = $record; } } return $ret; }