src/Common/Model/Base.php
protected function autoSaveExpandableFieldsExtract(array &$aData)
    {
        $aFields           = [];
        $aOut              = [];
        $aExpandableFields = $this->getExpandableFields();

        foreach ($aExpandableFields as $oField) {
            if ($oField->auto_save) {
                $aFields[$oField->trigger] = $oField;
            }
        }

        foreach ($aData as $sKey => $mValue) {
            if (array_key_exists($sKey, $aFields)) {
                $aOut[$sKey]       = $aFields[$sKey];
                $aOut[$sKey]->data = $mValue;
                unset($aData[$sKey]);
            }
        }

        return $aOut;
    }
protected function autoSaveExpandableFieldsExtract(array &$aData)
    {
        $aFields           = [];
        $aOut              = [];
        $aExpandableFields = $this->getExpandableFields();

        foreach ($aExpandableFields as $oField) {
            if ($oField->auto_save) {
                $aFields[$oField->trigger] = $oField;
            }
        }

        foreach ($aData as $sKey => $mValue) {
            if (array_key_exists($sKey, $aFields)) {
                $aOut[$sKey]       = $aFields[$sKey];
                $aOut[$sKey]->data = $mValue;
                unset($aData[$sKey]);
            }
        }

        return $aOut;
    }
protected function autoSaveExpandableFieldsExtract ( array & $ aData ) { $ aFields = [ ] ; $ aOut = [ ] ; $ aExpandableFields = $ this -> getExpandableFields ( ) ; foreach ( $ aExpandableFields as $ oField ) { if ( $ oField -> auto_save ) { $ aFields [ $ oField -> trigger ] = $ oField ; } } foreach ( $ aData as $ sKey => $ mValue ) { if ( array_key_exists ( $ sKey , $ aFields ) ) { $ aOut [ $ sKey ] = $ aFields [ $ sKey ] ; $ aOut [ $ sKey ] -> data = $ mValue ; unset ( $ aData [ $ sKey ] ) ; } } return $ aOut ; }
Extracts any autosaveable expandable fields and unsets them from the main array

@param array $aData The data passed to create() or update()

@return array
Extracts any autosaveable expandable fields and unsets them from the main array