View more context

 

gs

One note is that the userforms Required is under the Root.Validation, not sure if it makes a differernt

taoceanz

Is there a reliable way to get model's database table name from an ArrayList of classes, or to get the table name for a FQCN string, kinda like the opposite of SilverStripe/ORM/DataObjectSchema::tableClass($table)? e.g. classTable('\MyNamespace\IsWellNamed\MyClass')

  1. $my_class_instances = MyClass::get()->byIDs($my_ids)
  2. foreach (MyClass::get()->byIDs($my_ids) as $instance) {
  3. echo $instance->getTableName() . "\r\n";
  4. }
taoceanz

I've thought to do Config::Inst()->get('\MyNamespace\IsWellNamed\MyClass', 'table_name'); but that isn't fool proof. Was hoping for an existing method within the framework to attain table name.

phyzical

yeah i couldnt see one on a quick search

phyzical

it uses $tableName = $dataObjectSchema->tableName($dataClass);