Ferreteria/v0.3/class/tMakableFieldRow
< Ferreteria | v0.3 | class
Jump to navigation
Jump to search
// PURPOSE: adds functionality to create fields as needed
trait tMakableFieldRow {
/*----
PURPOSE: sets an individual value
OVERRIDE: will create Field object if not set
*/
public function SetValue($sKey, $val) {
$oField = $this->MakeField($sKey);
$oField->SetValue($val);
}
protected function MakeField($sKey) {
$oField = NULL;
if ($this->FieldIsSet($sKey)) {
$oField = $this->RetrieveField($sKey);
}
if (is_null($oField)) {
$sClass = $this->GetClass_forField($sKey);
$oField = new $sClass($sKey,$this);
$this->SetField($oField);
}
return $oField;
}
}
- file: Template:L/ferreteria/file
- apply to: Template:L/ferreteria/class
- implements: Template:L/ferreteria/class
- used by: