Heratio Framework API Reference

TermWriteServiceInterface
in

Contract for term/taxonomy write operations.

Covers: creating terms, updating terms, deleting terms, creating notes, creating relations, and managing other-names (use-for / alternative labels).

The PropelAdapter wraps QubitTerm, QubitRelation, QubitOtherName for Symfony mode. Falls back to Laravel DB for standalone mode.

Table of Contents

Methods

createNote()  : int
Create a note on an object (scope note, source note, display note, etc.).
createOtherName()  : object
Create an other-name (alternative label / use-for) on an object.
createRelation()  : object
Create a relation between two objects.
createTerm()  : object
Create a new term in a taxonomy.
deleteTerm()  : bool
Delete a term by ID.
newOtherName()  : object
Create a new unsaved other-name object for use in Propel relationship collections.
newRelation()  : object
Create a new unsaved relation object for use in Propel relationship collections.
newTerm()  : object
Create a new unsaved term object for use in Propel relationship collections.
updateTerm()  : void
Update term attributes.

Methods

createNote()

Create a note on an object (scope note, source note, display note, etc.).

public createNote(int $objectId, int $typeId, string $content[, string $culture = 'en' ]) : int
Parameters
$objectId : int

Object (term) ID

$typeId : int

Note type term ID

$content : string

Note content

$culture : string = 'en'

Culture code

Return values
int

The new note ID

createOtherName()

Create an other-name (alternative label / use-for) on an object.

public createOtherName(int $objectId, string $name, int $typeId[, string $culture = 'en' ]) : object
Parameters
$objectId : int

Object ID

$name : string

The alternative name

$typeId : int

Other-name type term ID

$culture : string = 'en'

Culture code

Return values
object

The created other-name (QubitOtherName or stdClass with ->id)

createRelation()

Create a relation between two objects.

public createRelation(int $subjectId, int $objectId, int $typeId) : object
Parameters
$subjectId : int

Subject object ID

$objectId : int

Object ID (related to)

$typeId : int

Relation type term ID

Return values
object

The created relation (QubitRelation or stdClass with ->id)

createTerm()

Create a new term in a taxonomy.

public createTerm(int $taxonomyId, string $name[, string $culture = 'en' ][, int|null $parentId = null ]) : object
Parameters
$taxonomyId : int

Taxonomy ID to create term in

$name : string

Term name

$culture : string = 'en'

Culture code (e.g., 'en')

$parentId : int|null = null

Parent term ID (null = ROOT_ID)

Return values
object

The created term (QubitTerm or stdClass with ->id)

deleteTerm()

Delete a term by ID.

public deleteTerm(int $id) : bool
Parameters
$id : int

Term ID

Return values
bool

True if deleted

newOtherName()

Create a new unsaved other-name object for use in Propel relationship collections.

public newOtherName() : object

Returns a QubitOtherName (Propel) or stdClass suitable for deferred save.

Return values
object

Unsaved QubitOtherName 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

newTerm()

Create a new unsaved term object for use in Propel relationship collections.

public newTerm() : object

Returns a QubitTerm (Propel) or stdClass suitable for deferred save via parent relationship collections (e.g., $parent->termsRelatedByparentId[]).

Return values
object

Unsaved QubitTerm or stdClass

updateTerm()

Update term attributes.

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

Term ID

$attributes : array<string|int, mixed>

Column => value pairs to update

$culture : string = 'en'

Culture code for i18n attributes


        
On this page

Search results