Skip to content

Instantly share code, notes, and snippets.

@kitsunde
Created October 8, 2010 17:31
Show Gist options
  • Save kitsunde/617166 to your computer and use it in GitHub Desktop.
Save kitsunde/617166 to your computer and use it in GitHub Desktop.
/*
Why aren't you just deleting all images before update????
*/
public function saveImages( $movieInfo ){
if( DONT_SAVE_IMAGES ) return;
// $imageIds = array();
if( property_exists( $movieInfo, "posters" ) ){
foreach( $movieInfo->posters as $image ){
// $imageIds[ count( $imageIds ) ] = $image->image->id;
$this->saveImage( $movieInfo->id, $image->image );
}
}
if( property_exists( $movieInfo, "backdrops" ) ){
foreach( $movieInfo->backdrops as $image ){
// $imageIds[ count( $imageIds ) ] = $image->image->id;
$this->saveImage( $movieInfo->id, $image->image );
}
}
/* foreach( $this->getImageIds( $movieInfo->id ) as $imageId ){
if( !in_array( $imageId, $imageIds ) )
$this->removeImage( $imageId );
}*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment