Stud.IP  2.3 Revision 48548
 All Data Structures Namespaces Files Functions Variables Groups Pages
SimpleORMap Class Reference
Inheritance diagram for SimpleORMap:
Inheritance graph
Collaboration diagram for SimpleORMap:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 getTableMetadata ()
 setId ($id)
 getId ()
 getNewId ()
 getData ()
 toArray ()
 getValue ($field)
 setValue ($field, $value)
 __get ($field)
 __set ($field, $value)
 __isset ($field)
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 offsetUnset ($offset)
 getIterator ()
 count ()
 isField ($field)
 setData ($data, $reset=false)
 haveData ()
 isNew ()
 setNew ($is_new)
 getWhereQuery ()
 restore ()
 store ()
 triggerChdate ()
 delete ()
 isDirty ()
 isFieldDirty ($field)
 revertValue ($field)

Static Public Member Functions

static expireTableScheme ()
static find ($class, $id)
static findBySQL ($class, $where)
static deleteBySQL ($class, $where)
static toObject ($class, $id_or_object)

Protected Member Functions

 getTableScheme ()
 initializeContent ()

Static Protected Member Functions

static TableScheme ($db_table)

Protected Attributes

 $content = array()
 $content_db = array()
 $is_new = true
 $db_table = ''
 $db_fields = null
 $pk = null
 $default_values = array()

Static Protected Attributes

static $schemes

Constructor & Destructor Documentation

__construct (   $id = null)
Parameters
string$idprimary key of table

Reimplemented in StudipNews, WebserviceAccessRule, Semester, Institute, LockRule, SemesterHoliday, User, StudipDocument, RoomRequest, StudipComments, StudipScmEntry, SeminarCycleDate, StudipAdmissionGroup, UserConfigEntry, AuthUserMd5, ConfigEntry, and UserInfo.

Here is the call graph for this function:

Member Function Documentation

__get (   $field)

magic method for dynamic properties

Here is the call graph for this function:

__isset (   $field)

magic method for dynamic properties

__set (   $field,
  $value 
)

magic method for dynamic properties

Here is the call graph for this function:

count ( )

Countable

Here is the caller graph for this function:

delete ( )

delete entry from database the object is cleared and turned to new state

Returns
boolean

Reimplemented in RoomRequest, StudipNews, StudipStmInstance, User, SeminarCycleDate, LockRule, StudipAdmissionGroup, and StudipDocument.

Here is the call graph for this function:

static deleteBySQL (   $class,
  $where 
)
static

deletes table rows specified by given class and sql clause should be overridden in subclass to omit $class param

Parameters
string$class
stringsql clause to use on the right side of WHERE
Returns
number

Here is the call graph for this function:

Here is the caller graph for this function:

static expireTableScheme ( )
static

force reload of cached table metadata

Here is the call graph for this function:

static find (   $class,
  $id 
)
static

returns new instance for given class and key when found in db, else null should be overridden in subclass to omit $class param

Parameters
string$class
stringprimary key
Returns
null|NULL
static findBySQL (   $class,
  $where 
)
static

returns array of instances of given class filtered by given sql should be overridden in subclass to omit $class param

Parameters
string$class
stringsql clause to use on the right side of WHERE
Returns
array

Here is the call graph for this function:

Here is the caller graph for this function:

getData ( )

returns data of table row as assoc array or false if no data available

Deprecated:
Returns
array|boolean

Here is the call graph for this function:

getId ( )

returns primary key, false if none is set

Returns
boolean|string|array

Here is the call graph for this function:

Here is the caller graph for this function:

getIterator ( )
getNewId ( )

create new unique pk as md5 hash if pk consists of multiple columns, false is returned

Returns
boolean|string

Reimplemented in WebserviceAccessRule, and User.

Here is the call graph for this function:

Here is the caller graph for this function:

getTableMetadata ( )
getTableScheme ( )
protected

Reimplemented in User.

Here is the caller graph for this function:

getValue (   $field)

returns value of a column

Parameters
string$field
Returns
null|string

Reimplemented in StudipStmInstance, RoomRequest, StudipAdmissionGroup, Institute, StudipStmInstanceElement, and SeminarCycleDate.

Here is the caller graph for this function:

getWhereQuery ( )

returns sql clause with current table and pk

Returns
boolean|string

Reimplemented in User.

Here is the call graph for this function:

Here is the caller graph for this function:

haveData ( )

check if object is empty

Returns
number of columns with values

Here is the caller graph for this function:

initializeContent ( )
protected

init internal content arrays with nulls

Here is the caller graph for this function:

isDirty ( )

checks if at least one field was modified since last restore

Returns
boolean

Here is the call graph for this function:

Here is the caller graph for this function:

isField (   $field)

check if given column exists in table

Parameters
string$field
Returns
boolean
isFieldDirty (   $field)

checks if given field was modified since last restore

Parameters
string$field
Returns
boolean

Here is the caller graph for this function:

isNew ( )

check if object exists in database

Returns
boolean

Here is the caller graph for this function:

offsetExists (   $offset)

ArrayAccess: Check whether the given offset exists.

offsetGet (   $offset)

ArrayAccess: Get the value at the given offset.

offsetSet (   $offset,
  $value 
)

ArrayAccess: Set the value at the given offset.

offsetUnset (   $offset)

ArrayAccess: unset the value at the given offset (not applicable)

restore ( )

restore entry from database

Returns
boolean

Reimplemented in RoomRequest, StudipStmInstance, StudipNews, User, StudipStmInstanceElement, and StudipAdmissionGroup.

Here is the call graph for this function:

Here is the caller graph for this function:

revertValue (   $field)

reverts value of given field to last restored value

Parameters
string$field
Returns
mixed the restored value
setData (   $data,
  $reset = false 
)

set multiple column values if second param is set, existing data in object will be discarded and dirty state is cleared, else new data overrides old data

Parameters
array$dataassoc array
boolean$resetexisting data in object will be discarded
Returns
number of columns changed

Reimplemented in StudipNews, WebserviceAccessRule, StudipAdmissionGroup, SeminarCycleDate, User, Semester, and LockRule.

Here is the call graph for this function:

Here is the caller graph for this function:

setId (   $id)

set primary key for entry, combined keys must be passed as array

Parameters
string|arrayprimary key
Exceptions
Exception
Returns
boolean

Here is the call graph for this function:

Here is the caller graph for this function:

setNew (   $is_new)

set object to new state

Parameters
boolean$is_new
Returns
boolean

Here is the caller graph for this function:

setValue (   $field,
  $value 
)

sets value of a column

Parameters
string$field
string$value
Returns
string

Reimplemented in RoomRequest, WebserviceAccessRule, and SeminarCycleDate.

Here is the caller graph for this function:

store ( )

store entry in database if data is actually changed triggerChdate() is called

Returns
number|boolean

Reimplemented in RoomRequest, StudipStmInstance, StudipNews, User, LockRule, and StudipAdmissionGroup.

Here is the call graph for this function:

static TableScheme (   $db_table)
staticprotected

fetch table metadata from db ro from local cache

Parameters
string$db_table

Here is the call graph for this function:

toArray ( )

returns data of table row as assoc array

Returns
array

Reimplemented in RoomRequest, SeminarCycleDate, and Semester.

Here is the caller graph for this function:

static toObject (   $class,
  $id_or_object 
)
static

returns object of given class for given id or null the param could be a string, an assoc array containing primary key field or an already matching object. In all these cases an object is returned should be overridden in subclass to omit $class param

Parameters
string$class
mixedid as string, object or assoc array
Returns
NULL|object

Here is the call graph for this function:

triggerChdate ( )

set chdate column to current timestamp

Returns
boolean

Reimplemented in User.

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$content = array()
protected
$content_db = array()
protected
$db_fields = null
protected
$db_table = ''
protected
$default_values = array()
protected
$is_new = true
protected
$pk = null
protected
$schemes
staticprotected

The documentation for this class was generated from the following file: