ActorWriteServiceInterface
in
Contract for actor write operations.
Covers: creating actors, updating actors, creating relations, and saving Propel actor objects.
The PropelAdapter wraps QubitActor, QubitRelation for Symfony mode. Falls back to Laravel DB for standalone Heratio mode, handling the AtoM entity inheritance chain: object -> actor -> actor_i18n
Table of Contents
Methods
- createActor() : int
- Create a new actor. Returns the new actor ID.
- createRelation() : int
- Create a relation between two objects.
- saveActor() : int
- Save an actor with properties already set (Propel mode).
- updateActor() : void
- Update an existing actor.
Methods
createActor()
Create a new actor. Returns the new actor ID.
public
createActor(array<string|int, mixed> $data[, string $culture = 'en' ]) : int
Handles the AtoM entity inheritance: INSERT object -> INSERT actor -> INSERT actor_i18n.
Parameters
- $data : array<string|int, mixed>
-
Actor data (entity_type_id, authorized_form_of_name, etc.)
- $culture : string = 'en'
-
Culture code (e.g., 'en')
Return values
int —The new actor.id
createRelation()
Create a relation between two objects.
public
createRelation(int $subjectId, int $objectId, int $typeId) : int
relation table: subject_id, object_id, type_id
Parameters
- $subjectId : int
-
Subject object ID
- $objectId : int
-
Related object ID
- $typeId : int
-
Relation type term ID
Return values
int —The new relation.id
saveActor()
Save an actor with properties already set (Propel mode).
public
saveActor(object $actor) : int
In Propel mode, calls $actor->save(). In standalone mode, extracts properties and does DB inserts.
Parameters
- $actor : object
-
The actor object (QubitActor or stdClass)
Return values
int —The actor ID
updateActor()
Update an existing actor.
public
updateActor(int $id, array<string|int, mixed> $data[, string $culture = 'en' ]) : void
Parameters
- $id : int
-
Actor ID
- $data : array<string|int, mixed>
-
Column => value pairs to update
- $culture : string = 'en'
-
Culture code for i18n attributes