protected function getNewRecord()
    {
        if ($this->getDataObj()) {
            $recArr = $this->getDataObj()->newRecord();
        }
        if (!$recArr)
            return null;
        // load default values if new record value is empty
        $defaultRecArr = array();
        foreach ($this->dataPanel as $element) {
            if ($element->fieldName) {
                $defaultRecArr[$element->fieldName] = $element->getDefaultValue();
            }
        }
        foreach ($recArr as $field => $val) {
            if ($val == "" && $defaultRecArr[$field] != "") {
                $recArr[$field] = $defaultRecArr[$field];
            }
        }
        return $recArr;
    }
protected function getNewRecord()
    {
        if ($this->getDataObj()) {
            $recArr = $this->getDataObj()->newRecord();
        }
        if (!$recArr)
            return null;
        // load default values if new record value is empty
        $defaultRecArr = array();
        foreach ($this->dataPanel as $element) {
            if ($element->fieldName) {
                $defaultRecArr[$element->fieldName] = $element->getDefaultValue();
            }
        }
        foreach ($recArr as $field => $val) {
            if ($val == "" && $defaultRecArr[$field] != "") {
                $recArr[$field] = $defaultRecArr[$field];
            }
        }
        return $recArr;
    }
protected function getNewRecord ( ) { if ( $ this -> getDataObj ( ) ) { $ recArr = $ this -> getDataObj ( ) -> newRecord ( ) ; } if ( ! $ recArr ) return null ; // load default values if new record value is empty $ defaultRecArr = array ( ) ; foreach ( $ this -> dataPanel as $ element ) { if ( $ element -> fieldName ) { $ defaultRecArr [ $ element -> fieldName ] = $ element -> getDefaultValue ( ) ; } } foreach ( $ recArr as $ field => $ val ) { if ( $ val == "" && $ defaultRecArr [ $ field ] != "" ) { $ recArr [ $ field ] = $ defaultRecArr [ $ field ] ; } } return $ recArr ; }
Get new record

@return array
Get new record