3 declare(strict_types=1);
26 $properties_def =
$factory->getDefinitionInstanceByType(
"Group");
29 $name->setMaxLength(255);
30 $properties_def->addElement(
"name",
$name);
32 $status =
$factory->getDefinitionInstanceByType(
"Boolean");
33 $properties_def->addElement(
"active", $status);
36 $this->
lng->loadLanguageModule(
"meta");
38 foreach ($this->
lng->getInstalledLanguages() as
$lang) {
43 $lang->setNumeric(
false);
44 $lang->setOptions($options);
45 $properties_def->addElement(
"lang",
$lang);
47 $age =
$factory->getDefinitionInstanceByType(
"Integer");
50 $properties_def->addElement(
"age", $age);
52 $weight =
$factory->getDefinitionInstanceByType(
"Float");
55 $properties_def->addElement(
"weight", $weight);
58 $home =
$factory->getDefinitionInstanceByType(
"Location");
59 $properties_def->addElement(
"home", $home);
61 $tags =
$factory->getDefinitionInstanceByType(
"MultiText");
62 $tags->setMaxLength(255);
64 $properties_def->addElement(
"tags", $tags);
67 self::INTERESTS_NONE => $this->
lng->txt(
"test_interests_none"),
68 self::INTERESTS_LANGUAGES => $this->
lng->txt(
"test_interests_languages"),
69 self::INTERESTS_IT => $this->
lng->txt(
"test_interests_it")
72 $intr =
$factory->getDefinitionInstanceByType(
"MultiEnum");
73 $intr->setOptions($options);
74 $properties_def->addElement(
"interests", $intr);
76 $date =
$factory->getDefinitionInstanceByType(
"Date");
77 $properties_def->addElement(
"entry_date", $date);
79 $dt =
$factory->getDefinitionInstanceByType(
"DateTime");
80 $properties_def->addElement(
"last_login", $dt);
83 return $factory->getInstanceByDefinition($properties_def);
94 $a_adt_db->
setPrimary(array(
"id" => array(
"integer", $this->
id)));
99 $this->
id = (
int) $a_args[0];
109 $this->
id = $this->db->nextId(
"adt_test");
setPrimary(array $a_value)
Set primary fields (in MDB2 format)
This is a ADT-based example object It has all supported ADTs and shows DB sequence-handling.
initDBBridge(ilADTDBBridge $a_adt_db)
ADT DB bridge base class.
setTable(string $a_table)
parsePrimary(array $a_args)
const INTERESTS_LANGUAGES
ADT based-object base class Currently "mixed" with ActiveRecord-pattern, could be splitted...