/**
* @param int $presetId
*
* @throws NotFoundException
* @throws ParameterMissingException
* @throws Exception
*/
public function delete($presetId) { if (!
$presetId) { throw new ParameterMissingException('id'
);
} /** @var Preset|null $preset */
$preset =
$this->models->
find(Preset::
class,
$presetId);
if (!
$preset) { throw new NotFoundException(sprintf('Emotion preset with id %s not found',
$presetId));
} if (!
$preset->
getCustom()) { throw new PrivilegeException(sprintf('Emotion preset %s is not defined as custom preset',
$preset->
getName()));
}