35 public static function registerNewOperation(
36 string $operation_name,
41 if (!$contextList->hasSets()) {
42 throw new ilException(
'Context does not exist! register context first using ilOrgUnitOperationContext::registerNewContext()');
47 $ilOrgUnitOperationContext = $contextList->first();
50 'context_id' => $ilOrgUnitOperationContext->getId(),
51 'operation_string' => $operation_name,
54 throw new ilException(
'This operation in this context has already been registered.');
57 $operation->setOperationString($operation_name);
58 $operation->setContextId($ilOrgUnitOperationContext->getId());
59 $operation->setDescription($description);
69 string $operation_name,
74 self::registerNewOperation($operation_name, $description, $context);
107 string $operation_string,
static findByOperationString(string $operation_string, string $context_name)
static getOperationsForContextName(string $context_name)
static findByName(string $context_name)
static registerNewOperationForMultipleContexts(string $operation_name, string $description, array $contexts)
static where($where, $operator=null)
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null...
static getOperationsForContextId(string $context_id)
static findById(int $operation_id)