Stud.IP  trunk Revision
SimpleORMap Class Reference

Inherits ArrayAccess, Countable, and IteratorAggregate.

Inherited by AdmissionApplication, AdmissionRuleCompatibility, ArchivedCourse, ArchivedCourseMember, AuthUserMd5, AuxLockRule, Banner, CalendarEvent, CalendarUser, ConfigEntry, ConfigValue, ConsultationBlock, ConsultationBooking, ConsultationSlot, Contact, ContentTermsOfUse, Course, CourseDate, CourseExDate, CourseMember, CourseTopic, CourseWizardStepRegistry, CronjobLog, CronjobSchedule, CronjobTask, DataField, DatafieldEntryModel, Degree, Deputy, Assignment, AssignmentRange, Attempt, Response, Task, Test, TestTask, EventData, File, FileRef, FileURL, Folder, Definition, Instance, HelpContent, HelpTour, HelpTourAudience, HelpTourSettings, HelpTourStep, HelpTourUser, Institute, InstituteMember, Kategorie, LockRule, LogAction, LogEvent, LoginBackground, LtiData, LtiGrade, LtiTool, MailQueueEntry, Message, MessageUser, ModuleManagementModel, NewsRange, OpenGraphURL, PersonalNotifications, PersonalNotificationsUser, PluginAsset, Questionnaire, QuestionnaireAnonymousAnswer, QuestionnaireAnswer, QuestionnaireAssignment, QuestionnaireQuestion, ResourceAssignment, Base, RoomRequest, Semester, SemesterHoliday, SeminarCycleDate, Statusgruppen, StatusgruppeUser, StudipCacheOperation, StudipComment, StudipEvaluation, StudipNews, StudipScmEntry, StudipStudyArea, StudyCourse, TFASecret, TFAToken, Token, User_Visibility_Settings, UserInfo, UserOnline, UserStudyCourse, WebserviceAccessRule, Container, Element, Widget, WikiPage, and WikiPageConfig.

Collaboration diagram for SimpleORMap:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 getDefaultValue ($field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 isI18nField ($field)
 
 setData ($data, $reset=false)
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
 cleanup ()
 

Static Public Member Functions

static tableScheme ($db_table)
 
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=[])
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=[])
 
static findOneBySQL ($where, $params=[])
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=[])
 
static findMany ($pks=[], $order='', $order_params=[])
 
static findEachMany ($callable, $pks=[], $order='', $order_params=[])
 
static findAndMapBySQL ($callable, $where, $params=[])
 
static findAndMapMany ($callable, $pks=[], $order='', $order_params=[])
 
static deleteBySQL ($where, $params=[])
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 

Data Fields

const ID_SEPARATOR = '_'
 

Static Public Attributes

static $schemes = null
 

Protected Member Functions

 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
 cbI18N ($type)
 

Static Protected Member Functions

static configure ($config=[])
 
static config ($key)
 

Protected Attributes

 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = []
 
 $serialized_fields = []
 
 $alias_fields = []
 
 $i18n_fields = []
 
 $additional_fields = []
 
 $relations = []
 
 $has_many = []
 
 $has_one = []
 
 $belongs_to = []
 
 $has_and_belongs_to_many = []
 
 $registered_callbacks = []
 
 $known_slots = []
 
 $notification_map = []
 
 $additional_data = []
 
 $getter_setter_map = []
 

Static Protected Attributes

static $config = []
 
static $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id = null)

constructor, give primary key of record as param to fetch corresponding record from db if available, if not preset primary key with given value. Give null to create new record

Parameters
mixed$idprimary key of table
Here is the call graph for this function:

Member Function Documentation

◆ __callStatic()

static __callStatic (   $name,
  $arguments 
)
static

interceptor for static findByColumn / findEachByColumn / countByColumn / deleteByColumn magic

Parameters
string$name
array$arguments
Exceptions
BadMethodCallException
Returns
mixed

◆ __clone()

__clone ( )

clean up references after cloning

◆ __get()

__get (   $field)

magic method for dynamic properties

Here is the call graph for this function:

◆ __isset()

__isset (   $field)

magic method for dynamic properties

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __set()

__set (   $field,
  $value 
)

magic method for dynamic properties

Here is the call graph for this function:

◆ _getAdditionalValue()

_getAdditionalValue (   $field)
protected
Parameters
string$field
Returns
multitype:

◆ _getAdditionalValueFromRelation()

_getAdditionalValueFromRelation (   $field)
protected

retrieves an additional field value from relation

Parameters
string$field
Returns
multitype:
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _getId()

_getId (   $field)
protected

returns internal used id value (multiple keys concatenated with _)

Here is the call graph for this function:

◆ _setAdditionalValue()

_setAdditionalValue (   $field,
  $value 
)
protected
Parameters
string$field
mixed$value
Returns
multitype:
Here is the caller graph for this function:

◆ _setAdditionalValueFromRelation()

_setAdditionalValueFromRelation (   $field,
  $value 
)
protected

sets additional value in field imported from relation

Parameters
string$field
mixed$value
Returns
multitype:
Here is the call graph for this function:

◆ _setId()

_setId (   $field,
  $value 
)
protected

sets internal used id value (multiple keys concatenated with _)

Parameters
string$fieldField to set (unused since it's always the id)
string$valueValue for id field
Here is the call graph for this function:

◆ applyCallbacks()

applyCallbacks (   $type)
protected

invoke registered callbacks for given type if one callback returns false the following will not be invoked

Parameters
string$typetype of callback
Returns
bool return value from last callback
Here is the caller graph for this function:

◆ build()

static build (   $data,
  $is_new = true 
)
static

build object with given data

Parameters
array$dataassoc array of record
bool$is_newset object to new state
Returns
static
Here is the caller graph for this function:

◆ buildExisting()

static buildExisting (   $data)
static

build object with given data and mark it as existing

Parameters
$dataarray assoc array of record
Returns
static
Here is the caller graph for this function:

◆ cbAfterInitialize()

cbAfterInitialize (   $cb_type)
protected

default callback used to map specific callbacks to NotificationCenter

Parameters
string$cb_typecallback type
Returns
boolean

◆ cbAutoIncrementColumn()

cbAutoIncrementColumn (   $type)
protected

default callback for tables with auto_increment primary key

Parameters
string$typecallback type
Returns
boolean
Here is the call graph for this function:

◆ cbAutoKeyCreation()

cbAutoKeyCreation ( )
protected

default callback for tables without auto_increment

Here is the call graph for this function:

◆ cbI18N()

cbI18N (   $type)
protected

default callback for tables with I18N fields

Parameters
$type
Returns
bool
Here is the call graph for this function:

◆ cbNotificationMapper()

cbNotificationMapper (   $cb_type)
protected

default callback used to map specific callbacks to NotificationCenter

Parameters
string$cb_typecallback type
Returns
boolean
Here is the call graph for this function:

◆ cleanup()

cleanup ( )

Cleans up this object. This essentially reset all relations of this object and marks them as unused so that the garbage collector may remove the objects.

Use this function when you ran into memory problems and need to free some memory;

Here is the call graph for this function:

◆ config()

static config (   $key)
staticprotected

fetch config data for the called class

Parameters
string$keyconfig key
Returns
string value of config key (null if not set)
Here is the caller graph for this function:

◆ configure()

static configure (   $config = [])
staticprotected

set configuration data from subclass

Parameters
array$configconfiguration data
Returns
void
Here is the call graph for this function:

◆ count()

count ( )

Countable

Here is the caller graph for this function:

◆ countBySql()

static countBySql (   $sql = 1,
  $params = [] 
)
static

returns number of records

Parameters
stringsql clause to use on the right side of WHERE
arrayparams for query
Returns
number
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

static create (   $data)
static

creates new record with given data in db returns the new object or null

Parameters
array$dataassoc array of record
Returns
SimpleORMap
Here is the caller graph for this function:

◆ delete()

delete ( )

delete entry from database the object is cleared, but is not(!) turned to new state

Returns
int number of deleted rows
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteBySQL()

static deleteBySQL (   $where,
  $params = [] 
)
static

deletes objects specified by sql clause

Parameters
string$wheresql clause to use on the right side of WHERE
array$paramsparameters for query
Returns
number
Here is the caller graph for this function:

◆ deleteRelations()

deleteRelations ( )
protected

sends a delete message to all related objects if a relation has a callback for 'on_delete' configured, the callback is invoked instead

Returns
number addition of all return values, false if none was called
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exists()

static exists (   $id)
static

returns true if given key exists in db

Parameters
stringprimary key
Returns
boolean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ expireTableScheme()

static expireTableScheme ( )
static

force reload of cached table metadata

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

static find (   $id)
static

returns new instance for given key when found in db, else null

Parameters
stringprimary key
Returns
SimpleORMap|NULL

◆ findAndMapBySQL()

static findAndMapBySQL (   $callable,
  $where,
  $params = [] 
)
static

passes objects for given sql through given callback and returns an array of callback return values

Parameters
callable$callablecallback which gets the current record as param
stringwhere clause of sql
arraysql statement parameters
Returns
array return values of callback
Here is the caller graph for this function:

◆ findAndMapMany()

static findAndMapMany (   $callable,
  $pks = [],
  $order = '',
  $order_params = [] 
)
static

passes objects for by given pks through given callback and returns an array of callback return values

Parameters
callable$callablecallback which gets the current record as param
array$pksarray of primary keys of called class
string$orderorder by sql
Returns
array return values of callback
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findBySQL()

static findBySQL (   $sql,
  $params = [] 
)
static

returns array of instances of given class filtered by given sql

Parameters
stringsql clause to use on the right side of WHERE
arrayparameters for query
Returns
array array of "self" objects
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEachBySQL()

static findEachBySQL (   $callable,
  $sql,
  $params = [] 
)
static

passes objects for given sql through given callback

Parameters
callable$callablecallback which gets the current record as param
stringwhere clause of sql
arraysql statement parameters
Returns
integer number of found records
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findEachMany()

static findEachMany (   $callable,
  $pks = [],
  $order = '',
  $order_params = [] 
)
static

passes objects for by given pks through given callback

Parameters
callable$callablecallback which gets the current record as param
array$pksarray of primary keys of called class
string$orderorder by sql
Returns
integer number of found records
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMany()

static findMany (   $pks = [],
  $order = '',
  $order_params = [] 
)
static

returns array of instances of given class for by given pks

Parameters
arrayarray og primary keys
stringorder by clause
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findOneBySQL()

static findOneBySQL (   $where,
  $params = [] 
)
static

returns one instance of given class filtered by given sql only first row of query is used

Parameters
stringsql clause to use on the right side of WHERE
arrayparameters for query
Returns
SimpleORMap|NULL
Here is the caller graph for this function:

◆ findThru()

static findThru (   $foreign_key_value,
  $options 
)
static

find related records for a n:m relation (has_many_and_belongs_to_many) using a combination table holding the keys

Parameters
stringvalue of foreign key to find related records
arrayrelation options from other side of relation
Returns
array of "self" objects
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultValue()

getDefaultValue (   $field)

returns default value for column

Parameters
string$fieldname of column
Returns
mixed the default value
Here is the caller graph for this function:

◆ getId()

getId ( )

returns primary key, multiple keys as array

Returns
string|array current primary key, null if not set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIterator()

getIterator ( )

IteratorAggregate

Here is the call graph for this function:

◆ getNewId()

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:

◆ getPristineValue()

getPristineValue (   $field)

returns unmodified value of given field

Parameters
string$field
Exceptions
InvalidArgumentException
Returns
mixed
Here is the caller graph for this function:

◆ getRelationOptions()

getRelationOptions (   $relation)

returns array with option for given relation available options: 'type': relation type, on of 'has_many', 'belongs_to', 'has_one', 'has_and_belongs_to_many' 'class_name': name of class for related records 'foreign_key': name of column with foreign key or callback to retrieve foreign key value 'assoc_foreign_key': name of foreign key column in related class 'assoc_func': name of static method to call on related class to find related records 'assoc_func_params_func': callback to retrieve params for assoc_func 'thru_table': name of relation table for n:m relation 'thru_key': name of column holding foreign key in relation table 'thru_assoc_key': name of column holding foreign key from related class in relation table 'on_delete': contains simply 'delete' to indicate that related records should be deleted or callback to invoke before record gets deleted 'on_store': contains simply 'store' to indicate that related records should be stored or callback to invoke after record gets stored

Parameters
string$relationname of relation
Returns
array assoc array containing options
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRelationValue()

getRelationValue (   $relation,
  $field 
)

gets a value from a related object only possible, if the relation has cardinality 1 e.g. 'has_one' or 'belongs_to'

Parameters
string$relationname of relation
string$fieldname of column
Exceptions
InvalidArgumentExceptionif no relation with given name is found
Returns
mixed the value from the related object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTableMetadata()

getTableMetadata ( )

returns table and columns metadata

Returns
array assoc array with columns, primary keys and name of table

◆ getValue()

getValue (   $field)

returns value of a column

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif getter for additional field could not be found
Parameters
string$field
Returns
null|string|SimpleORMapCollection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWhereQuery()

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:

◆ hasAutoIncrementColumn()

hasAutoIncrementColumn ( )

returns true, if table has an auto_increment column

Returns
boolean

◆ import()

static import (   $data)
static

generate SimpleORMap object structure from assoc array if given array contains data of related objects in sub-arrays they are also generated. Existing records are updated, new records are created (but changes are not yet stored)

Parameters
array$data
Returns
static
Here is the caller graph for this function:

◆ initializeContent()

initializeContent ( )
protected

init internal content arrays with nulls or defaults

Exceptions
UnexpectedValueExceptionif there is an unmatched alias
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initRelation()

initRelation (   $relation)

intitalize a relationship and get related record(s)

Parameters
string$relationname of relation
Exceptions
InvalidArgumentExceptionif the relation does not exists
Returns
void
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAdditionalField()

isAdditionalField (   $field)

check if given column is additional

Parameters
string$field
Returns
boolean

◆ isAliasField()

isAliasField (   $field)

check if given column is an alias

Parameters
string$field
Returns
boolean

◆ isDeleted()

isDeleted ( )

check if object was deleted

Returns
boolean
Here is the caller graph for this function:

◆ isDirty()

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()

isField (   $field)

check if given column exists in table

Parameters
string$field
Returns
boolean
Here is the caller graph for this function:

◆ isFieldDirty()

isFieldDirty (   $field)

checks if given field was modified since last restore

Parameters
string$field
Returns
boolean
Here is the caller graph for this function:

◆ isI18nField()

isI18nField (   $field)

check if given column is a multi-language field

Parameters
string$field
Returns
boolean
Here is the caller graph for this function:

◆ isNew()

isNew ( )

check if object exists in database

Returns
boolean
Here is the caller graph for this function:

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess: Check whether the given offset exists.

Here is the call graph for this function:

◆ offsetGet()

offsetGet (   $offset)

ArrayAccess: Get the value at the given offset.

Here is the call graph for this function:

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

ArrayAccess: Set the value at the given offset.

Here is the call graph for this function:

◆ offsetUnset()

offsetUnset (   $offset)

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

◆ parseRelationOptions()

parseRelationOptions (   $type,
  $name,
  $options 
)
protected

try to determine all needed options for a relationship from configured options

Parameters
string$type
string$name
array$options
Exceptions
Exceptionif options for thru_table could not be determined
Returns
array
Here is the caller graph for this function:

◆ registerCallback()

registerCallback (   $types,
  $cb 
)
protected

register given callback for one or many possible callback types callback param could be a closure or method name of current class

Parameters
string | array$typestypes to register callback for
mixed$cbcallback
Exceptions
InvalidArgumentExceptionif the callback type is not known
Returns
number of registered callbacks
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetRelation()

resetRelation (   $relation)

clear data for a relationship

Parameters
string$relationname of relation
Exceptions
InvalidArgumentExceptionif teh relation does not exists
Here is the caller graph for this function:

◆ restore()

restore ( )

restore entry from database

Returns
boolean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ revertValue()

revertValue (   $field)

reverts value of given field to last restored value

Parameters
string$field
Returns
mixed the restored value
Here is the caller graph for this function:

◆ setData()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setI18nValue()

setI18nValue (   $field,
  $value 
)
protected

default setter used to proxy I18N fields with I18NString

Parameters
string$fieldcolumn name
mixed$valuevalue
Returns
mixed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setId()

setId (   $id)

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

Parameters
string|arrayprimary key
Exceptions
InvalidArgumentExceptionif given key is not complete
Returns
boolean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNew()

setNew (   $is_new)

set object to new state

Parameters
boolean$is_new
Returns
boolean
Here is the caller graph for this function:

◆ setSerializedValue()

setSerializedValue (   $field,
  $value 
)
protected

default setter used to proxy serialized fields with ArrayObjects

Parameters
string$fieldcolumn name
mixed$valuevalue
Returns
mixed
Here is the caller graph for this function:

◆ setValue()

setValue (   $field,
  $value 
)

sets value of a column

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif setter for additional field could not be found
Parameters
string$field
string$value
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ store()

store ( )

store entry in database

Exceptions
UnexpectedValueExceptionif there are forbidden NULL values
Returns
number|boolean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeRelations()

storeRelations (   $only_these = null)
protected

sends a store message to all initialized related objects if a relation has a callback for 'on_store' configured, the callback is instead invoked

Returns
number addition of all return values, false if none was called
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tableScheme()

static tableScheme (   $db_table)
static

fetch table metadata from db or from local cache

Parameters
string$db_table
Returns
bool true if metadata could be fetched
Here is the call graph for this function:

◆ toArray()

toArray (   $only_these_fields = null)

returns data of table row as assoc array pass array of fieldnames or ws separated string to limit fields

Parameters
mixed$only_these_fieldslimit returned fields
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toArrayRecursive()

toArrayRecursive (   $only_these_fields = null)

returns data of table row as assoc array including related records with a 'has*' relationship recurses one level without param

$only_these_fields limits output for relationships in this way: $only_these_fields = array('field_1', 'field_2', 'relation1', 'relation2' => array('rel2_f1', 'rel2_f2', 'rel2_rel11' => array( rel2_rel1_f1) ) ) Here all fields of relation1 will be returned.

Parameters
mixed$only_these_fieldslimit returned fields
Returns
array
Here is the call graph for this function:

◆ toObject()

static toObject (   $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

Parameters
mixed$id_or_objectid as string, object or assoc array
Returns
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toRawArray()

toRawArray (   $only_these_fields = null)

Returns data of table row as assoc array with raw contents like they are in the database. Pass array of fieldnames or ws separated string to limit fields.

Parameters
mixed$only_these_fields
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ triggerChdate()

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:

◆ unregisterCallback()

unregisterCallback (   $types,
  $cb 
)
protected

unregister given callback for one or many possible callback types

Parameters
string | array$typestypes to unregister callback for
mixed$cb
Exceptions
InvalidArgumentExceptionif the callback type is not known
Returns
number of unregistered callbacks
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $additional_data

array $additional_data = []
protected

assoc array for storing values for additional fields

◆ $additional_fields

array $additional_fields = []
protected

additional computed fields name => callable

◆ $alias_fields

array $alias_fields = []
protected

aliases for columns alias => column

◆ $belongs_to

array $belongs_to = []
protected

n:1 relations

◆ $config

array $config = []
staticprotected

configuration data for subclasses

See also
self::configure()

◆ $content

array $content = []
protected

table row data

◆ $content_db

array $content_db = []
protected

table row data

◆ $db_fields

array $db_fields = null
protected

table columns

◆ $db_table

string $db_table = ''
protected

name of db table

◆ $default_values

array $default_values = []
protected

default values for columns

◆ $getter_setter_map

array $getter_setter_map = []
protected

assoc array for mapping get/set Methods

◆ $has_and_belongs_to_many

array $has_and_belongs_to_many = []
protected

n:m relations

◆ $has_many

array $has_many = []
protected

1:n relation

◆ $has_one

array $has_one = []
protected

1:1 relation

◆ $i18n_fields

array $i18n_fields = []
protected

multi-language fields name => boolean

◆ $is_deleted

boolean $is_deleted = false
protected

deleted state of entry

◆ $is_new

boolean $is_new = true
protected

new state of entry

◆ $known_slots

array $known_slots = []
protected

contains an array of all used identifiers for fields (db columns + aliased columns + additional columns + relations)

◆ $notification_map

array $notification_map = []
protected

assoc array used to map SORM callback to NotificationCenter keys are SORM callbacks, values notifications eg. 'after_create' => 'FooDidCreate'

◆ $pk

array $pk = null
protected

primary key columns

◆ $registered_callbacks

array $registered_callbacks = []
protected

callbacks

◆ $relations

array $relations = []
protected

stores instantiated related objects

◆ $reserved_slots

array $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
staticprotected

reserved indentifiers, fields with those names must not have an explicit getXXX() method

◆ $schemes

array $schemes = null
static

db table metadata

◆ $serialized_fields

$serialized_fields = []
protected

◆ ID_SEPARATOR

const ID_SEPARATOR = '_'

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