DonorWriteServiceInterface
in
Contract for donor write operations.
Donor extends Actor in AtoM's entity hierarchy: object -> actor -> actor_i18n -> donor
The donor table only has an id column (FK to actor.id).
All name/description fields live in actor_i18n.
Table of Contents
Methods
- createDonor() : int
- Create a new donor. Returns the new ID.
- deleteDonor() : void
- Delete a donor.
- newDonor() : object
- Create a new, empty donor object for form binding.
- updateDonor() : void
- Update an existing donor.
Methods
createDonor()
Create a new donor. Returns the new ID.
public
createDonor(array<string|int, mixed> $data[, string $culture = 'en' ]) : int
Handles the entity inheritance: INSERT object -> INSERT actor -> INSERT actor_i18n -> INSERT donor
Parameters
- $data : array<string|int, mixed>
-
Donor data (authorized_form_of_name, etc.)
- $culture : string = 'en'
-
Culture code (e.g., 'en')
Return values
int —The new donor.id
deleteDonor()
Delete a donor.
public
deleteDonor(int $id) : void
Parameters
- $id : int
-
Donor ID
newDonor()
Create a new, empty donor object for form binding.
public
newDonor() : object
Return values
objectupdateDonor()
Update an existing donor.
public
updateDonor(int $id, array<string|int, mixed> $data[, string $culture = 'en' ]) : void
Parameters
- $id : int
-
Donor ID
- $data : array<string|int, mixed>
-
Column => value pairs to update
- $culture : string = 'en'
-
Culture code for i18n attributes