ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTFactory Class Reference
+ Collaboration diagram for ilADTFactory:

Public Member Functions

 getValidTypes ()
 Get all ADT types.
 isValidType ($a_type)
 Check if given type is valid.
 initTypeClass ($a_type, $a_class=null)
 Init type-specific class.
 getDefinitionInstanceByType ($a_type)
 Get instance of ADT definition.
 getInstanceByDefinition (ilADTDefinition $a_def)
 Get instance of ADT.
 getFormBridgeForInstance (ilADT $a_adt)
 Get form bridge instance for ADT.
 getDBBridgeForInstance (ilADT $a_adt)
 Get DB bridge instance for ADT.
 getPresentationBridgeForInstance (ilADT $a_adt)
 Get presentation bridge instance for ADT.
 getSearchBridgeForDefinitionInstance (ilADTDefinition $a_adt_def, $a_range=true, $a_multi=true)
 Get search bridge instance for ADT definition.
 getActiveRecordBridgeForInstance (ilADT $a_adt)
 Get active record instance for ADT.

Static Public Member Functions

static getInstance ()
 Get singleton.
static getActiveRecordInstance (ilADTGroupDBBridge $a_properties)
 Get active record instance.
static initActiveRecordByType ()
 Init active record by type.
static getActiveRecordByTypeInstance (ilADTGroupDBBridge $a_properties)
 Get active record by type instance.

Protected Member Functions

 __construct ()
 Constructor.

Static Protected Attributes

static $instance

Detailed Description

Definition at line 6 of file class.ilADTFactory.php.

Constructor & Destructor Documentation

ilADTFactory::__construct ( )
protected

Constructor.

Returns
self

Definition at line 15 of file class.ilADTFactory.php.

{
// #15666 - generic fix in 5.1+, but float/location needs this
setlocale(LC_NUMERIC, 'C');
}

Member Function Documentation

ilADTFactory::getActiveRecordBridgeForInstance ( ilADT  $a_adt)

Get active record instance for ADT.

Parameters
ilADT$a_adt
Returns
ilADTActiveRecordBridge

Definition at line 212 of file class.ilADTFactory.php.

References ilADT\getType(), and initTypeClass().

{
$class = $this->initTypeClass($a_adt->getType(), "ActiveRecordBridge");
return new $class($a_adt);
}

+ Here is the call graph for this function:

static ilADTFactory::getActiveRecordByTypeInstance ( ilADTGroupDBBridge  $a_properties)
static

Get active record by type instance.

Parameters
ilADTGroupDBBridge$a_properties
Returns
ilADTActiveRecordByType

Definition at line 249 of file class.ilADTFactory.php.

References initActiveRecordByType().

{
return new ilADTActiveRecordByType($a_properties);
}

+ Here is the call graph for this function:

static ilADTFactory::getActiveRecordInstance ( ilADTGroupDBBridge  $a_properties)
static

Get active record instance.

Parameters
ilADTGroupDBBridge$a_properties
Returns
ilADTActiveRecord

Definition at line 229 of file class.ilADTFactory.php.

{
require_once "Services/ADT/classes/ActiveRecord/class.ilADTActiveRecord.php";
return new ilADTActiveRecord($a_properties);
}
ilADTFactory::getDBBridgeForInstance ( ilADT  $a_adt)

Get DB bridge instance for ADT.

Exceptions
Exception
Parameters
ilADT$a_adt
Returns
ilADTDBBridge

Definition at line 139 of file class.ilADTFactory.php.

References ilADT\getType(), and initTypeClass().

{
$class = $this->initTypeClass($a_adt->getType(), "DBBridge");
return new $class($a_adt);
}

+ Here is the call graph for this function:

ilADTFactory::getDefinitionInstanceByType (   $a_type)

Get instance of ADT definition.

Exceptions
Exception
Parameters
string$a_type
Returns
ilADTDefinition

Definition at line 88 of file class.ilADTFactory.php.

References initTypeClass().

{
$class = $this->initTypeClass($a_type, "Definition");
return new $class();
}

+ Here is the call graph for this function:

ilADTFactory::getFormBridgeForInstance ( ilADT  $a_adt)

Get form bridge instance for ADT.

Exceptions
Exception
Parameters
ilADT$a_adt
Returns
ilADTFormBridge

Definition at line 126 of file class.ilADTFactory.php.

References ilADT\getType(), and initTypeClass().

{
$class = $this->initTypeClass($a_adt->getType(), "FormBridge");
return new $class($a_adt);
}

+ Here is the call graph for this function:

ilADTFactory::getInstanceByDefinition ( ilADTDefinition  $a_def)

Get instance of ADT.

Exceptions
Exception
Parameters
ilADTDefinition$a_def
Returns
ilADT

Definition at line 101 of file class.ilADTFactory.php.

References ilADTDefinition\getType(), and initTypeClass().

{
if(!method_exists($a_def, "getADTInstance"))
{
$class = $this->initTypeClass($a_def->getType());
return new $class($a_def);
}
else
{
return $a_def->getADTInstance();
}
}

+ Here is the call graph for this function:

ilADTFactory::getPresentationBridgeForInstance ( ilADT  $a_adt)

Get presentation bridge instance for ADT.

Exceptions
Exception
Parameters
ilADT$a_adt
Returns
ilADTPresentationBridge

Definition at line 152 of file class.ilADTFactory.php.

References ilADT\getType(), and initTypeClass().

{
$class = $this->initTypeClass($a_adt->getType(), "PresentationBridge");
return new $class($a_adt);
}

+ Here is the call graph for this function:

ilADTFactory::getSearchBridgeForDefinitionInstance ( ilADTDefinition  $a_adt_def,
  $a_range = true,
  $a_multi = true 
)

Get search bridge instance for ADT definition.

Parameters
ilADTDefinition$a_adt_def
bool$a_range
bool$a_multi
Returns
ilADTSearchBridge

Definition at line 166 of file class.ilADTFactory.php.

References ilADTDefinition\getType(), and initTypeClass().

{
if($a_range)
{
try
{
$class = $this->initTypeClass($a_adt_def->getType(), "SearchBridgeRange");
return new $class($a_adt_def);
}
catch(Exception $e)
{
}
}
// multi enum search (single) == enum search (multi)
if(!$a_multi &&
$a_adt_def->getType() == "MultiEnum")
{
$class = $this->initTypeClass("Enum", "SearchBridgeMulti");
return new $class($a_adt_def);
}
if($a_multi)
{
try
{
$class = $this->initTypeClass($a_adt_def->getType(), "SearchBridgeMulti");
return new $class($a_adt_def);
}
catch(Exception $e)
{
}
}
$class = $this->initTypeClass($a_adt_def->getType(), "SearchBridgeSingle");
return new $class($a_adt_def);
}

+ Here is the call graph for this function:

ilADTFactory::getValidTypes ( )

Get all ADT types.

Returns
array

Definition at line 40 of file class.ilADTFactory.php.

Referenced by isValidType().

{
return array("Float", "Integer", "Location", "Text", "Boolean",
"MultiText", "Date", "DateTime", "Enum", "MultiEnum", "Group");
}

+ Here is the caller graph for this function:

static ilADTFactory::initActiveRecordByType ( )
static

Init active record by type.

Definition at line 238 of file class.ilADTFactory.php.

Referenced by ilAdvancedMDValues\findByObjectId(), getActiveRecordByTypeInstance(), ilAdvancedMDFieldDefinitionSelectMulti\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelect\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelectMulti\update(), and ilAdvancedMDFieldDefinitionSelect\update().

{
require_once "Services/ADT/classes/ActiveRecord/class.ilADTActiveRecordByType.php";
}

+ Here is the caller graph for this function:

ilADTFactory::initTypeClass (   $a_type,
  $a_class = null 
)

Init type-specific class.

Exceptions
Exception
Parameters
string$a_type
string$a_class
Returns
string

Definition at line 65 of file class.ilADTFactory.php.

References $file, and isValidType().

Referenced by getActiveRecordBridgeForInstance(), getDBBridgeForInstance(), getDefinitionInstanceByType(), getFormBridgeForInstance(), getInstanceByDefinition(), getPresentationBridgeForInstance(), and getSearchBridgeForDefinitionInstance().

{
if($this->isValidType($a_type))
{
$class = "ilADT".$a_type.$a_class;
$file = "Services/ADT/classes/Types/".$a_type."/class.".$class.".php";
if(file_exists($file))
{
require_once $file;
return $class;
}
}
throw new Exception("ilADTFactory unknown type");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTFactory::isValidType (   $a_type)

Check if given type is valid.

Parameters
string$a_type
Returns
bool

Definition at line 52 of file class.ilADTFactory.php.

References getValidTypes().

Referenced by initTypeClass().

{
return in_array((string)$a_type, $this->getValidTypes());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilADTFactory::$instance
staticprotected

Definition at line 8 of file class.ilADTFactory.php.

Referenced by getInstance().


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