webCOMAND

Object::delete()

Delete the object and its embedded objects from the repository.

Prototype

boolean delete(array $options = [])

Parameters

  • options - The following options are recognized.
    • OverrideProtected - If TRUE, even protected objects will be removed.  It is highly recommended that this option never be set because it is likely to corrupt the repository and make it unusable and all repository data will likely be lost.
    • SkipContentLog - If TRUE, the content log will not be updated.
    • User - User of record for this delete, which will be recorded in the version log and content log.
    • VersionNotes - String containing a note to apply to this operation in the object's version log.
    • WriteUpdateLog - TRUE by default.  If FALSE, the update log will not be written, which means that listeners will not be notified that the object has changed, including the webCOMAND user interface, which receives notifications via a web socket.

Return

TRUE if the object was removed from the repository successfully.  Otherwise, FALSE.

Example

$repo = \comand::repo();
$object = $repo->get_object_by_oid(123);
$success = $object->delete(['VersionNotes'=>'No longer needed.']);