object = $object; parent::__construct($name); } public function scaffoldFormField($title = null) { $objs = DataObject::get($this->object->class); $titleField = (singleton($this->object->class)->hasField('Title')) ? "Title" : "Name"; $map = ($objs) ? $objs->toDropdownMap("ID", $titleField) : false; return new DropdownField($this->name, $title, $map, null, null, ' '); } } ?>