webCOMAND

cObject::requires_approve()

Called on all objects from the top-level object to be approved down through all embedded child objects recursively, before the objects are approved.  The default behavior is for this method to return FALSE, which indicates that the object should only be approved and updated in the repository if changes were made.  Overriding that default behavior and returning TRUE will cause the object to be approved, even if no changes were made.  This can be useful if an object should always update calculated fields when it's embed parent or children change in a particular way.

Prototype

boolean requires_approve(array $options)

Parameters

  • options - Options that should be passed to parent::approve() if called.

Return

Return TRUE to force approval.  Return FALSE to allow approval, only if the object has been modified.

 

Example

<?php
namespace com_example_www\models;

class Contact extends \io_comand_repo\models\Content {
    public function requires_approve(array $options): bool {
        return true;
    }
}

Related