public function updateRoundModelToItem(\MUtil_Model_ModelAbstract $model, array &$itemData, $language)
    {
        $this->_ensureRounds();

        // Is this the first token?
        $first  = ! $this->getPreviousRoundId($itemData['gro_id_round'], $itemData['gro_id_order']);

        // Update the current round data
        if (isset($this->_rounds[$itemData['gro_id_round']])) {
            $this->_rounds[$itemData['gro_id_round']] = $itemData + $this->_rounds[$itemData['gro_id_round']];
        } else {
            $this->_rounds[$itemData['gro_id_round']] = $itemData;
        }

        // Default result
        $result = false;

        // VALID AFTER DATE
        
        if (! $this->_sourceUsesSurvey($itemData['gro_valid_after_source'])) {
            $model->del('gro_valid_after_id', 'label');
        } else {
            // Survey list is independent of the actual chosen source, but not
            // vice versa. So we have to set it now.
            $result = $this->applySurveyListValidAfter($model, $itemData) || $result;
        }

        // Set allowed after sources
        $result = $this->_applyOptions($model, 'gro_valid_after_source', $this->getSourceList(true, $first), $itemData) || $result;

        // Set the after date fields that can be chosen for the current values
        $result = $this->applyDatesValidAfter($model, $itemData, $language) || $result;

        // VALID FOR DATE

        // Display used survey only when appropriate
        if (! $this->_sourceUsesSurvey($itemData['gro_valid_for_source'])) {
            $model->del('gro_valid_for_id', 'label');
        } else {
            // Survey list is indepedent of the actual chosen source, but not
            // vice versa. So we have to set it now.
            $result = $this->applySurveyListValidFor($model, $itemData) || $result;
        }

        // Set allowed for sources
        $result = $this->_applyOptions($model, 'gro_valid_for_source', $this->getSourceList(false, $first), $itemData) || $result;

        // Set the for date fields that can be chosen for the current values
        $result = $this->applyDatesValidFor($model, $itemData, $language) || $result;

        // Apply respondent relation settings
        $result = $this->applyRespondentRelation($model, $itemData) || $result;

        return $result;
    }
public function updateRoundModelToItem(\MUtil_Model_ModelAbstract $model, array &$itemData, $language)
    {
        $this->_ensureRounds();

        // Is this the first token?
        $first  = ! $this->getPreviousRoundId($itemData['gro_id_round'], $itemData['gro_id_order']);

        // Update the current round data
        if (isset($this->_rounds[$itemData['gro_id_round']])) {
            $this->_rounds[$itemData['gro_id_round']] = $itemData + $this->_rounds[$itemData['gro_id_round']];
        } else {
            $this->_rounds[$itemData['gro_id_round']] = $itemData;
        }

        // Default result
        $result = false;

        // VALID AFTER DATE
        
        if (! $this->_sourceUsesSurvey($itemData['gro_valid_after_source'])) {
            $model->del('gro_valid_after_id', 'label');
        } else {
            // Survey list is independent of the actual chosen source, but not
            // vice versa. So we have to set it now.
            $result = $this->applySurveyListValidAfter($model, $itemData) || $result;
        }

        // Set allowed after sources
        $result = $this->_applyOptions($model, 'gro_valid_after_source', $this->getSourceList(true, $first), $itemData) || $result;

        // Set the after date fields that can be chosen for the current values
        $result = $this->applyDatesValidAfter($model, $itemData, $language) || $result;

        // VALID FOR DATE

        // Display used survey only when appropriate
        if (! $this->_sourceUsesSurvey($itemData['gro_valid_for_source'])) {
            $model->del('gro_valid_for_id', 'label');
        } else {
            // Survey list is indepedent of the actual chosen source, but not
            // vice versa. So we have to set it now.
            $result = $this->applySurveyListValidFor($model, $itemData) || $result;
        }

        // Set allowed for sources
        $result = $this->_applyOptions($model, 'gro_valid_for_source', $this->getSourceList(false, $first), $itemData) || $result;

        // Set the for date fields that can be chosen for the current values
        $result = $this->applyDatesValidFor($model, $itemData, $language) || $result;

        // Apply respondent relation settings
        $result = $this->applyRespondentRelation($model, $itemData) || $result;

        return $result;
    }
public function updateRoundModelToItem ( \ MUtil_Model_ModelAbstract $ model , array & $ itemData , $ language ) { $ this -> _ensureRounds ( ) ; // Is this the first token? $ first = ! $ this -> getPreviousRoundId ( $ itemData [ 'gro_id_round' ] , $ itemData [ 'gro_id_order' ] ) ; // Update the current round data if ( isset ( $ this -> _rounds [ $ itemData [ 'gro_id_round' ] ] ) ) { $ this -> _rounds [ $ itemData [ 'gro_id_round' ] ] = $ itemData + $ this -> _rounds [ $ itemData [ 'gro_id_round' ] ] ; } else { $ this -> _rounds [ $ itemData [ 'gro_id_round' ] ] = $ itemData ; } // Default result $ result = false ; // VALID AFTER DATE if ( ! $ this -> _sourceUsesSurvey ( $ itemData [ 'gro_valid_after_source' ] ) ) { $ model -> del ( 'gro_valid_after_id' , 'label' ) ; } else { // Survey list is independent of the actual chosen source, but not // vice versa. So we have to set it now. $ result = $ this -> applySurveyListValidAfter ( $ model , $ itemData ) || $ result ; } // Set allowed after sources $ result = $ this -> _applyOptions ( $ model , 'gro_valid_after_source' , $ this -> getSourceList ( true , $ first ) , $ itemData ) || $ result ; // Set the after date fields that can be chosen for the current values $ result = $ this -> applyDatesValidAfter ( $ model , $ itemData , $ language ) || $ result ; // VALID FOR DATE // Display used survey only when appropriate if ( ! $ this -> _sourceUsesSurvey ( $ itemData [ 'gro_valid_for_source' ] ) ) { $ model -> del ( 'gro_valid_for_id' , 'label' ) ; } else { // Survey list is indepedent of the actual chosen source, but not // vice versa. So we have to set it now. $ result = $ this -> applySurveyListValidFor ( $ model , $ itemData ) || $ result ; } // Set allowed for sources $ result = $ this -> _applyOptions ( $ model , 'gro_valid_for_source' , $ this -> getSourceList ( false , $ first ) , $ itemData ) || $ result ; // Set the for date fields that can be chosen for the current values $ result = $ this -> applyDatesValidFor ( $ model , $ itemData , $ language ) || $ result ; // Apply respondent relation settings $ result = $ this -> applyRespondentRelation ( $ model , $ itemData ) || $ result ; return $ result ; }
Updates the model to reflect the values for the current item data

@param \MUtil_Model_ModelAbstract $model The round model
@param array $itemData    The current items data
@param string $language   (ISO) language string
@param boolean True if the update changed values (usually by changed selection lists).
Updates the model to reflect the values for the current item data