Heratio Framework API Reference

StandalonePhysicalObjectWriteService
in package
implements PhysicalObjectWriteServiceInterface uses EntityWriteTrait

Standalone physical object write service using Laravel Query Builder only.

Clean implementation without Propel references or class_exists checks. Handles the AtoM entity inheritance chain: object -> physical_object -> physical_object_i18n

Table of Contents

Interfaces

PhysicalObjectWriteServiceInterface
Contract for PhysicalObject write operations.

Methods

createPhysicalObject()  : int
Create a new physical object. Returns the new object ID.
newPhysicalObject()  : object
Get a new unsaved PhysicalObject (for form binding in Propel mode).
savePhysicalObject()  : int
Save a physical object with properties already set (Propel mode).
updatePhysicalObject()  : void
Update an existing physical object.

Methods

createPhysicalObject()

Create a new physical object. Returns the new object ID.

public createPhysicalObject(array<string|int, mixed> $data[, string $culture = 'en' ]) : int

Handles entity inheritance: INSERT object -> INSERT physical_object -> INSERT physical_object_i18n.

Parameters
$data : array<string|int, mixed>

Physical object attributes (name, location, type_id, etc.)

$culture : string = 'en'

Culture code

Return values
int

The new object ID

newPhysicalObject()

Get a new unsaved PhysicalObject (for form binding in Propel mode).

public newPhysicalObject() : object

In standalone mode, returns stdClass.

Return values
object

Unsaved QubitPhysicalObject or stdClass

savePhysicalObject()

Save a physical object with properties already set (Propel mode).

public savePhysicalObject(object $resource) : int

In Propel mode, calls $resource->save(). In standalone mode, extracts properties and performs INSERT/UPDATE via Laravel DB.

Parameters
$resource : object

The physical object to save (QubitPhysicalObject or stdClass)

Return values
int

The saved object ID

updatePhysicalObject()

Update an existing physical object.

public updatePhysicalObject(int $id, array<string|int, mixed> $data[, string $culture = 'en' ]) : void
Parameters
$id : int

Physical object ID

$data : array<string|int, mixed>

Column => value pairs to update

$culture : string = 'en'

Culture code for i18n attributes


        
On this page

Search results