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

Public Member Functions

 __construct ($id=null)
 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 ()

Static Public Member Functions

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

Protected Member Functions

 getTableScheme ()

Static Protected Member Functions

static TableScheme ($db_table)

Protected Attributes

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

Static Protected Attributes

static $schemes

Constructor & Destructor Documentation

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

Reimplemented in StudipNews, Institute, Semester, StudipDocument, StudipComments, StudipScmEntry, SeminarCycleDate, StudipAdmissionGroup, UserConfigEntry, and ConfigEntry.

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 StudipNews, StudipStmInstance, and StudipAdmissionGroup.

Here is the call graph for this function:

static deleteBySQL (   $class,
  $where 
)
static

deletes table rows specified by given class and sql clause

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:

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

Here is the call graph for this function:

Here is the caller graph for this function:

getTableScheme ( )
protected

Here is the caller graph for this function:

getValue (   $field)

returns value of a column

Parameters
string$field
Returns
null|string

Reimplemented in StudipStmInstance, 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

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 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
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 StudipStmInstance, StudipNews, StudipStmInstanceElement, and StudipAdmissionGroup.

Here is the call graph for this function:

Here is the caller graph for this function:

setData (   $data,
  $reset = false 
)

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

Parameters
array$dataassoc array
boolean$reset
Returns
number of columns changed

Reimplemented in StudipNews, StudipAdmissionGroup, SeminarCycleDate, and Semester.

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 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 StudipStmInstance, StudipNews, 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 SeminarCycleDate, and Semester.

Here is the caller graph for this function:

triggerChdate ( )

set chdate column to current timestamp

Returns
boolean

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

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

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