You are here

function UserpointsTransaction::isReadOnly in User Points 7.2

Checks if a change is allowed.

Once a transaction is saved and either approved or declined, no alterations of the data is allowed except marking it as expired.

Parameters

$only_new: If TRUE, only allows changes if this transaction is new. Defaults to FALSE.

Return value

TRUE if changes are allowed, FALSE if not.

1 call to UserpointsTransaction::isReadOnly()
UserpointsTransaction::checkChange in ./userpoints.transaction.inc
Checks if a change is allowed.

File

./userpoints.transaction.inc, line 813
Contains the UserpointsTransaction and related classes.

Class

UserpointsTransaction
A Userpoints transaction.

Code

function isReadOnly($only_new = FALSE) {
  if (!empty($this->txn_id)) {
    if ($only_new) {
      return TRUE;
    }
    if ($this->orig_status !== NULL && $this->orig_status != UserpointsTransaction::STATUS_PENDING) {
      return TRUE;
    }
  }
  return FALSE;
}