Ferreteria/v0.3/class/tMakableFieldRow: Difference between revisions
< Ferreteria | v0.3 | class
Jump to navigation
Jump to search
m (Woozle moved page Ferreteria/class/tMakableFieldRow to Ferreteria/v3/class/tMakableFieldRow without leaving a redirect: this is all v3 documentation, and we still need v2) |
m (Woozle moved page Ferreteria/v3/class/tMakableFieldRow to Ferreteria/v0.3/class/tMakableFieldRow: version renumbering) |
(No difference)
|
Revision as of 15:28, 3 February 2020
// 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: