Heratio Framework API Reference

EntityDeleteService
in package

Unified entity delete service for standalone Heratio mode.

Dispatches entity deletions to the appropriate CrudService::delete() method based on the entity's class_name in the object table. Provides a non-Propel delete path for all AtoM entity types using Laravel Query Builder.

For entities without a dedicated CrudService (Term, Feedback), deletion is handled inline with full referential integrity.

All deletions are wrapped in DB::transaction() for atomicity.

WP18: Phase 3 of the Heratio migration.

Tags
author

Johan Pieterse johan@theahg.co.za

Table of Contents

Methods

delete()  : bool
Delete an entity by its object ID.
deleteByClassName()  : bool
Delete an entity when the class_name is already known.
supports()  : bool
Check whether this service supports deleting a given class_name.

Methods

delete()

Delete an entity by its object ID.

public static delete(int $objectId) : bool

Looks up the class_name from the object table and dispatches to the appropriate CrudService::delete() method or handles deletion inline.

Parameters
$objectId : int

The object.id of the entity to delete

Tags
throws
RuntimeException

If the class_name is not supported

throws
RuntimeException

If the required CrudService file cannot be found

throws
Throwable

Re-thrown from DB::transaction on failure

Return values
bool

True if the entity was found and deleted

deleteByClassName()

Delete an entity when the class_name is already known.

public static deleteByClassName(int $id, string $className) : bool

Skips the object table lookup. Useful when the caller has already resolved the entity type (e.g. from a browse list or route context).

Parameters
$id : int

The entity/object ID

$className : string

The Propel class name (e.g. 'QubitActor')

Tags
throws
RuntimeException

If the class_name is not supported

throws
RuntimeException

If the required CrudService file cannot be found

throws
Throwable

Re-thrown from DB::transaction on failure

Return values
bool

True if deletion was dispatched successfully

supports()

Check whether this service supports deleting a given class_name.

public static supports(string $className) : bool
Parameters
$className : string

The Propel class name

Return values
bool

True if the class_name can be handled


        
On this page

Search results