getParentIdNameRelation( $parentClass, $childClass, 'has_one' ); } function getControllerJoinID() { return $this->controller->{$this->joinField}; } function saveInto( DataObject $record ) { $fieldName = $this->name; $fieldNameID = $fieldName . 'ID'; $record->$fieldNameID = 0; if( $val = $this->value[ $this->htmlListField ] ) { if( $val != 'undefined' ) $record->$fieldNameID = $val; } $record->write(); } function ExtraData() { $val = $this->getControllerJoinID() ? $this->getControllerJoinID() : ''; $inputId = $this->id() . '_' . $this->htmlListEndName; return << HTML; } } class HasOneComplexTableField_Item extends ComplexTableField_Item { function MarkingCheckbox() { $name = $this->parent->Name() . '[]'; $joinVal = $this->parent->getControllerJoinID(); $childID = $this->item->ID; if( $this->parent->IsReadOnly ) return "item->ID}\" disabled=\"disabled\"/>"; else if( $joinVal == $childID ) return "item->ID}\" checked=\"checked\"/>"; else return "item->ID}\"/>"; } } ?>