Exemple #1
0
 /**
  *
  * Save the published info in local database.
  * @param $response			The actual response received for the registry.
  * @param Boolen $update	If true the response is saved as an insert operation,
  * 							if false it is saved as an update.
  */
 public function saveRegistryPublishInfo($response, $update = false)
 {
     //Activity
     if (!$this->organisation) {
         $model = new Model_RegistryPublishedData();
         if ($update) {
             $model->updateRegistryPublishInfo($this->file_id, $response);
         } else {
             $model->saveRegistryPublishInfo($this->file_id, $response);
         }
     } else {
         $organisationRegistryModel = new Model_OrganisationRegistryPublishedData();
         if ($update) {
             $organisationRegistryModel->updateRegistryPublishInfo($this->file_id, $response);
         } else {
             $organisationRegistryModel->saveRegistryPublishInfo($this->file_id, $response);
         }
     }
 }
Exemple #2
0
 /**
  * Save the response received from the registry and update the is_published attribute of the file
  */
 public function saveRegistryPublishInfo($response)
 {
     if ($this->isOrganisationData()) {
         $model = new Model_OrganisationRegistryPublishedData();
     } else {
         $model = new Model_RegistryPublishedData();
     }
     if ($this->isPushedToRegistry) {
         $model->updateRegistryPublishInfo($this->id, $response);
     } else {
         $filename = explode('.', $this->name);
         $name = $filename[0];
         $model->saveRegistryPublishInfo($this->id, $name, $response);
     }
 }