StandaloneAccessionWriteService
in package
implements
AccessionWriteServiceInterface
uses
EntityWriteTrait
Standalone accession write service using Laravel Query Builder only.
Clean implementation without Propel references or class_exists checks. Unlike the Propel version, createRelatedInformationObject() is fully implemented — it reads accession i18n data, creates an IO with copied fields, creates the accession-IO relation, and generates a slug.
Table of Contents
Interfaces
- AccessionWriteServiceInterface
- Contract for accession write operations.
Methods
- createAccession() : object
- Create a new accession record.
- createEvent() : object
- Create an event linked to an information object.
- createRelatedInformationObject() : object
- Create an information object from accession data and link it.
- createRelation() : object
- Create a relation between two objects.
- linkDonor() : void
- Link a donor to an accession.
- newAccession() : object
- Create a new unsaved accession object.
- newEvent() : object
- Create a new unsaved event object for use in Propel relationship collections.
- newInformationObject() : object
- Create a new unsaved information object for use in Propel relationship collections.
- newRelation() : object
- Create a new unsaved relation object for use in Propel relationship collections.
- updateAccession() : void
- Update accession attributes.
Methods
createAccession()
Create a new accession record.
public
createAccession(array<string|int, mixed> $attributes[, string $culture = 'en' ]) : object
Parameters
- $attributes : array<string|int, mixed>
-
Accession attributes (identifier, title, etc.)
- $culture : string = 'en'
-
Culture code
Return values
object —The created accession (QubitAccession or stdClass with ->id)
createEvent()
Create an event linked to an information object.
public
createEvent(int $objectId, array<string|int, mixed> $attributes[, string $culture = 'en' ]) : object
Parameters
- $objectId : int
-
Information object ID
- $attributes : array<string|int, mixed>
-
Event attributes (actor_id, type_id, date, etc.)
- $culture : string = 'en'
-
Culture code
Return values
object —The created event (QubitEvent or stdClass with ->id)
createRelatedInformationObject()
Create an information object from accession data and link it.
public
createRelatedInformationObject(object $accession) : object
Copies title, scope, archival history, physical characteristics, rights, creators, and dates from the accession to a new IO.
Parameters
- $accession : object
-
The source accession (QubitAccession or stdClass)
Return values
object —The created information object (QubitInformationObject or stdClass with ->id)
createRelation()
Create a relation between two objects.
public
createRelation(int $subjectId, int $objectId, int $typeId[, bool $indexOnSave = true ]) : object
Parameters
- $subjectId : int
-
Subject object ID
- $objectId : int
-
Object ID (related to)
- $typeId : int
-
Relation type term ID
- $indexOnSave : bool = true
-
Whether to index on save (default true)
Return values
object —The created relation (QubitRelation or stdClass with ->id)
linkDonor()
Link a donor to an accession.
public
linkDonor(int $accessionId, int $donorId) : void
Parameters
- $accessionId : int
-
Accession ID
- $donorId : int
-
Donor (actor) ID
newAccession()
Create a new unsaved accession object.
public
newAccession() : object
Returns a QubitAccession (Propel) or stdClass for form binding.
Return values
object —Unsaved QubitAccession or stdClass
newEvent()
Create a new unsaved event object for use in Propel relationship collections.
public
newEvent() : object
Returns a QubitEvent (Propel) or stdClass suitable for deferred save.
Return values
object —Unsaved QubitEvent or stdClass
newInformationObject()
Create a new unsaved information object for use in Propel relationship collections.
public
newInformationObject() : object
Returns a QubitInformationObject (Propel) or stdClass suitable for deferred save.
Return values
object —Unsaved QubitInformationObject or stdClass
newRelation()
Create a new unsaved relation object for use in Propel relationship collections.
public
newRelation() : object
Returns a QubitRelation (Propel) or stdClass suitable for deferred save.
Return values
object —Unsaved QubitRelation or stdClass
updateAccession()
Update accession attributes.
public
updateAccession(int $id, array<string|int, mixed> $attributes[, string $culture = 'en' ]) : void
Parameters
- $id : int
-
Accession ID
- $attributes : array<string|int, mixed>
-
Column => value pairs to update
- $culture : string = 'en'
-
Culture code for i18n attributes