public function addPhoto($foto) { $picasa = new Neo_Gdata_Photo(); $resultPhoto = $picasa->insertPhoto($this->album_id, $foto); $this->Photos[] = Photo::setPhoto($resultPhoto); $this->save(); }
/** * Añade datos de la ultima foto cargda (Zend_Gdata_Photos_PhotoFeed) * al modelo Photo. * * @return Photo */ public static function converseToModel() { $picasa = new Neo_Gdata_Photo(); $photo = $picasa->getLastPhotoUpload(); $foto = new Photo(); $foto->photo_id = $photo->getGphotoId(); $foto->titulo = $photo->getTitle(); $foto->descripcion = $photo->getMediaGroup()->getDescription(); $thumbnail = $photo->getMediaGroup()->getThumbnail(); $foto->thumbnail_1 = $thumbnail[0]->getUrl(); $foto->thumbnail_2 = $thumbnail[1]->getUrl(); $foto->thumbnail_3 = $thumbnail[2]->getUrl(); $foto->save(); return $foto; }
public function deletephotoAction() { $modelo = $this->verifyModelo($id); $photoId = (int) $this->_request->getParam('photo'); $photo = Photo::findPhoto($photoId); if (null !== $photo) { $picasa = new Neo_Gdata_Photo(); $picasa->deletePhoto($modelo->album_id, $photo->photo_id); $photo->delete(); } $this->_flashMessenger->addSuccess('Foto Eliminada'); $url = $this->view->url(array('modelo' => $modelo->id), 'detalleModelo'); $url = str_replace($this->view->baseUrl(), '', $url); $this->_redirect($url); }
public function getFotos() { $picasa = new Neo_Gdata_Photo(); return $picasa->getPhotos($this->album_id); }