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

Class: ForwardFW_Object_Sql

Source Location: /Object/Sql.php

Class Overview

ForwardFW_Object
   |
   --ForwardFW_Object_Sql

A object/model that can load themself from DB.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: ForwardFW_Object

ForwardFW_Object::__construct()
Constructur
ForwardFW_Object::loadByArray()
Loads the model data out of an array as data set
ForwardFW_Object::saveToArray()
Saves the model data into an array as data set

Class Details

[line 46]
A object/model that can load themself from DB.



Tags:



[ Top ]


Class Variables

$strDBConnection =  ''

[line 70]

Name of the connection which should be used for this object to load/save.



Tags:

access:  protected

Type:   string


[ Top ]

$strTableName =  ''

[line 54]

Name of the table, which is mostly a prefix and the object name in lowercase.



Tags:

access:  protected

Type:   string


[ Top ]

$strTablePrefix =  ''

[line 62]

Prefix for the table name



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


static method resolveTableName [line 105]

static string resolveTableName( string $_strTablePrefix, string $_strObjectName)

Returns the name of table out of prefix and object name cobined with an underscore and lowercased.



Tags:

return:  The table name.


Parameters:

string   $_strTablePrefix   Prefix der Tabellennamen im Projekt.
string   $_strObjectName   Name of the object

[ Top ]

constructor __construct [line 81]

new __construct( [string $_strIdFieldName = 'ID'], [string $_strTablePrefix = ''], [string $_strDBConnection = 'default'])

constructor



Tags:

return:  instance


Overrides ForwardFW_Object::__construct() (Constructur)

Parameters:

string   $_strIdFieldName   Fieldname which holds the object id.
string   $_strTablePrefix   Prefix der Tabellennamen im Projekt.
string   $_strDBConnection   Name of the DB connection to use.

[ Top ]

method loadByID [line 119]

boolean loadByID( mixed $ID)

Loads a the object from DB by the given ID.



Tags:

return:  True if object was loadable otherwise false.


Parameters:

mixed   $ID   The ID for the object.

[ Top ]

method loadByWhereClause [line 131]

boolean loadByWhereClause( string $strWhereClause)

Loads the object by where clause. Only first hit will be selected.



Tags:

return:  True if object was loadable otherwise false.


Parameters:

string   $strWhereClause   The SQL where clause to search for this object.

[ Top ]

method save [line 155]

boolean save( )

Saves the object to DB. If ID is set, then the DB will be updated. Otherwise an insert statement will create it. The new ID will saved in object.



Tags:

return:  True if object was saveable otherwise false.


[ Top ]


Documentation generated on Sun, 30 Jan 2011 20:46:47 +0100 by phpDocumentor 1.4.3