示例#1
0
 /**
  * @param Bridge_Element $element
  *
  * @return BridgeJob
  */
 private function upload_element(\Bridge_Element $element)
 {
     $account = $element->get_account();
     $element->set_status(\Bridge_Element::STATUS_PROCESSING);
     $dist_id = null;
     try {
         $dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas());
         $element->set_uploaded_on(new \DateTime());
     } catch (\Exception $e) {
         $this->log('debug', 'Error while uploading : ' . $e->getMessage());
         $element->set_status(\Bridge_Element::STATUS_ERROR);
     }
     $element->set_dist_id($dist_id);
     return $this;
 }