Stud.IP  5.4
SimpleORMap Class Reference
Inheritance diagram for SimpleORMap:
AdmissionApplication AdmissionRuleCompatibility ArchivedCourse ArchivedCourseMember auth_user_md5 AuthUserMd5 AuxLockRule Banner BannerRoles BlubberComment BlubberMention BlubberThread CacheType CalendarDate CalendarDateAssignment CalendarDateException Clipboard ClipboardItem ColourValue ConfigEntry ConfigValue ConsultationBlock ConsultationBooking ConsultationEvent ConsultationResponsibility ConsultationSlot Contact ContactGroup ContactGroupItem ContentTermsOfUse Course CourseDate CourseExDate CourseMember CourseMemberNotification CourseTopic Block BlockComment BlockFeedback Bookmark Certificate Clipboard Container PublicLink StructuralElement StructuralElementComment StructuralElementFeedback Task TaskFeedback TaskGroup Template Unit UserDataField UserProgress CourseWizardStepRegistry CronjobLog CronjobSchedule CronjobTask CronjobTestSchedule DataField DatafieldEntryModel Degree Deputy Assignment AssignmentRange Attempt Response Task Test TestTask ExternalUser ExternPageConfig FeedbackElement FeedbackEntry File FileRef Folder ForumCat GlobalResourceLock Definition Instance HelpContent HelpTour HelpTourAudience HelpTourSettings HelpTourStep HelpTourUser Institute InstituteMember InstitutePlanColumn ForumCat ForumEntry ScheduleEntry Kategorie License LockRule LogAction LogEvent LoginBackground LoginFaq LtiData LtiGrade LtiTool MailQueueEntry Message MessageUser ModuleManagementModel MvvOverlappingConflict MvvOverlappingExclude MvvOverlappingSelection NewsRange NewsRoles ObjectUserVisit OERDownloadcounter OERIdentity OERMaterial OERMaterialUser OERPostUpload OERTag OpenGraphURL PersonalNotifications PersonalNotificationsUser Plugin PluginAsset Questionnaire QuestionnaireAnonymousAnswer QuestionnaireAnswer QuestionnaireAssignment QuestionnaireQuestion RangeTreeNode Resource ResourceBooking ResourceBookingInterval ResourceCategory ResourceCategoryProperty ResourcePermission ResourceProperty ResourcePropertyDefinition ResourcePropertyGroup ResourceRequest ResourceRequestAppointment ResourceRequestProperty ResourceTemporaryPermission Base Semester SemesterCourse SemesterHoliday SeminarCycleDate SeparableRoom SeparableRoomPart Statusgruppen StatusgruppeUser StockImage Activity AccessToken AuthCode Client RefreshToken StudipCacheOperation StudipComment StudipEvaluation StudipNews StudipScmEntry StudipStudyArea StudyCourse TFASecret TFAToken Token ToolActivation User_Visibility_Settings UserDomain UserInfo UserOnline UserStudyCourse WebserviceAccessRule WidgetDefault WidgetUser WikiOnlineEditingUser WikiPage WikiVersion

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)
 
 isRelation ($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 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 (string $name, array $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)
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 

Static Protected Member Functions

static db_table ()
 
static db_fields ()
 
static pk ()
 
static default_values ()
 
static serialized_fields ()
 
static alias_fields ()
 
static i18n_fields ()
 
static additional_fields ()
 
static has_many ()
 
static has_one ()
 
static belongs_to ()
 
static has_and_belongs_to_many ()
 
static registered_callbacks ()
 
static known_slots ()
 
static notification_map ()
 
static getter_setter_map ()
 
static configure ($config=[])
 
static config ($key)
 
static registerCallback ($types, $cb)
 
static unregisterCallback ($types, $cb)
 

Protected Attributes

 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 

Static Protected Attributes

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

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
null | int | string | array$idprimary key of table

Member Function Documentation

◆ __callStatic()

static __callStatic ( string  $name,
array  $arguments 
)
static

interceptor for static findByColumn / findEachByColumn / countByColumn / deleteByColumn magic

Parameters
string$name
array$arguments
Exceptions
BadMethodCallException
Returns
int|static|static[]

◆ __clone()

__clone ( )

clean up references after cloning

Returns
void

◆ __get()

__get (   $field)

magic method for dynamic properties

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif getter for additional field could not be found
Parameters
string$fieldthe column or additional field
Returns
null|string|SimpleORMapCollection

◆ __isset()

__isset (   $field)

magic method for dynamic properties

Parameters
string$field
Returns
bool

◆ __set()

__set (   $field,
  $value 
)

magic method for dynamic properties

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif setter for additional field could not be found
Parameters
string$field
string$value
Returns
string

◆ _getAdditionalValue()

_getAdditionalValue (   $field)
protected
Parameters
string$field
Returns
mixed

◆ _getAdditionalValueFromRelation()

_getAdditionalValueFromRelation (   $field)
protected

retrieves an additional field value from relation

Parameters
string$field
Returns
mixed

◆ _getId()

_getId (   $field)
protected

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

Parameters
mixed$fieldunused parameter
Returns
?string

◆ _setAdditionalValue()

_setAdditionalValue (   $field,
  $value 
)
protected
Parameters
string$field
mixed$value
Returns
mixed

◆ _setAdditionalValueFromRelation()

_setAdditionalValueFromRelation (   $field,
  $value 
)
protected

sets additional value in field imported from relation

Parameters
string$field
mixed$value
Returns
mixed

◆ _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
Returns
bool

◆ additional_fields()

static additional_fields ( )
staticprotected

additional computed fields name => callable

Returns
array

◆ alias_fields()

static alias_fields ( )
staticprotected

aliases for columns alias => column

Returns
array

◆ 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

◆ belongs_to()

static belongs_to ( )
staticprotected

n:1 relations

Returns
array

◆ build()

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

build object with given data

Parameters
array$dataassoc array of record
?bool$is_new set object to new state
Returns
static

◆ buildExisting()

static buildExisting (   $data)
static

build object with given data and mark it as existing

Parameters
array$dataassoc array of record
Returns
static

◆ cbAfterInitialize()

cbAfterInitialize (   $cb_type)
protected

default callback used to map specific callbacks to NotificationCenter

Parameters
string$cb_typecallback type
Returns
void|boolean

◆ cbNotificationMapper()

cbNotificationMapper (   $cb_type)
protected

default callback used to map specific callbacks to NotificationCenter

Parameters
string$cb_typecallback type
Returns
void|boolean

◆ 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;

Returns
void

◆ config()

static config (   $key)
staticprotected

fetch config data for the called class

Parameters
string$keyconfig key
Returns
mixed value of config key (null if not set)

◆ configure()

static configure (   $config = [])
staticprotected

set configuration data from subclass

Parameters
?array$config configuration data
Returns
void

◆ count()

count ( )

Countable

Returns
int

◆ countBySql()

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

returns number of records

Parameters
?string$sql sql clause to use on the right side of WHERE
?array$params params for query
Returns
int

◆ 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
?static

◆ db_fields()

static db_fields ( )
staticprotected

table columns

Returns
array

◆ db_table()

static db_table ( )
staticprotected

name of db table

Returns
string

◆ default_values()

static default_values ( )
staticprotected

default values for columns

Returns
array

◆ delete()

delete ( )

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

Returns
bool|int number of deleted rows

◆ 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$params parameters for query
Returns
integer number of deleted records

◆ 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
bool|int addition of all return values, false if none was called

◆ exists()

static exists (   $id)
static

Returns true if given key exists in the database.

Parameters
string | array$idprimary key
Returns
boolean

◆ expireTableScheme()

static expireTableScheme ( )
static

force reload of cached table metadata

Returns
void

◆ 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
string$wherewhere clause of sql
array$paramssql statement parameters
Returns
array return values of callback

◆ 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$pks array of primary keys of called class
?string$order order by sql
?array$order_params
Returns
array return values of callback

◆ findBySQL()

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

returns array of instances of given class filtered by given sql

Parameters
string$sqlsql clause to use on the right side of WHERE
?array$params parameters for query
Returns
static[] array of "self" objects

◆ 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
string$sqlwhere clause of sql
?array$params sql statement parameters
Returns
integer number of found records

◆ 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$pks array of primary keys of called class
?string$order order by sql
?array$order_params
Returns
integer number of found records

◆ findMany()

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

returns array of instances of given class for by given pks

Parameters
?array$pks array of primary keys
?string$order order by clause
?array$order_params
Returns
static[]

◆ findOneBySQL()

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

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

Parameters
string$wheresql clause to use on the right side of WHERE
?array$params parameters for query
Returns
?static

◆ 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
string$foreign_key_valuevalue of foreign key to find related records
array$optionsrelation options from other side of relation
Returns
static[] array of "self" objects

◆ getDefaultValue()

getDefaultValue (   $field)

returns default value for column

Parameters
string$fieldname of column
Returns
mixed the default value

◆ getId()

getId ( )

returns primary key, multiple keys as array

Returns
null|string|array current primary key, null if not set

◆ getIterator()

getIterator ( )

IteratorAggregate

Returns
ArrayIterator

◆ getNewId()

getNewId ( )

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

Returns
boolean|string

◆ getPristineValue()

getPristineValue (   $field)

returns unmodified value of given field

Parameters
string$field
Exceptions
InvalidArgumentException
Returns
mixed

◆ 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

◆ 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

◆ getTableMetadata()

getTableMetadata ( )

returns table and columns metadata

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

◆ getter_setter_map()

static getter_setter_map ( )
staticprotected

assoc array for mapping get/set Methods

Returns
array

◆ 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

◆ getWhereQuery()

getWhereQuery ( )

returns sql clause with current table and pk

Exceptions
UnexpectedValueExceptionif the primary key is incomplete
Returns
boolean|array<string>

◆ has_and_belongs_to_many()

static has_and_belongs_to_many ( )
staticprotected

n:m relations

Returns
array

◆ has_many()

static has_many ( )
staticprotected

1:n relation

Returns
array

◆ has_one()

static has_one ( )
staticprotected

1:1 relation

Returns
array

◆ hasAutoIncrementColumn()

hasAutoIncrementColumn ( )

returns true, if table has an auto_increment column

Returns
boolean

◆ i18n_fields()

static i18n_fields ( )
staticprotected

multi-language fields name => boolean

Returns
array

◆ 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

◆ initializeContent()

initializeContent ( )
protected

init internal content arrays with nulls or defaults

Exceptions
UnexpectedValueExceptionif there is an unmatched alias
Returns
void

◆ 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

◆ 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

◆ isDirty()

isDirty ( )

checks if at least one field was modified since last restore

Returns
boolean

◆ isField()

isField (   $field)

check if given column exists in table

Parameters
string$field
Returns
boolean

◆ isFieldDirty()

isFieldDirty (   $field)

checks if given field was modified since last restore

Parameters
string$field
Returns
boolean

◆ isI18nField()

isI18nField (   $field)

check if given column is a multi-language field

Parameters
string$field
Returns
boolean

◆ isNew()

isNew ( )

check if object exists in database

Returns
boolean

◆ isRelation()

isRelation (   $field)

check if given relation exists in this class

Parameters
string$field
Returns
boolean

◆ known_slots()

static known_slots ( )
staticprotected

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

Returns
array

◆ notification_map()

static notification_map ( )
staticprotected

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

Returns
array

◆ offsetExists()

offsetExists (   $offset)

ArrayAccess: Check whether the given offset exists.

Parameters
string$offset
Returns
bool

◆ offsetGet()

offsetGet (   $offset)

ArrayAccess: Get the value at the given offset.

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif getter for additional field could not be found
Parameters
string$offsetthe column or additional field
Returns
null|string|SimpleORMapCollection

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

ArrayAccess: Set the value at the given offset.

Exceptions
InvalidArgumentExceptionif column could not be found
BadMethodCallExceptionif setter for additional field could not be found
Parameters
string$offset
mixed$value
Returns
void

◆ offsetUnset()

offsetUnset (   $offset)

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

Parameters
string$offset
Returns
void

◆ 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

◆ pk()

static pk ( )
staticprotected

primary key columns

Returns
array

◆ registerCallback()

static registerCallback (   $types,
  $cb 
)
staticprotected

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
callable$cbcallback
Exceptions
InvalidArgumentExceptionif the callback type is not known
Returns
number of registered callbacks

◆ registered_callbacks()

static registered_callbacks ( )
staticprotected

callbacks

Returns
array<string, array<string|Closure>>

◆ resetRelation()

resetRelation (   $relation)

clear data for a relationship

Parameters
string$relationname of relation
Exceptions
InvalidArgumentExceptionif teh relation does not exists
Returns
void

◆ restore()

restore ( )

restore entry from database

Returns
boolean

◆ revertValue()

revertValue (   $field)

reverts value of given field to last restored value

Parameters
string$field
Returns
mixed the restored value

◆ serialized_fields()

static serialized_fields ( )
staticprotected

list of columns to deserialize

Returns
array key is name of column, value is name of ArrayObject class

◆ 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
?iterable$data assoc array
?boolean$reset existing data in object will be discarded
Returns
int|bool number of columns changed

◆ setI18nValue()

setI18nValue (   $field,
  $value 
)
protected

default setter used to proxy I18N fields with I18NString

Parameters
string$fieldcolumn name
mixed$valuevalue
Returns
mixed

◆ setId()

setId (   $id)

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

Parameters
int | string | array$idprimary key
Exceptions
InvalidArgumentExceptionif given key is not complete
Returns
boolean

◆ setNew()

setNew (   $is_new)

set object to new state

Parameters
boolean$is_new
Returns
boolean

◆ setSerializedValue()

setSerializedValue (   $field,
  $value 
)
protected

default setter used to proxy serialized fields with ArrayObjects

Parameters
string$fieldcolumn name
mixed$valuevalue
Returns
mixed

◆ 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
mixed$value
Returns
string

◆ store()

store ( )

store entry in database

Exceptions
UnexpectedValueExceptionif there are forbidden NULL values
Returns
number|boolean

◆ 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

Parameters
null | array | string$only_these
Returns
int|false number addition of all return values, false if none was called

◆ 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

◆ 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
null | array | string$only_these_fieldslimit returned fields
Returns
array

◆ 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
null | array | string$only_these_fieldslimit returned fields
Returns
array

◆ 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
string | static | array$id_or_objectid as string, object or assoc array
Returns
static

◆ 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
null | array | string$only_these_fields
Returns
array

◆ triggerChdate()

triggerChdate ( )

set chdate column to current timestamp

Returns
boolean

◆ unregisterCallback()

static unregisterCallback (   $types,
  $cb 
)
staticprotected

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

Field Documentation

◆ $additional_data

array $additional_data = []
protected

assoc array for storing values for additional fields

◆ $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

◆ $is_deleted

boolean $is_deleted = false
protected

deleted state of entry

◆ $is_new

boolean $is_new = true
protected

new state of entry

◆ $performs_batch_operation

bool $performs_batch_operation = false
staticprotected

indicator for batch operations in findEachBySQL

◆ $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

◆ ID_SEPARATOR

const ID_SEPARATOR = '_'

Defines _ as character used when joining composite primary keys.


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