Koowa_Database
[ class tree: Koowa_Database ] [ index: Koowa_Database ] [ all elements ]

Class: KDatabaseBehaviorLockable

Source Location: /libraries/koowa/database/behavior/lockable.php

Class Overview

KMixinAbstract
   |
   --KBehaviorAbstract
      |
      --KDatabaseBehaviorAbstract
         |
         --KDatabaseBehaviorLockable

Database Lockable Behavior


Author(s):

Variables

Methods


Child classes:

Database Lockable Behavior

Inherited Variables

Inherited Methods

Class: KDatabaseBehaviorAbstract

KDatabaseBehaviorAbstract::delete()
Deletes the row form the database.
KDatabaseBehaviorAbstract::execute()
Command handler
KDatabaseBehaviorAbstract::getMixableMethods()
Get the methods that are available for mixin based
KDatabaseBehaviorAbstract::save()
Saves the row or rowset in the database.

Class: KBehaviorAbstract

KBehaviorAbstract::__construct()
Constructor.
KBehaviorAbstract::execute()
Command handler
KBehaviorAbstract::getHandle()
Get an object handle
KBehaviorAbstract::getIdentifier()
Gets the service identifier.
KBehaviorAbstract::getMixableMethods()
Get the methods that are available for mixin based
KBehaviorAbstract::getPriority()
Get the priority of a behavior
KBehaviorAbstract::getService()
Get an instance of a class based on a class identifier only creating it if it doesn't exist yet.
KBehaviorAbstract::_initialize()
Initializes the options for the object

Class: KMixinAbstract

KMixinAbstract::__construct()
Object constructor
KMixinAbstract::getHandle()
Get a handle for this object
KMixinAbstract::getMethods()
Get a list of all the available methods
KMixinAbstract::getMixableMethods()
Get the methods that are available for mixin.
KMixinAbstract::getMixer()
Get the mixer object
KMixinAbstract::setMixer()
Set the mixer object
KMixinAbstract::_initialize()
Initializes the options for the object
KMixinAbstract::__call()
Search the mixin method map and call the method or trigger an error
KMixinAbstract::__get()
Overloaded get function
KMixinAbstract::__isset()
Overloaded isset function
KMixinAbstract::__set()
Overloaded set function
KMixinAbstract::__unset()
Overloaded isset function

Class Details

[line 17]
Database Lockable Behavior



Tags:

author:  Johan Janssens <johan@nooku.org>


[ Top ]


Class Variables

$_lifetime =

[line 24]

The lock lifetime



Tags:

access:  protected

Type:   integer


[ Top ]



Class Methods


method getMixableMethods [line 55]

array getMixableMethods( [ $mixer = null])

Get the methods that are available for mixin based

This function conditionaly mixies the behavior. Only if the mixer has a 'locked_by' property the behavior will be mixed in.




Tags:

return:  An array of methods
access:  public


Overrides KDatabaseBehaviorAbstract::getMixableMethods() (Get the methods that are available for mixin based)

Parameters:

object The   $mixer   mixer requesting the mixable methods.

[ Top ]

method lock [line 73]

boolean lock( )

Lock a row

Requires an 'locked_on' and 'locked_by' column




Tags:

return:  If successfull return TRUE, otherwise FALSE
access:  public


[ Top ]

method locked [line 114]

boolean locked( )

Checks if a row is locked



Tags:

return:  If the row is locked TRUE, otherwise FALSE
access:  public


[ Top ]

method lockMessage [line 143]

string lockMessage( )

Get the locked information



Tags:

return:  The locked information as an internationalised string
access:  public


[ Top ]

method unlock [line 93]

boolean unlock( )

Unlock a row

Requires an locked_on and locked_by column to be present in the table




Tags:

return:  If successfull return TRUE, otherwise FALSE
access:  public


[ Top ]

method _beforeTableDelete [line 181]

boolean _beforeTableDelete( $context)

Checks if a row can be deleted

This function determines if a row can be deleted based on it's locked_by information. If a row is locked, and not by the logged in user, the function will return false, otherwise it will return true




Tags:

return:  True if row can be deleted, false otherwise
access:  protected


Parameters:

KCommandContext   $context  

[ Top ]

method _beforeTableUpdate [line 167]

boolean _beforeTableUpdate( $context)

Checks if a row can be updated

This function determines if a row can be updated based on it's locked_by information. If a row is locked, and not by the logged in user, the function will return false, otherwise it will return true




Tags:

return:  True if row can be updated, false otherwise
access:  protected


Parameters:

KCommandContext   $context  

[ Top ]

method _initialize [line 34]

void _initialize( $config)

Initializes the options for the object

Called from __construct() as a first step of object instantiation.




Tags:

access:  protected


Overridden in child classes as:

ComDefaultDatabaseBehaviorLockable::_initialize()
Initializes the options for the object

Overrides KBehaviorAbstract::_initialize() (Initializes the options for the object)

Parameters:

object An   $config   optional KConfig object with configuration options

[ Top ]


Documentation generated on Mon, 20 May 2013 03:03:01 +0200 by phpDocumentor 1.4.3