Ejemplo n.º 1
0
 /**
  *
  * @param  record_adapter $record
  * @param  array          $options
  * @return string         The new distant Id
  */
 public function upload(record_adapter $record, array $options = [])
 {
     $uploader = new Phlickr_Uploader($this->_api);
     $privacy = $this->get_default_privacy();
     $uploader->setPerms($privacy['public'], $privacy['friends'], $privacy['family']);
     $type = $record->get_type() == 'image' ? self::ELEMENT_TYPE_PHOTO : $record->get_type();
     switch ($type) {
         case self::ELEMENT_TYPE_PHOTO:
             return $uploader->upload($record->get_hd_file()->getRealPath(), $options['title'], $options['description'], $options['tags'], true);
             break;
         default:
             throw new Bridge_Exception_InvalidRecordType('Unknown format');
             break;
     }
 }