CSNotes
in package
This API offers an interface to the CONTENTSERV Notes
Tags
Table of Contents
- cloneNotesForRecord() : array<string|int, mixed>
- clones all notes for a specific record from another record defined by the $iOldRecordID. This method only supports cloning of notes from the same record type.
- createNote() : CSNote
- creates a note
- deleteNotesForRecord() : void
- Deletes all notes that belong to the given record
- deleteNotesForRecordIds() : void
- Deletes all notes that belong to the given record
- getNote() : object
- returns the note object for the specified id
- getNotes() : array<string|int, CSNote>
- returns all notes for the specified record and sub context
- groupNotesBySubContext() : array<string|int, mixed>
- Grouped a given array by SubContext
Methods
cloneNotesForRecord()
clones all notes for a specific record from another record defined by the $iOldRecordID. This method only supports cloning of notes from the same record type.
public
static cloneNotesForRecord(object $oRecord, int $iOldRecordID) : array<string|int, mixed>
Parameters
- $oRecord : object
-
the record for which to clone notes. This parameter has to be a subclass of the Record-class, API-objects are not allowed here
- $iOldRecordID : int
-
the record id of the record from which the notes should be cloned to the given record
Tags
Return values
array<string|int, mixed> —array of CSNote-objects for all notes that have been cloned
createNote()
creates a note
public
static createNote(string $contextModule, string $contextRecord, int $contextRecordID, int $positionX, int $positionY[, string $subContext = '' ][, string $type = 'simple' ]) : CSNote
Parameters
- $contextModule : string
-
the context module of the note
- $contextRecord : string
-
the name of the context record (e.g. Mamfile)
- $contextRecordID : int
-
the record id of the context record
- $positionX : int
-
the x position of the note relative to the container html element
- $positionY : int
-
the y position of the note relative to the container html element
- $subContext : string = ''
-
an optional subcontext to identify the note (e.g. a page id in indesign documents)
- $type : string = 'simple'
-
the note type (simple, rect, vert, hori)
Tags
Return values
CSNote —the created note
deleteNotesForRecord()
Deletes all notes that belong to the given record
public
static deleteNotesForRecord(object $oRecord) : void
Parameters
- $oRecord : object
-
the record for which to delete notes. This parameter has to be a subclass of the Record-class, API-objects are not allowed here
Tags
Return values
void —deleteNotesForRecordIds()
Deletes all notes that belong to the given record
public
static deleteNotesForRecordIds(object $oRecord, array<string|int, mixed> $aIds) : void
Parameters
- $oRecord : object
-
the record for which to delete notes. This parameter has to be a subclass of the Record-class, API-objects are not allowed here
- $aIds : array<string|int, mixed>
-
An array with the ids of the record which should be deleted.
Tags
Return values
void —getNote()
returns the note object for the specified id
public
static getNote([int $id = null ]) : object
Parameters
- $id : int = null
-
the id of the note
Tags
Return values
object —the note as CSNote-object
getNotes()
returns all notes for the specified record and sub context
public
static getNotes(mixed $mContextModules, string $contextRecord, int $contextID[, string $subContext = '' ]) : array<string|int, CSNote>
Parameters
- $mContextModules : mixed
-
The context module of the note as a string (for a single module) or an array in case the notes for multiple modules should be returned.
- $contextRecord : string
-
The name of the context record (e.g. Mamfile)
- $contextID : int
-
The record id of the context record
- $subContext : string = ''
-
An optional subcontext to identify the note (e.g. a page id in indesign documents)
Tags
Return values
array<string|int, CSNote> —a list of notes as CSNote-objects
groupNotesBySubContext()
Grouped a given array by SubContext
public
static groupNotesBySubContext(mixed &$notes) : array<string|int, mixed>
Parameters
- $notes : mixed
Tags
Return values
array<string|int, mixed> —list of badges as CSBadge-Objects
