Back to BaseDatabaseModel class

Method isCheckedOut

public bool
isCheckedOut
(mixed $item)
Method to check if the given record is checked out by the current user
Parameters
  • \stdClass $item The record to check
Returns
  • bool

Method isCheckedOut - Source code

/**
 * Method to check if the given record is checked out by the current user
 *
 * @param   \stdClass  $item  The record to check
 *
 * @return  bool
 */
public function isCheckedOut($item)
{
    $table = $this->getTable();
    $checkedOutField = $table->getColumnAlias('checked_out');
    if (property_exists($item, $checkedOutField) && $item->{$checkedOutField} != Factory::getUser()->id) {
        return true;
    }
    return false;
}