public function processBeforeSave(array $row)
    {
        if ($this->getMeta('nested', false)) {
            $nestedNames = $this->getMeta('nestedNames');
            foreach($nestedNames as $nestedName) {
                if (isset($row[$nestedName])) {
                    foreach($row[$nestedName] as $key => $answer) {
                        $a = array_shift($answer);
                        if (empty($a)) {
                            unset($row[$nestedName][$key]);
                        }
                    }
                }
            }
        }

        if (!isset($row['gto_completion_time']) || $row['gto_completion_time']) {
            $row['gto_completion_time'] = new \MUtil_Date;
        }

        $row = parent::processBeforeSave($row);

        return $row;
    }
public function processBeforeSave(array $row)
    {
        if ($this->getMeta('nested', false)) {
            $nestedNames = $this->getMeta('nestedNames');
            foreach($nestedNames as $nestedName) {
                if (isset($row[$nestedName])) {
                    foreach($row[$nestedName] as $key => $answer) {
                        $a = array_shift($answer);
                        if (empty($a)) {
                            unset($row[$nestedName][$key]);
                        }
                    }
                }
            }
        }

        if (!isset($row['gto_completion_time']) || $row['gto_completion_time']) {
            $row['gto_completion_time'] = new \MUtil_Date;
        }

        $row = parent::processBeforeSave($row);

        return $row;
    }
public function processBeforeSave ( array $ row ) { if ( $ this -> getMeta ( 'nested' , false ) ) { $ nestedNames = $ this -> getMeta ( 'nestedNames' ) ; foreach ( $ nestedNames as $ nestedName ) { if ( isset ( $ row [ $ nestedName ] ) ) { foreach ( $ row [ $ nestedName ] as $ key => $ answer ) { $ a = array_shift ( $ answer ) ; if ( empty ( $ a ) ) { unset ( $ row [ $ nestedName ] [ $ key ] ) ; } } } } } if ( ! isset ( $ row [ 'gto_completion_time' ] ) || $ row [ 'gto_completion_time' ] ) { $ row [ 'gto_completion_time' ] = new \ MUtil_Date ; } $ row = parent :: processBeforeSave ( $ row ) ; return $ row ; }
Helper function that procesess the raw data before a save.

@param array $row Row array containing saved (and maybe not saved data)
@return array Nested
Helper function that procesess the raw data before a save .