/**
  * Saves object-specific attributes.
  *
  * @internal Object attributes are saved in the objects_entity table.
  *
  * @return bool
  */
 public function save()
 {
     // Save ElggEntity attributes
     if (!parent::save()) {
         return false;
     }
     // Save ElggObject-specific attributes
     return create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'), $this->get('container_guid'));
 }
Beispiel #2
0
 /**
  * Override the save function.
  * @return true|false
  */
 public function save()
 {
     // Save generic stuff
     if (!parent::save()) {
         return false;
     }
     // Now save specific stuff
     return create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'), $this->get('container_guid'));
 }
Beispiel #3
0
 /**
  * Saves object-specific attributes.
  *
  * @internal Object attributes are saved in the objects_entity table.
  *
  * @return bool
  */
 public function save()
 {
     // Save ElggEntity attributes
     if (!parent::save()) {
         return false;
     }
     // Save ElggObject-specific attributes
     _elgg_disable_caching_for_entity($this->guid);
     $ret = create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'));
     _elgg_enable_caching_for_entity($this->guid);
     return $ret;
 }
 /*
 $file->open("write");
 $file->write();
 $file->write(get_uploaded_file($key));
 $file->close();
 */
 $result = $file->save();
 if (!$result) {
     array_push($not_uploaded, $sent_file['name']);
     array_push($error_msgs, elgg_echo('tidypics:save_error'));
     continue;
 }
 //add tags
 create_metadata($file->guid, "tags", $photo["tags"], "text", $user->guid, ACCESS_PUBLIC);
 //add title and description
 create_object_entity($file->guid, $photo["title"], $photo["description"]);
 //get and store the exif data
 td_get_exif($file);
 // resize photos to create thumbnails
 if ($image_lib == 'ImageMagick') {
     // ImageMagick command line
     if (tp_create_im_cmdline_thumbnails($file, $prefix, $filestorename) != true) {
         trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING);
     }
 } else {
     if ($image_lib == 'ImageMagickPHP') {
         // imagick php extension
         if (tp_create_imagick_thumbnails($file, $prefix, $filestorename) != true) {
             trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING);
         }
     } else {