Hi,
Experiencing a weirdsie on something I think I must have done a thousand times. I have $db field called "SectorName" in a DataObject which is populated in every case but inside the class $this->SectorName is returning empty. Code:
class Sector extends DataObject {
public static $db = array(
"SectorName" => "Text",
"SectorDescription" => "HTMLText",
"ClientsToShow" => "Text"
);
public static $has_one = array(
"SectorHolder" => "SectorHolder"
);
public static $field_names = array(
"SectorName" => "Name",
"SectorDescription" => "Description"
);
static $can_be_root = false;
static $default_parent = 'SectorHolder';
public function getCMSFields_forPopup() {
$fields = new FieldSet();
$fields->push(new TextField("SectorName", "Name"));
$fields->push(new SimpleTinyMCEField("SectorDescription", "Description"));
$fields->push(new ListboxField("ClientsToShow", "Clients to Show in ".$this->SectorName, DataObject::get("Client","Sectors LIKE '%".$this->SectorName."%'", "Title ASC")->toDropdownMap('ID','Title','(Select one or more options)',true), "", "5", true));
return $fields;
}
}
Why? I am INSIDE the dataobject, why would this not have a value?
Thanks,
Garrett