AbstractCallbacks
abstract class AbstractCallbacks (View source)
Used for looking up and saving hashes related to a local image.
Inject an inherited object of this into new TemplateHelper(), by default \Rokka\Client\TemplateHelper\DefaultCallbacks is used.
Methods
This method is called, when an image was saved/uploaded to the rokka server.
Details
abstract string|null
getHash(AbstractLocalImage $image)
Callback when a "local" image needs its hash.
Look up if the hash is stored in the right place (DB or similar) and return it. If not stored, return null, so that the picture will be uploaded.
abstract string
saveHash(AbstractLocalImage $image, SourceImage $sourceImage)
This method is called, when an image was saved/uploaded to the rokka server.
This is the place, where you would store the hash in the right place (DB or similar). Has to return the hash or short hash.
array
getMetadata(AbstractLocalImage $image)
Return an array of metadata to be sent to the rokka server.