From a4e3dd7da681da3a4abf1ad4fdc58f312dd86c4f Mon Sep 17 00:00:00 2001 From: nbm Date: Thu, 29 Sep 2005 11:10:54 +0000 Subject: [PATCH] Modernise to use _FieldToSelect for KTEntity-related work. --- lib/documentmanagement/DocumentField.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+), 0 deletions(-) diff --git a/lib/documentmanagement/DocumentField.inc b/lib/documentmanagement/DocumentField.inc index 24cf027..61385db 100644 --- a/lib/documentmanagement/DocumentField.inc +++ b/lib/documentmanagement/DocumentField.inc @@ -36,6 +36,16 @@ class DocumentField extends KTEntity { var $iParentFieldset; var $bHasLookupTree; + var $_aFieldToSelect = array( + 'iId' => 'id', + 'sName' => 'name', + 'sDataType' => 'data_type', + 'bIsGeneric' => 'is_generic', + 'bHasLookup' => 'has_lookup', + 'bHasLookupTree' => 'has_lookuptree', + 'iParentFieldset' => 'parent_fieldset', + ); + // FIXME deprecate constructor use. Use DocumentField::createFromArray instead. function DocumentField($sNewName = null, $sNewDataType = null, $bNewIsGeneric = null, $bNewHasLookup = null, $iParentFieldset = null, $bHasLookupTree = null) { @@ -85,6 +95,19 @@ class DocumentField extends KTEntity { function &createFromArray($aOptions) { return KTEntityUtil::createFromArray('DocumentField', $aOptions); } + + function &getByFieldset($oFieldset) { + if (is_object($oFieldset)) { + $iFieldsetId = $oFieldset->getId(); + } else { + $iFieldsetId = $oFieldset; + } + return KTEntityUtil::getByDict('DocumentField', array( + 'parent_fieldset' => $iFieldsetId, + ), array( + 'multi' => true, + )); + } // FIXME remove &get and rather use the autogenerated version. /** -- libgit2 0.21.4