3include_once 
"Services/ADT/classes/_Example/class.ilADTBasedObject.php";
 
   30        include_once 
"Services/ADT/classes/class.ilADTFactory.php";
 
   33        $properties_def = 
$factory->getDefinitionInstanceByType(
"Group");
 
   36        $name->setMaxLength(255);
 
   37        $properties_def->addElement(
"name", 
$name);
 
   39        $status = 
$factory->getDefinitionInstanceByType(
"Boolean");
 
   40        $properties_def->addElement(
"active", $status);
 
   43        $lng->loadLanguageModule(
"meta");
 
   45        foreach (
$lng->getInstalledLanguages() as 
$lang) {
 
   50        $lang->setNumeric(
false);
 
   51        $lang->setOptions($options);
 
   52        $properties_def->addElement(
"lang", 
$lang);
 
   55        $age = 
$factory->getDefinitionInstanceByType(
"Integer");
 
   58        $properties_def->addElement(
"age", $age);
 
   60        $weight = 
$factory->getDefinitionInstanceByType(
"Float");
 
   63        $properties_def->addElement(
"weight", $weight);
 
   66        $home = 
$factory->getDefinitionInstanceByType(
"Location");
 
   67        $properties_def->addElement(
"home", $home);
 
   69        $tags = 
$factory->getDefinitionInstanceByType(
"MultiText");
 
   70        $tags->setMaxLength(255);
 
   72        $properties_def->addElement(
"tags", $tags);
 
   75            self::INTERESTS_NONE => 
$lng->txt(
"test_interests_none"),
 
   76            self::INTERESTS_LANGUAGES => 
$lng->txt(
"test_interests_languages"),
 
   77            self::INTERESTS_IT => 
$lng->txt(
"test_interests_it")
 
   80        $intr = 
$factory->getDefinitionInstanceByType(
"MultiEnum");
 
   81        $intr->setOptions($options);
 
   82        $properties_def->addElement(
"interests", $intr);
 
   84        $date = 
$factory->getDefinitionInstanceByType(
"Date");
 
   85        $properties_def->addElement(
"entry_date", $date);
 
   87        $dt = 
$factory->getDefinitionInstanceByType(
"DateTime");
 
   88        $properties_def->addElement(
"last_login", $dt);
 
   91        return $factory->getInstanceByDefinition($properties_def);
 
  102        $a_adt_db->
setPrimary(array(
"id" => array(
"integer", $this->
id)));
 
  107        $this->
id = (int) $a_args[0];
 
  121        $this->
id = 
$ilDB->nextId(
"adt_test");
 
An exception for terminatinating execution or to throw for unit testing.
ADT based-object base class.
static getInstance()
Get singleton.
setTable($a_table)
Set table name.
setPrimary(array $a_value)
Set primary fields (in MDB2 format)
This is a ADT-based example object.
hasPrimary()
Check if currently has primary.
initProperties()
Init properties (aka set ADT definition)
parsePrimary(array $a_args)
Parse incoming primary key.
const INTERESTS_LANGUAGES
createPrimaryKey()
Create new primary key, e.g.
initDBBridge(ilADTGroupDBBridge $a_adt_db)
Init (properties) DB bridge.