Commit a4e3dd7da681da3a4abf1ad4fdc58f312dd86c4f
1 parent
af1e2d2f
Modernise to use _FieldToSelect for KTEntity-related work.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3670 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
23 additions
and
0 deletions
lib/documentmanagement/DocumentField.inc
| ... | ... | @@ -36,6 +36,16 @@ class DocumentField extends KTEntity { |
| 36 | 36 | var $iParentFieldset; |
| 37 | 37 | var $bHasLookupTree; |
| 38 | 38 | |
| 39 | + var $_aFieldToSelect = array( | |
| 40 | + 'iId' => 'id', | |
| 41 | + 'sName' => 'name', | |
| 42 | + 'sDataType' => 'data_type', | |
| 43 | + 'bIsGeneric' => 'is_generic', | |
| 44 | + 'bHasLookup' => 'has_lookup', | |
| 45 | + 'bHasLookupTree' => 'has_lookuptree', | |
| 46 | + 'iParentFieldset' => 'parent_fieldset', | |
| 47 | + ); | |
| 48 | + | |
| 39 | 49 | // FIXME deprecate constructor use. Use DocumentField::createFromArray instead. |
| 40 | 50 | function DocumentField($sNewName = null, $sNewDataType = null, $bNewIsGeneric = null, $bNewHasLookup = null, $iParentFieldset = null, $bHasLookupTree = null) { |
| 41 | 51 | |
| ... | ... | @@ -85,6 +95,19 @@ class DocumentField extends KTEntity { |
| 85 | 95 | function &createFromArray($aOptions) { |
| 86 | 96 | return KTEntityUtil::createFromArray('DocumentField', $aOptions); |
| 87 | 97 | } |
| 98 | + | |
| 99 | + function &getByFieldset($oFieldset) { | |
| 100 | + if (is_object($oFieldset)) { | |
| 101 | + $iFieldsetId = $oFieldset->getId(); | |
| 102 | + } else { | |
| 103 | + $iFieldsetId = $oFieldset; | |
| 104 | + } | |
| 105 | + return KTEntityUtil::getByDict('DocumentField', array( | |
| 106 | + 'parent_fieldset' => $iFieldsetId, | |
| 107 | + ), array( | |
| 108 | + 'multi' => true, | |
| 109 | + )); | |
| 110 | + } | |
| 88 | 111 | |
| 89 | 112 | // FIXME remove &get and rather use the autogenerated version. |
| 90 | 113 | /** | ... | ... |