public function save(EventInterface $event) {
        $request = $event->getRequest();
        $database = $event->getDatabase();

        $user = $request->getUser();
        $imageIdentifier = $request->getImage()->getImageIdentifier();

        try {
            $database->updateMetadata(
                $user,
                $imageIdentifier,
                $this->properties
            );
        } catch (DatabaseException $e) {
            $database->deleteImage($user, $imageIdentifier);

            throw new RuntimeException('Could not store EXIF-metadata', 500);
        }
    }
public function save(EventInterface $event) {
        $request = $event->getRequest();
        $database = $event->getDatabase();

        $user = $request->getUser();
        $imageIdentifier = $request->getImage()->getImageIdentifier();

        try {
            $database->updateMetadata(
                $user,
                $imageIdentifier,
                $this->properties
            );
        } catch (DatabaseException $e) {
            $database->deleteImage($user, $imageIdentifier);

            throw new RuntimeException('Could not store EXIF-metadata', 500);
        }
    }
public function save ( EventInterface $ event ) { $ request = $ event -> getRequest ( ) ; $ database = $ event -> getDatabase ( ) ; $ user = $ request -> getUser ( ) ; $ imageIdentifier = $ request -> getImage ( ) -> getImageIdentifier ( ) ; try { $ database -> updateMetadata ( $ user , $ imageIdentifier , $ this -> properties ) ; } catch ( DatabaseException $ e ) { $ database -> deleteImage ( $ user , $ imageIdentifier ) ; throw new RuntimeException ( 'Could not store EXIF-metadata' , 500 ) ; } }
Save metadata to database

@param  EventInterface $event The triggered event
@throws RuntimeException
Save metadata to database