public function updatePhotoFromPath($photoId, $filepath)
    {
        if (is_null($photoId) || $photoId == '') {
            throw new Exception('The photoId is required to update a photo.');
        }

        if (is_null($filepath) || $filepath == '') {
            throw new Exception('The filepath is required to upload a file.');
        }

        if (!file_exists($filepath)) {
            throw new Exception('The filepath does not point to an accessible file.');
        }

        $params = array(
            'method' => 'sp.photo.update',
            'photo_id' => $photoId,
        );

        $photos = array(
            'photo' => new CURLFile($filepath),
        );

        return $this->_makeApiRequest($params, $photos);
    }
public function updatePhotoFromPath($photoId, $filepath)
    {
        if (is_null($photoId) || $photoId == '') {
            throw new Exception('The photoId is required to update a photo.');
        }

        if (is_null($filepath) || $filepath == '') {
            throw new Exception('The filepath is required to upload a file.');
        }

        if (!file_exists($filepath)) {
            throw new Exception('The filepath does not point to an accessible file.');
        }

        $params = array(
            'method' => 'sp.photo.update',
            'photo_id' => $photoId,
        );

        $photos = array(
            'photo' => new CURLFile($filepath),
        );

        return $this->_makeApiRequest($params, $photos);
    }
public function updatePhotoFromPath ( $ photoId , $ filepath ) { if ( is_null ( $ photoId ) || $ photoId == '' ) { throw new Exception ( 'The photoId is required to update a photo.' ) ; } if ( is_null ( $ filepath ) || $ filepath == '' ) { throw new Exception ( 'The filepath is required to upload a file.' ) ; } if ( ! file_exists ( $ filepath ) ) { throw new Exception ( 'The filepath does not point to an accessible file.' ) ; } $ params = array ( 'method' => 'sp.photo.update' , 'photo_id' => $ photoId , ) ; $ photos = array ( 'photo' => new CURLFile ( $ filepath ) , ) ; return $ this -> _makeApiRequest ( $ params , $ photos ) ; }
Method to update a photo from a filepath

@param integer $photoId
@param stirng $filepath
@return array
Method to update a photo from a filepath