ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ActiveRecord Class Reference

Class ActiveRecord. More...

+ Inheritance diagram for ActiveRecord:
+ Collaboration diagram for ActiveRecord:

Public Member Functions

 getArConnector ()
 getArFieldList ()
 getConnectorContainerName ()
 setConnectorContainerName ($connector_container_name)
 getPrimaryFieldValue ()
 setPrimaryFieldValue ($value)
 __construct ($primary_key=0, arConnector $connector=NULL)
 storeObjectToCache ()
 __getConvertedDateFieldsAsArray ($format=NULL)
 __asCsv ($separator= ';', $header=false)
 __asArray ()
 __asStdClass ()
 __asSerializedObject ()
 buildFromArray (array $array)
 sleep ($field_name)
 wakeUp ($field_name, $field_value)
 getArrayForDb ()
 getArrayForConnector ()
 installConnector ()
 store ()
 save ()
 create ()
 copy ($new_id=0)
 afterObjectLoad ()
 read ()
 update ()
 delete ()
 __call ($name, $arguments)

Static Public Member Functions

static returnDbTableName ()
static installDB ()
static renameDBField ($old_name, $new_name)
static tableExists ()
static fieldExists ($field_name)
static removeDBField ($field_name)
static updateDB ()
static resetDB ()
static truncateDB ()
static flushDB ()
static preloadObjects ()
static additionalParams (array $additional_params)
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null.
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
static where ($where, $operator=NULL)
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array( '*'), $operator= '=', $both_external=false)
static innerjoin ($tablename, $on_this, $on_external, $fields=array( '*'), $operator= '=', $both_external=false)
static leftjoin ($tablename, $on_this, $on_external, $fields=array( '*'), $operator= '=', $both_external=false)
static orderBy ($orderBy, $orderDirection= 'ASC')
static dateFormat ($date_format= 'd.m.Y-H:i:s')
static limit ($start, $end)
static affectedRows ()
static count ()
static get ()
static debug ()
static first ()
static getCollection ()
static last ()
static getFirstFromLastQuery ()
static connector (arConnector $connector)
static raw ($set_raw=true)
static getArray ($key=NULL, $values=NULL)
static _toCamelCase ($str, $capitalise_first_char=false)

Data Fields

const ACTIVE_RECORD_VERSION = '2.0.7'

Protected Member Functions

 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv.
 installDatabase ()

Static Protected Member Functions

static getCalledClass ()
static fromCamelCase ($str)

Protected Attributes

 $ar_safe_read = true
 $connector_container_name = ''

Detailed Description

Constructor & Destructor Documentation

ActiveRecord::__construct (   $primary_key = 0,
arConnector  $connector = NULL 
)
Parameters
int$primary_key
arConnector$connector

Definition at line 118 of file class.ActiveRecord.php.

References get(), read(), and arConnectorMap\register().

{
if($connector == NULL) {
$connector = new arConnectorDB();
}
//$this->arConnector = $connector;
arConnectorMap::register($this, $connector);
$arFieldList = arFieldCache::get($this);
//$this->arFieldList = $arFieldList ;
$key = $arFieldList->getPrimaryFieldName();
$this->{$key} = $primary_key;
if ($primary_key !== 0 AND $primary_key !== NULL AND $primary_key !== false) {
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ActiveRecord::__asArray ( )
Returns
array

Definition at line 208 of file class.ActiveRecord.php.

References getArFieldList().

Referenced by __asCsv().

{
$return = array();
foreach ($this->getArFieldList()->getFields() as $field) {
$fieldname = $field->getName();
$return[$fieldname] = $this->{$fieldname};
}
return $return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ActiveRecord::__asCsv (   $separator = ';',
  $header = false 
)
Parameters
string$separator
bool$header
Returns
string

Definition at line 171 of file class.ActiveRecord.php.

References $separator, __asArray(), getArFieldList(), and serializeToCSV().

{
$line = '';
if ($header) {
$line .= implode($separator, array_keys($this->getArFieldList()->getRawFields()));
$line .= "\n";
}
$array = array();
foreach ($this->__asArray() as $field_name => $value) {
$serialized = $this->serializeToCSV($field_name);
if ($serialized === NULL) {
$array[$field_name] = $this->{$field_name};
} else {
$array[$field_name] = $serialized;
}
}
$line .= implode($separator, array_values($array));
return $line;
}

+ Here is the call graph for this function:

ActiveRecord::__asSerializedObject ( )
Returns
string

Definition at line 236 of file class.ActiveRecord.php.

{
return serialize($this);
}
ActiveRecord::__asStdClass ( )
Returns
stdClass

Definition at line 222 of file class.ActiveRecord.php.

References getArFieldList().

Referenced by arConnectorSession\create().

{
$return = new stdClass();
foreach ($this->getArFieldList()->getFields() as $field) {
$fieldname = $field->getName();
$return->{$fieldname} = $this->{$fieldname};
}
return $return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ActiveRecord::__call (   $name,
  $arguments 
)
Parameters
$name
$arguments
Returns
array

Definition at line 855 of file class.ActiveRecord.php.

{
// Getter
if (preg_match("/get([a-zA-Z]*)/u", $name, $matches) AND count($arguments) == 0) {
return $this->{self::fromCamelCase($matches[1])};
}
// Setter
if (preg_match("/set([a-zA-Z]*)/u", $name, $matches) AND count($arguments) == 1) {
$this->{self::fromCamelCase($matches[1])} = $arguments[0];
}
if (preg_match("/findBy([a-zA-Z]*)/u", $name, $matches) AND count($arguments) == 1) {
return self::where(array( self::fromCamelCase($matches[1]) => $arguments[0] ))->getFirst();
}
}
ActiveRecord::__getConvertedDateFieldsAsArray (   $format = NULL)
Parameters
string$format
Returns
array

Definition at line 145 of file class.ActiveRecord.php.

References getArFieldList().

{
$converted_dates = array();
foreach ($this->getArFieldList()->getFields() as $field) {
if ($field->isDateField()) {
$name = $field->getName();
$value = $this->{$name};
$converted_dates[$name] = array(
'unformatted' => $value,
'unix' => strtotime($value),
);
if ($format) {
$converted_dates[$name]['formatted'] = date($format, strtotime($value));
}
}
}
return $converted_dates;
}

+ Here is the call graph for this function:

static ActiveRecord::_toCamelCase (   $str,
  $capitalise_first_char = false 
)
static
Parameters
string$str
bool$capitalise_first_char
Returns
string

Definition at line 876 of file class.ActiveRecord.php.

Referenced by arViewField\__construct().

{
if ($capitalise_first_char) {
$str[0] = strtoupper($str[0]);
}
$func = create_function('$c', 'return strtoupper($c[1]);');
return preg_replace_callback('/_([a-z])/', $func, $str);
}

+ Here is the caller graph for this function:

static ActiveRecord::additionalParams ( array  $additional_params)
static
Parameters
array$additional_params
Returns
$this

Definition at line 548 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
$srModelObjectList->additionalParams($additional_params);
return $srModelObjectList;
}
static ActiveRecord::affectedRows ( )
static
Returns
int

Definition at line 734 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->affectedRows();
}
ActiveRecord::afterObjectLoad ( )

Definition at line 494 of file class.ActiveRecord.php.

{
}
ActiveRecord::buildFromArray ( array  $array)
Parameters
array$array
Returns
$this

Definition at line 246 of file class.ActiveRecord.php.

References arObjectCache\get(), arObjectCache\isCached(), and arObjectCache\store().

{
$class = get_class($this);
$primary = $this->getArFieldList()->getPrimaryFieldName();
$primary_value = $array[$primary];
if ($primary_value AND arObjectCache::isCached($class, $primary_value)) {
return arObjectCache::get($class, $primary_value);
}
foreach ($array as $field_name => $value) {
if ($this->wakeUp($field_name, $value) === NULL) {
$this->{$field_name} = $value;
} else {
$this->{$field_name} = $this->wakeUp($field_name, $value);
}
}
$this->afterObjectLoad();
return $this;
}

+ Here is the call graph for this function:

static ActiveRecord::connector ( arConnector  $connector)
static
Parameters
arConnector$connector
Returns
ActiveRecordList

Definition at line 815 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->connector($connector);
}
ActiveRecord::copy (   $new_id = 0)
Parameters
int$new_id
Returns
ActiveRecord
Exceptions
arException

Definition at line 483 of file class.ActiveRecord.php.

References arException\COPY_DESTINATION_ID_EXISTS.

{
if (self::where(array( $this->getArFieldList()->getPrimaryFieldName() => $new_id ))->hasSets()) {
}
$new_obj = clone($this);
$new_obj->setPrimaryFieldValue($new_id);
return $new_obj;
}
static ActiveRecord::count ( )
static
Returns
int

Definition at line 744 of file class.ActiveRecord.php.

{
}
ActiveRecord::create ( )

Reimplemented in arStorage.

Definition at line 467 of file class.ActiveRecord.php.

References arObjectCache\store().

{
if ($this->getArFieldList()->getPrimaryField()->getSequence()) {
$this->id = $this->getArConnector()->nextID($this);
}
$this->getArConnector()->create($this, $this->getArrayForConnector());
}

+ Here is the call graph for this function:

static ActiveRecord::dateFormat (   $date_format = 'd.m.Y - H:i:s')
static
Parameters
string$date_format
Returns
ActiveRecordList

Definition at line 709 of file class.ActiveRecord.php.

:i:s') {
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
$srModelObjectList->dateFormat($date_format);
return $srModelObjectList;
}
static ActiveRecord::debug ( )
static
Returns
ActiveRecordList

Definition at line 762 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->debug();
}
ActiveRecord::delete ( )

Definition at line 525 of file class.ActiveRecord.php.

References arObjectCache\purge().

{
$this->getArConnector()->delete($this);
}

+ Here is the call graph for this function:

static ActiveRecord::fieldExists (   $field_name)
staticfinal
Parameters
$field_name
Returns
bool

Definition at line 381 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->checkFieldExists(self::getCalledClass(), $field_name);
}
static ActiveRecord::findOrFail (   $primary_key,
array  $add_constructor_args = array() 
)
static

Tries to find the object and throws an Exception if object is not found, instead of returning null.

Parameters
$primary_key
array$add_constructor_args
Exceptions
arException
Returns
ActiveRecord

Definition at line 596 of file class.ActiveRecord.php.

References arException\RECORD_NOT_FOUND.

{
$obj = self::find($primary_key, $add_constructor_args);
if (is_null($obj)) {
}
return $obj;
}
static ActiveRecord::findOrGetInstance (   $primary_key,
array  $add_constructor_args = array() 
)
static
Parameters
$primary_key
array$add_constructor_argsReturns an existing Object with given primary-key or a new Instance with given primary-key set but not yet created
Returns
ActiveRecord

Definition at line 614 of file class.ActiveRecord.php.

{
$obj = self::find($primary_key, $add_constructor_args);
if ($obj !== NULL) {
return $obj;
} else {
$class_name = get_called_class();
$obj = arFactory::getInstance($class_name, 0, $add_constructor_args);
$obj->setPrimaryFieldValue($primary_key);
$obj->is_new = true;
$obj->storeObjectToCache();
return $obj;
}
}
static ActiveRecord::first ( )
static
Returns
ActiveRecord

Definition at line 772 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->first();
}
static ActiveRecord::flushDB ( )
staticfinal
Returns
bool

Definition at line 446 of file class.ActiveRecord.php.

{
return self::truncateDB();
}
static ActiveRecord::fromCamelCase (   $str)
staticprotected
Parameters
string$str
Returns
string

Definition at line 891 of file class.ActiveRecord.php.

{
$str[0] = strtolower($str[0]);
$func = create_function('$c', 'return "_" . strtolower($c[1]);');
return preg_replace_callback('/([A-Z])/', $func, $str);
}
static ActiveRecord::get ( )
static
Returns
ActiveRecord[]

Definition at line 752 of file class.ActiveRecord.php.

Referenced by __construct(), ilBibliographicSetting\getAll(), getArConnector(), getArFieldList(), and arConfigFormGUI\getValuesForItem().

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->get();
}

+ Here is the caller graph for this function:

ActiveRecord::getArConnector ( )
Returns

Definition at line 47 of file class.ActiveRecord.php.

References get().

Referenced by arWhere\asSQLStatement().

{
return arConnectorMap::get($this);
//return $this->arConnector;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ActiveRecord::getArFieldList ( )
Returns

Definition at line 56 of file class.ActiveRecord.php.

References get().

Referenced by __asArray(), __asCsv(), __asStdClass(), __getConvertedDateFieldsAsArray(), arWhere\asSQLStatement(), arConnectorDB\installDatabase(), arConnectorDB\updateDatabase(), and arConnectorDB\updateIndices().

{
return arFieldCache::get($this);
// return $this->arFieldList;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ActiveRecord::getArray (   $key = NULL,
  $values = NULL 
)
static
Parameters
null$key
null$values
Returns
array

Definition at line 840 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->getArray($key, $values);
}
ActiveRecord::getArrayForConnector ( )
final
Returns
array

Definition at line 300 of file class.ActiveRecord.php.

Referenced by arConnectorDB\create(), and arConnectorDB\update().

{
$data = array();
foreach ($this->getArFieldList()->getFields() as $field) {
$field_name = $field->getName();
if ($this->sleep($field_name) === NULL) {
$data[$field_name] = array( $field->getFieldType(), $this->{$field_name} );
} else {
$data[$field_name] = array( $field->getFieldType(), $this->sleep($field_name) );
}
}
return $data;
}

+ Here is the caller graph for this function:

ActiveRecord::getArrayForDb ( )
final
Returns
array
Deprecated:

Definition at line 292 of file class.ActiveRecord.php.

{
return $this->getArrayForConnector();
}
static ActiveRecord::getCalledClass ( )
staticprotected
Returns
ActiveRecord

Returns an instance of the instatiated calling active record (needs to be done in static methods) : This should be cached somehow

Definition at line 327 of file class.ActiveRecord.php.

References arCalledClassCache\get().

Referenced by getConnectorContainerName().

{
$class = get_called_class();
return arCalledClassCache::get($class);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ActiveRecord::getCollection ( )
static
Returns
ActiveRecordList

Definition at line 782 of file class.ActiveRecord.php.

Referenced by arStorageRecordGUI\index().

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList;
}

+ Here is the caller graph for this function:

ActiveRecord::getConnectorContainerName ( )
static ActiveRecord::getFirstFromLastQuery ( )
static
Returns
ActiveRecordList
Deprecated:

Definition at line 803 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->getFirstFromLastQuery();
}
ActiveRecord::getPrimaryFieldValue ( )
Returns
mixed

Reimplemented in ilADTActiveRecordWrapper.

Definition at line 97 of file class.ActiveRecord.php.

References arFieldCache\getPrimaryFieldName().

Referenced by arConnectorSession\create(), arObjectCache\purge(), arConnectorSession\read(), arConnectorDB\read(), arObjectCache\store(), and arConnectorDB\update().

{
$primary_fieldname = arFieldCache::getPrimaryFieldName($this);
return $this->{$primary_fieldname};
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ActiveRecord::innerjoin (   $tablename,
  $on_this,
  $on_external,
  $fields = array( '*' ),
  $operator = '=',
  $both_external = false 
)
static
Parameters
$tablename
$on_this
$on_external
array$fields
string$operator
Returns
$this

Definition at line 667 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->innerjoin($tablename, $on_this, $on_external, $fields, $operator, $both_external);
}
static ActiveRecord::innerjoinAR ( ActiveRecord  $ar,
  $on_this,
  $on_external,
  $fields = array( '*' ),
  $operator = '=',
  $both_external = false 
)
static
Parameters
ActiveRecord$ar
$on_this
$on_external
array$fields
string$operator
Returns
$this

Definition at line 653 of file class.ActiveRecord.php.

References getConnectorContainerName().

{
return self::innerjoin($ar->getConnectorContainerName(), $on_this, $on_external, $fields, $operator, $both_external);
}

+ Here is the call graph for this function:

ActiveRecord::installConnector ( )
Returns
bool
Deprecated:
Do not use in Core DB-update.

Definition at line 352 of file class.ActiveRecord.php.

{
return $this->installDatabase();
}
ActiveRecord::installDatabase ( )
finalprotected
Returns
bool

Definition at line 399 of file class.ActiveRecord.php.

{
if (! $this->tableExists()) {
$fields = array();
foreach ($this->getArFieldList()->getFields() as $field) {
$fields[$field->getName()] = $field->getAttributesForConnector();
}
return $this->getArConnector()->installDatabase($this, $fields);
} else {
return $this->getArConnector()->updateDatabase($this);
}
}
static ActiveRecord::installDB ( )
staticfinal
Returns
bool
Deprecated:
Do not use in Core DB-update. Please generate the manual installation script by using:
        $arBuilder = new arBuilder(new ilYourARBasedClass());
        $arBuilder->generateDBUpdateForInstallation();

Definition at line 342 of file class.ActiveRecord.php.

Referenced by arConnectorDB\resetDatabase().

{
return self::getCalledClass()->installDatabase();
}

+ Here is the caller graph for this function:

static ActiveRecord::last ( )
static
Returns
ActiveRecord

Definition at line 792 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->last();
}
static ActiveRecord::leftjoin (   $tablename,
  $on_this,
  $on_external,
  $fields = array( '*' ),
  $operator = '=',
  $both_external = false 
)
static
Parameters
$tablename
$on_this
$on_external
array$fields
string$operator
Returns
$this

Definition at line 683 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->leftjoin($tablename, $on_this, $on_external, $fields, $operator, $both_external);
}
static ActiveRecord::limit (   $start,
  $end 
)
static
Parameters
$start
$end
Returns
ActiveRecordList

Definition at line 723 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
$srModelObjectList->limit($start, $end);
return $srModelObjectList;
}
static ActiveRecord::orderBy (   $orderBy,
  $orderDirection = 'ASC' 
)
static
Parameters
$orderBy
string$orderDirection
Returns
ActiveRecordList

Definition at line 696 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
$srModelObjectList->orderBy($orderBy, $orderDirection);
return $srModelObjectList;
}
static ActiveRecord::preloadObjects ( )
static
Returns
ActiveRecord[]

Definition at line 538 of file class.ActiveRecord.php.

{
return self::get();
}
static ActiveRecord::raw (   $set_raw = true)
static
Parameters
bool$set_raw
Returns
ActiveRecordList

Definition at line 827 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
return $srModelObjectList->raw($set_raw);
}
ActiveRecord::read ( )

Reimplemented in arStorage.

Definition at line 498 of file class.ActiveRecord.php.

References $records, and arException\RECORD_NOT_FOUND.

Referenced by __construct().

{
$records = $this->getArConnector()->read($this);
if (count($records) == 0 AND $this->ar_safe_read == true) {
} elseif (count($records) == 0 AND $this->ar_safe_read == false) {
$this->is_new = true;
}
foreach ($records as $rec) {
foreach ($this->getArrayForConnector() as $k => $v) {
if ($this->wakeUp($k, $rec->{$k}) === NULL) {
$this->{$k} = $rec->{$k};
} else {
$this->{$k} = $this->wakeUp($k, $rec->{$k});
}
}
$this->afterObjectLoad();
}
}

+ Here is the caller graph for this function:

static ActiveRecord::removeDBField (   $field_name)
staticfinal
Parameters
$field_name
Returns
bool

Definition at line 391 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->removeField(self::getCalledClass(), $field_name);
}
static ActiveRecord::renameDBField (   $old_name,
  $new_name 
)
staticfinal
Parameters
$old_name
$new_name
Returns
bool

Definition at line 363 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->renameField(self::getCalledClass(), $old_name, $new_name);
}
static ActiveRecord::resetDB ( )
staticfinal
Returns
bool

Definition at line 430 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->resetDatabase(self::getCalledClass());
}
static ActiveRecord::returnDbTableName ( )
staticabstract
Returns
string Return the Name of your Database Table
Deprecated:

Reimplemented in ilADTActiveRecordWrapper, ilBibliographicSetting, arMessage, arStorageRecordStorage, arMixedKey, arConfig, arRealRecord, and arUser.

Referenced by getConnectorContainerName().

+ Here is the caller graph for this function:

ActiveRecord::save ( )

Definition at line 462 of file class.ActiveRecord.php.

{
$this->store();
}
ActiveRecord::serializeToCSV (   $field)
protected

This method is called for every field of your instance if you use __asCsv.

You can use it to customize your export into csv. (e.g. serialize an array).

Parameters
$fieldstring
Returns
mixed

Definition at line 200 of file class.ActiveRecord.php.

Referenced by __asCsv().

{
return NULL;
}

+ Here is the caller graph for this function:

ActiveRecord::setConnectorContainerName (   $connector_container_name)
Parameters
string$connector_container_name

Definition at line 89 of file class.ActiveRecord.php.

References $connector_container_name.

{
$this->connector_container_name = $connector_container_name;
}
ActiveRecord::setPrimaryFieldValue (   $value)
Parameters
$value

Definition at line 107 of file class.ActiveRecord.php.

References arFieldCache\getPrimaryFieldName().

{
$primary_fieldname = arFieldCache::getPrimaryFieldName($this);
$this->{$primary_fieldname} = $value;
}

+ Here is the call graph for this function:

ActiveRecord::sleep (   $field_name)
Parameters
$field_name
Returns
mixed

Reimplemented in ilADTActiveRecordWrapper.

Definition at line 272 of file class.ActiveRecord.php.

{
return NULL;
}
ActiveRecord::store ( )

Definition at line 453 of file class.ActiveRecord.php.

Referenced by storeObjectToCache().

{
if (! $this->getId()) {
$this->create();
} else {
$this->update();
}
}

+ Here is the caller graph for this function:

ActiveRecord::storeObjectToCache ( )

Definition at line 135 of file class.ActiveRecord.php.

References store().

{
}

+ Here is the call graph for this function:

static ActiveRecord::tableExists ( )
staticfinal
Returns
bool

Definition at line 371 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->checkTableExists(self::getCalledClass());
}
static ActiveRecord::truncateDB ( )
staticfinal
Returns
bool

Definition at line 438 of file class.ActiveRecord.php.

{
return self::getCalledClass()->getArConnector()->truncateDatabase(self::getCalledClass());
}
ActiveRecord::update ( )

Reimplemented in arStorage.

Definition at line 519 of file class.ActiveRecord.php.

References arObjectCache\store().

{
$this->getArConnector()->update($this);
}

+ Here is the call graph for this function:

static ActiveRecord::updateDB ( )
staticfinal
Returns
bool

Definition at line 416 of file class.ActiveRecord.php.

{
if (! self::tableExists()) {
self::getCalledClass()->installDatabase();
return true;
}
return self::getCalledClass()->getArConnector()->updateDatabase(self::getCalledClass());
}
ActiveRecord::wakeUp (   $field_name,
  $field_value 
)
Parameters
$field_name
$field_value
Returns
mixed

Reimplemented in ilADTActiveRecordWrapper.

Definition at line 283 of file class.ActiveRecord.php.

{
return NULL;
}
static ActiveRecord::where (   $where,
  $operator = NULL 
)
static
Parameters
$where
null$operator
Returns
ActiveRecordList

Definition at line 636 of file class.ActiveRecord.php.

{
$srModelObjectList = new ActiveRecordList(self::getCalledClass());
$srModelObjectList->where($where, $operator);
return $srModelObjectList;
}

Field Documentation

ActiveRecord::$ar_safe_read = true
protected

Definition at line 37 of file class.ActiveRecord.php.

ActiveRecord::$connector_container_name = ''
protected

Definition at line 41 of file class.ActiveRecord.php.

Referenced by getConnectorContainerName(), and setConnectorContainerName().

const ActiveRecord::ACTIVE_RECORD_VERSION = '2.0.7'

Definition at line 25 of file class.ActiveRecord.php.


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