original_string: function addPhoto($photo) {
          if (!file_exists($photo['tmp_name']) || !is_uploaded_file($photo['tmp_name'])) {
              $o = array('state' => false); 
          } else {
              
              $photos = new Zend_Gdata_Photos($this->client);
              
              $fd = $photos->newMediaFileSource($photo["tmp_name"]);
              $fd->setContentType($photo["type"]);
              
              $entry = new Zend_Gdata_Photos_PhotoEntry();
              $entry->setMediaSource($fd);
              $entry->setTitle($photos->newTitle($photo["name"]));
              
              $albumQuery = new Zend_Gdata_Photos_AlbumQuery;
              $albumQuery->setUser($this->user);
              $albumQuery->setAlbumId($this->album);
              
              $albumEntry = $photos->getAlbumEntry($albumQuery);
              
              $result = $photos->insertPhotoEntry($entry, $albumEntry);
              if ($result) {
                  $o = array('state' => true, 'id' => $result->getGphotoId());                 
              } else {
                  $o = array('state' => false); 
              }            
          }
          return $o;
      }
code: function addPhoto($photo) {
          if (!file_exists($photo['tmp_name']) || !is_uploaded_file($photo['tmp_name'])) {
              $o = array('state' => false); 
          } else {
              
              $photos = new Zend_Gdata_Photos($this->client);
              
              $fd = $photos->newMediaFileSource($photo["tmp_name"]);
              $fd->setContentType($photo["type"]);
              
              $entry = new Zend_Gdata_Photos_PhotoEntry();
              $entry->setMediaSource($fd);
              $entry->setTitle($photos->newTitle($photo["name"]));
              
              $albumQuery = new Zend_Gdata_Photos_AlbumQuery;
              $albumQuery->setUser($this->user);
              $albumQuery->setAlbumId($this->album);
              
              $albumEntry = $photos->getAlbumEntry($albumQuery);
              
              $result = $photos->insertPhotoEntry($entry, $albumEntry);
              if ($result) {
                  $o = array('state' => true, 'id' => $result->getGphotoId());                 
              } else {
                  $o = array('state' => false); 
              }            
          }
          return $o;
      }
code_tokens: function addPhoto ( $ photo ) { if ( ! file_exists ( $ photo [ 'tmp_name' ] ) || ! is_uploaded_file ( $ photo [ 'tmp_name' ] ) ) { $ o = array ( 'state' => false ) ; } else { $ photos = new Zend_Gdata_Photos ( $ this -> client ) ; $ fd = $ photos -> newMediaFileSource ( $ photo [ "tmp_name" ] ) ; $ fd -> setContentType ( $ photo [ "type" ] ) ; $ entry = new Zend_Gdata_Photos_PhotoEntry ( ) ; $ entry -> setMediaSource ( $ fd ) ; $ entry -> setTitle ( $ photos -> newTitle ( $ photo [ "name" ] ) ) ; $ albumQuery = new Zend_Gdata_Photos_AlbumQuery ; $ albumQuery -> setUser ( $ this -> user ) ; $ albumQuery -> setAlbumId ( $ this -> album ) ; $ albumEntry = $ photos -> getAlbumEntry ( $ albumQuery ) ; $ result = $ photos -> insertPhotoEntry ( $ entry , $ albumEntry ) ; if ( $ result ) { $ o = array ( 'state' => true , 'id' => $ result -> getGphotoId ( ) ) ; } else { $ o = array ( 'state' => false ) ; } } return $ o ; }
docstring: Add a photo to specific picasa web album
  @param [file] $photo [uploaded photo file object]
docstring_tokens: Add a photo to specific picasa web album