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

Class: KDatabaseRowAbstract

Source Location: /libraries/koowa/database/row/abstract.php

Class Overview

KObject
   |
   --KObjectArray
      |
      --KDatabaseRowAbstract

Abstract Row Class


Author(s):

Implements interfaces:

Variables

Methods


Child classes:

KDatabaseRowTable
Table Row Class

Inherited Variables

Inherited Methods

Class: KObjectArray

KObjectArray::__construct()
Constructor
KObjectArray::getIterator()
Get a new iterator
KObjectArray::offsetExists()
Check if the offset exists
KObjectArray::offsetGet()
Get an item from the array by offset
KObjectArray::offsetSet()
Set an item in the array
KObjectArray::offsetUnset()
Unset an item in the array
KObjectArray::serialize()
Serialize
KObjectArray::toArray()
Return an associative array of the data
KObjectArray::unserialize()
Unserialize
KObjectArray::_initialize()
Initializes the options for the object
KObjectArray::__get()
Get a value by key
KObjectArray::__isset()
Test existence of a key
KObjectArray::__set()
Set a value by key
KObjectArray::__unset()
Unset a key

Class: KObject

KObject::__construct()
Constructor
KObject::get()
Get the object properties
KObject::getHandle()
Get a handle for this object
KObject::getIdentifier()
Gets the service identifier.
KObject::getMethods()
Get a list of all the available methods
KObject::getService()
Get an instance of a class based on a class identifier only creating it if it does not exist yet.
KObject::inherits()
Checks if the object or one of it's mixin's inherits from a class.
KObject::mixin()
Mixin an object
KObject::set()
Set the object properties
KObject::_initialize()
Initializes the options for the object
KObject::__call()
Search the mixin method map and call the method or trigger an error
KObject::__clone()
Preform a deep clone of the object.

Class Details

[line 18]
Abstract Row Class



Tags:

author:  Johan Janssens <johan@nooku.org>
abstract:  


[ Top ]


Class Variables

$_identity_column =

[line 57]

Name of the identity column in the rowset



Tags:

access:  protected

Type:   string


[ Top ]

$_modified = array()

[line 26]

Tracks columns where data has been updated. Allows more specific save operations.



Tags:

access:  protected

Type:   array


[ Top ]

$_new =  true

[line 50]

Tracks if row data is new



Tags:

access:  protected

Type:   bool


[ Top ]

$_status =  null

[line 36]

Tracks the status the row

Available row status values are defined as STATUS_ constants in KDatabase




Tags:

see:  KDatabase
access:  protected

Type:   string


[ Top ]

$_status_message =  ''

[line 43]

The status message



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 64]

KDatabaseRowAbstract __construct( [ $config = null])

Constructor



Tags:

access:  public


Overridden in child classes as:

KDatabaseRowTable::__construct()
Object constructor

Overrides KObjectArray::__construct() (Constructor)

Parameters:

object An   $config   optional KConfig object with configuration options.

[ Top ]

method count [line 286]

integer count( )

Count the rows in the database based on the data in the row



Tags:

access:  public


Overridden in child classes as:

KDatabaseRowTable::count()
Count the rows in the database based on the data in the row


Implementation of:
KDatabaseRowInterface::count()
Count the rows in the database based on the data in the row
[ Top ]

method delete [line 263]

boolean delete( )

Deletes the row form the database.



Tags:

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


Overridden in child classes as:

KDatabaseRowTable::delete()
Deletes the row form the database.


Implementation of:
KDatabaseRowInterface::delete()
Deletes the row form the database.
[ Top ]

method getData [line 135]

array getData( [boolean $modified = false])

Returns an associative array of the raw data



Tags:

access:  public



Implementation of:
KDatabaseRowInterface::getData()
Returns an associative array of the raw data

Parameters:

boolean   $modified   If TRUE, only return the modified data. Default FALSE

[ Top ]

method getIdentityColumn [line 330]

string getIdentityColumn( )

Gets the identitiy column of the rowset



Tags:

access:  public


[ Top ]

method getModified [line 340]

array getModified( )

Get a list of columns that have been modified



Tags:

return:  An array of column names that have been modified
access:  public



Implementation of:
KDatabaseRowInterface::getModified()
Get a list of columns that have been modified
[ Top ]

method getStatus [line 181]

string getStatus( )

Returns the status



Tags:

return:  The status
access:  public



Implementation of:
KDatabaseRowInterface::getStatus()
Returns the status of this row.
[ Top ]

method getStatusMessage [line 213]

string getStatusMessage( )

Returns the status message



Tags:

return:  The status message
access:  public


[ Top ]

method isConnected [line 124]

boolean isConnected( )

Test the connected status of the row.



Tags:

return:  Returns TRUE by default.
access:  public


Overridden in child classes as:

KDatabaseRowTable::isConnected()
Test the connected status of the row.


Implementation of:
KDatabaseRowInterface::isConnected()
Test the connected status of the row.
[ Top ]

method isModified [line 351]

boolean isModified( string $column)

Check if a column has been modified



Tags:

access:  public



Implementation of:
KDatabaseRowInterface::isModified()
Check if a column has been modified

Parameters:

string   $column   The column name.

[ Top ]

method isNew [line 366]

bool isNew( )

Checks if the row is new or not



Tags:

access:  public



Implementation of:
KDatabaseRowInterface::isNew()
Checks if the row is new or not
[ Top ]

method load [line 236]

object If load( )

Load the row from the database.



Tags:

return:  successfull returns the row object, otherwise NULL
access:  public


Overridden in child classes as:

KDatabaseRowTable::load()
Load the row from the database using the data in the row


Implementation of:
KDatabaseRowInterface::load()
Load the row from the database.
[ Top ]

method reset [line 273]

boolean reset( )

Resets to the default properties



Tags:

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


Overridden in child classes as:

KDatabaseRowTable::reset()
Reset the row data using the defaults


Implementation of:
KDatabaseRowInterface::reset()
Resets to the default properties
[ Top ]

method save [line 251]

boolean save( )

Saves the row to the database.

This performs an intelligent insert/update and reloads the properties with fresh data from the table on success.




Tags:

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


Overridden in child classes as:

KDatabaseRowTable::save()
Saves the row to the database.


Implementation of:
KDatabaseRowInterface::save()
Saves the row to the database.
[ Top ]

method setData [line 154]

KDatabaseRowAbstract setData( mixed $data, [boolean $modified = true])

Set the row data



Tags:

access:  public



Implementation of:
KDatabaseRowInterface::setData()
Set the row data

Parameters:

mixed   $data   Either and associative array, an object or a KDatabaseRow
boolean   $modified   If TRUE, update the modified information for each column being set. Default TRUE

[ Top ]

method setStatus [line 192]

KDatabaseRowAbstract setStatus( string|null $status)

Set the status



Tags:

access:  public


Parameters:

string|null   $status   The status value or NULL to reset the status

[ Top ]

method setStatusMessage [line 225]

KDatabaseRowAbstract setStatusMessage( string $message)

Set the status message



Tags:

access:  public


Parameters:

string   $message   The status message

[ Top ]

method _initialize [line 106]

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:

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

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

Parameters:

object An   $config   optional KConfig object with configuration options.

[ Top ]

method __call [line 383]

mixed __call( string $method, array $arguments)

Search the mixin method map and call the method or trigger an error

Function is also capable of checking is a behavior has been mixed succesfully using is[Behavior] function. If the behavior exists the function will return TRUE, otherwise FALSE.




Tags:

return:  The result of the function
throws:  BadMethodCallException If method could not be found
access:  public


Overridden in child classes as:

KDatabaseRowTable::__call()
Search the mixin method map and call the method or trigger an error

Overrides KObject::__call() (Search the mixin method map and call the method or trigger an error)

Parameters:

string   $method   The function name
array   $arguments   The function arguments

[ Top ]

method __set [line 302]

void __set( string $column, mixed $value)

Set row field value

If the value is the same as the current value and the row is loaded from the database the value will not be reset. If the row is new the value will be (re)set and marked as modified




Tags:

access:  public


Overrides KObjectArray::__set() (Set a value by key)

Parameters:

string   $column   The column name.
mixed   $value   The value for the property.

[ Top ]

method __unset [line 318]

void __unset( string $column)

Unset a row field



Tags:

access:  public


Overridden in child classes as:

KDatabaseRowTable::__unset()
Unset a row field

Overrides KObjectArray::__unset() (Unset a key)

Parameters:

string   $column   The column name.

[ Top ]


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