WatermarkSettingsService
in package
WatermarkSettingsService - Manages watermark configuration.
All watermark data now stored in framework tables:
- object_watermark_setting (per-object settings)
- watermark_type (system watermark types)
- watermark_setting (global settings)
- custom_watermark (uploaded custom watermarks)
Table of Contents
Methods
- getAllSettings() : array<string|int, mixed>
- Get all global settings.
- getObjectsWithWatermarks() : array<string|int, mixed>
- Get all objects with custom watermarks for Cantaloupe cache.
- getSetting() : string|null
- Get a global setting value.
- getWatermarkConfig() : array<string|int, mixed>|null
- Get watermark configuration for an object.
- getWatermarkType() : object|null
- Get watermark type by ID.
- getWatermarkTypeByCode() : object|null
- Get watermark type by code.
- getWatermarkTypes() : array<string|int, mixed>
- Get all active watermark types.
- saveObjectWatermark() : bool
- Save watermark settings for an object.
- setSetting() : bool
- Set a global setting value.
- updateCantaloupeCache() : int
- Update Cantaloupe cache file with all watermark configurations.
Methods
getAllSettings()
Get all global settings.
public
static getAllSettings() : array<string|int, mixed>
Return values
array<string|int, mixed>getObjectsWithWatermarks()
Get all objects with custom watermarks for Cantaloupe cache.
public
static getObjectsWithWatermarks() : array<string|int, mixed>
Return values
array<string|int, mixed>getSetting()
Get a global setting value.
public
static getSetting(string $key[, string|null $default = null ]) : string|null
Parameters
- $key : string
- $default : string|null = null
Return values
string|nullgetWatermarkConfig()
Get watermark configuration for an object.
public
static getWatermarkConfig(int $objectId) : array<string|int, mixed>|null
Priority:
- Security classification watermark (highest)
- Object-specific watermark (object_watermark_setting)
- Default watermark (global setting)
Parameters
- $objectId : int
Return values
array<string|int, mixed>|nullgetWatermarkType()
Get watermark type by ID.
public
static getWatermarkType(int $id) : object|null
Parameters
- $id : int
Return values
object|nullgetWatermarkTypeByCode()
Get watermark type by code.
public
static getWatermarkTypeByCode(string $code) : object|null
Parameters
- $code : string
Return values
object|nullgetWatermarkTypes()
Get all active watermark types.
public
static getWatermarkTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>saveObjectWatermark()
Save watermark settings for an object.
public
static saveObjectWatermark(int $objectId, int|null $watermarkTypeId[, bool $enabled = true ]) : bool
Parameters
- $objectId : int
- $watermarkTypeId : int|null
- $enabled : bool = true
Return values
boolsetSetting()
Set a global setting value.
public
static setSetting(string $key, string $value) : bool
Parameters
- $key : string
- $value : string
Return values
boolupdateCantaloupeCache()
Update Cantaloupe cache file with all watermark configurations.
public
static updateCantaloupeCache() : int