3 include_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);
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);
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");
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];
119 $ilDB = $DIC[
'ilDB'];
121 $this->
id =
$ilDB->nextId(
"adt_test");
This is a ADT-based example object.
setPrimary(array $a_value)
static getInstance()
Get singleton.
initDBBridge(ilADTGroupDBBridge $a_adt_db)
parsePrimary(array $a_args)
const INTERESTS_LANGUAGES
ADT based-object base class.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang