Back to Grid class

Method checkedOut

public static string
checkedOut
(mixed &$row, mixed $i, mixed $identifier = 'id')
Displays a checked out icon.
Parameters
  • object $row A data object (must contain checked out as a property).
  • int $i The index of the row.
  • string $identifier The property name of the primary key or index of the row.
Returns
  • string
Since
  • 1.5
Class: Grid
Project: Joomla

Method checkedOut - Source code

/**
 * Displays a checked out icon.
 *
 * @param   object   $row         A data object (must contain checked out as a property).
 * @param   integer  $i           The index of the row.
 * @param   string   $identifier  The property name of the primary key or index of the row.
 *
 * @return  string
 *
 * @since   1.5
 */
public static function checkedOut(&$row, $i, $identifier = 'id')
{
    $user = Factory::getUser();
    $userid = $user->get('id');
    if ($row instanceof Table) {
        $result = $row->isCheckedOut($userid);
    } else {
        $result = false;
    }
    if ($result) {
        return static::_checkedOut($row);
    } else {
        if ($identifier === 'id') {
            return HTMLHelper::_('grid.id', $i, $row->{$identifier});
        } else {
            return HTMLHelper::_('grid.id', $i, $row->{$identifier}, $result, $identifier);
        }
    }
}