Ignore:
Timestamp:
Nov 30, 2013 7:30:44 PM (11 years ago)
Author:
anonymous
Message:

added public and private keywords to all properties and methods, changed old classname constructor function to construct, removed more ?> closing tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/lib/Lock.inc.php

    r438 r439  
    3232
    3333    // Configuration of this object.
    34     var $_params = array(
     34    private $_params = array(
    3535        'timeout' => 600,
    3636        'auto_timeout' => 1800,
     
    4444
    4545    // Store lock data from DB.
    46     var $data = array();
     46    private $data = array();
    4747
    4848    // Auth_SQL object from which to access a current user_id.
    49     var $_auth;
     49    private $_auth;
    5050
    5151    /**
     
    5656     * @static
    5757     */
    58     static function &getInstance($auth_object)
     58    public static function &getInstance($auth_object)
    5959    {
    6060        static $instance = null;
     
    7272     * @param mixed  $auth_object  An Auth_SQL or Auth_FILE object.
    7373     */
    74     function Lock($auth_object)
     74    public function __construct($auth_object)
    7575    {
    7676        $app =& App::getInstance();
     
    9595     * @since   26 Aug 2005 17:09:36
    9696     */
    97     function initDB($recreate_db=false)
     97    public function initDB($recreate_db=false)
    9898    {
    9999        $app =& App::getInstance();
     
    142142     * @param  array $params   Array of param keys and values to set.
    143143     */
    144     function setParam($params=null)
     144    public function setParam($params=null)
    145145    {
    146146        if (isset($params) && is_array($params)) {
     
    157157     * @return mixed               Configured parameter value.
    158158     */
    159     function getParam($param)
     159    public function getParam($param)
    160160    {
    161161        $app =& App::getInstance();
     
    178178     * @param string $title       A title to apply to the lock, for display purposes.
    179179     */
    180     function select($record_table_or_lock_id, $record_key=null, $record_val=null)
     180    public function select($record_table_or_lock_id, $record_key=null, $record_val=null)
    181181    {
    182182        $app =& App::getInstance();
     
    219219     * @return bool            True if locked.
    220220     */
    221     function isLocked()
     221    public function isLocked()
    222222    {
    223223        return isset($this->data['lock_id']);
     
    230230     * @return bool            True if current user set the lock.
    231231     */
    232     function isMine()
     232    public function isMine()
    233233    {
    234234        $db =& DB::getInstance();
     
    258258     * @return int            The id for the lock (mysql last insert id).
    259259     */
    260     function set($record_table, $record_key, $record_val, $title='')
     260    public function set($record_table, $record_key, $record_val, $title='')
    261261    {
    262262        $db =& DB::getInstance();
     
    304304     * Unlock the currently selected record.
    305305     */
    306     function remove()
     306    public function remove()
    307307    {
    308308        $app =& App::getInstance();
     
    326326     * Unlock all records, or all records for a specified user.
    327327     */
    328     function removeAll($user_id=null)
     328    public function removeAll($user_id=null)
    329329    {
    330330        $app =& App::getInstance();
     
    350350     * Deletes all locks that are older than auto_timeout.
    351351     */
    352     function _auto_timeout()
     352    private function _auto_timeout()
    353353    {
    354354        $db =& DB::getInstance();
     
    371371     * Redirect to record lock error page.
    372372     */
    373     function dieErrorPage()
     373    public function dieErrorPage()
    374374    {
    375375        $app =& App::getInstance();
     
    381381     * Print error page.
    382382     */
    383     function printErrorHTML()
     383    public function printErrorHTML()
    384384    {
    385385        $app =& App::getInstance();
     
    416416     * Return lock_id of locked record.
    417417     */
    418     function getID()
     418    public function getID()
    419419    {
    420420        return $this->data['lock_id'];
     
    424424     * Return title of locked record.
    425425     */
    426     function getTitle()
     426    public function getTitle()
    427427    {
    428428        return $this->data['title'];
     
    432432     * Return administrator username for locked record.
    433433     */
    434     function getEditor()
     434    public function getEditor()
    435435    {
    436436        return $this->data['editor'];
     
    440440     * Return total seconds since the record was locked.
    441441     */
    442     function getSecondsElapsed()
     442    public function getSecondsElapsed()
    443443    {
    444444        if (isset($this->data['lock_datetime']) && strtotime($this->data['lock_datetime']) < time()) {
Note: See TracChangeset for help on using the changeset viewer.