public function createReplacement($newComment, $userId, array $otherValues = array())
    {
        $values['gto_id_respondent_track'] = $this->_gemsData['gto_id_respondent_track'];
        $values['gto_id_round']            = $this->_gemsData['gto_id_round'];
        $values['gto_id_respondent']       = $this->_gemsData['gto_id_respondent'];
        $values['gto_id_organization']     = $this->_gemsData['gto_id_organization'];
        $values['gto_id_track']            = $this->_gemsData['gto_id_track'];
        $values['gto_id_survey']           = $this->_gemsData['gto_id_survey'];
        $values['gto_round_order']         = $this->_gemsData['gto_round_order'];
        $values['gto_round_description']   = $this->_gemsData['gto_round_description'];
        $values['gto_valid_from']          = $this->_gemsData['gto_valid_from'];
        $values['gto_valid_from_manual']   = $this->_gemsData['gto_valid_from_manual'];
        $values['gto_valid_until']         = $this->_gemsData['gto_valid_until'];
        $values['gto_valid_until_manual']  = $this->_gemsData['gto_valid_until_manual'];
        $values['gto_mail_sent_date']      = $this->_gemsData['gto_mail_sent_date'];
        $values['gto_comment']             = $newComment;

        $newValues = $otherValues + $values;
        // Now make sure there are no more date objects
        foreach($newValues as &$value)
        {
            if ($value instanceof \Zend_Date) {
                $value = $value->getIso();
            }
        }

        $tokenId = $this->tracker->createToken($newValues, $userId);

        $replacementLog['gtrp_id_token_new'] = $tokenId;
        $replacementLog['gtrp_id_token_old'] = $this->_tokenId;
        $replacementLog['gtrp_created']      = new \MUtil_Db_Expr_CurrentTimestamp();
        $replacementLog['gtrp_created_by']   = $userId;

        $this->db->insert('gems__token_replacements', $replacementLog);

        return $tokenId;
    }
public function createReplacement($newComment, $userId, array $otherValues = array())
    {
        $values['gto_id_respondent_track'] = $this->_gemsData['gto_id_respondent_track'];
        $values['gto_id_round']            = $this->_gemsData['gto_id_round'];
        $values['gto_id_respondent']       = $this->_gemsData['gto_id_respondent'];
        $values['gto_id_organization']     = $this->_gemsData['gto_id_organization'];
        $values['gto_id_track']            = $this->_gemsData['gto_id_track'];
        $values['gto_id_survey']           = $this->_gemsData['gto_id_survey'];
        $values['gto_round_order']         = $this->_gemsData['gto_round_order'];
        $values['gto_round_description']   = $this->_gemsData['gto_round_description'];
        $values['gto_valid_from']          = $this->_gemsData['gto_valid_from'];
        $values['gto_valid_from_manual']   = $this->_gemsData['gto_valid_from_manual'];
        $values['gto_valid_until']         = $this->_gemsData['gto_valid_until'];
        $values['gto_valid_until_manual']  = $this->_gemsData['gto_valid_until_manual'];
        $values['gto_mail_sent_date']      = $this->_gemsData['gto_mail_sent_date'];
        $values['gto_comment']             = $newComment;

        $newValues = $otherValues + $values;
        // Now make sure there are no more date objects
        foreach($newValues as &$value)
        {
            if ($value instanceof \Zend_Date) {
                $value = $value->getIso();
            }
        }

        $tokenId = $this->tracker->createToken($newValues, $userId);

        $replacementLog['gtrp_id_token_new'] = $tokenId;
        $replacementLog['gtrp_id_token_old'] = $this->_tokenId;
        $replacementLog['gtrp_created']      = new \MUtil_Db_Expr_CurrentTimestamp();
        $replacementLog['gtrp_created_by']   = $userId;

        $this->db->insert('gems__token_replacements', $replacementLog);

        return $tokenId;
    }
public function createReplacement ( $ newComment , $ userId , array $ otherValues = array ( ) ) { $ values [ 'gto_id_respondent_track' ] = $ this -> _gemsData [ 'gto_id_respondent_track' ] ; $ values [ 'gto_id_round' ] = $ this -> _gemsData [ 'gto_id_round' ] ; $ values [ 'gto_id_respondent' ] = $ this -> _gemsData [ 'gto_id_respondent' ] ; $ values [ 'gto_id_organization' ] = $ this -> _gemsData [ 'gto_id_organization' ] ; $ values [ 'gto_id_track' ] = $ this -> _gemsData [ 'gto_id_track' ] ; $ values [ 'gto_id_survey' ] = $ this -> _gemsData [ 'gto_id_survey' ] ; $ values [ 'gto_round_order' ] = $ this -> _gemsData [ 'gto_round_order' ] ; $ values [ 'gto_round_description' ] = $ this -> _gemsData [ 'gto_round_description' ] ; $ values [ 'gto_valid_from' ] = $ this -> _gemsData [ 'gto_valid_from' ] ; $ values [ 'gto_valid_from_manual' ] = $ this -> _gemsData [ 'gto_valid_from_manual' ] ; $ values [ 'gto_valid_until' ] = $ this -> _gemsData [ 'gto_valid_until' ] ; $ values [ 'gto_valid_until_manual' ] = $ this -> _gemsData [ 'gto_valid_until_manual' ] ; $ values [ 'gto_mail_sent_date' ] = $ this -> _gemsData [ 'gto_mail_sent_date' ] ; $ values [ 'gto_comment' ] = $ newComment ; $ newValues = $ otherValues + $ values ; // Now make sure there are no more date objects foreach ( $ newValues as & $ value ) { if ( $ value instanceof \ Zend_Date ) { $ value = $ value -> getIso ( ) ; } } $ tokenId = $ this -> tracker -> createToken ( $ newValues , $ userId ) ; $ replacementLog [ 'gtrp_id_token_new' ] = $ tokenId ; $ replacementLog [ 'gtrp_id_token_old' ] = $ this -> _tokenId ; $ replacementLog [ 'gtrp_created' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; $ replacementLog [ 'gtrp_created_by' ] = $ userId ; $ this -> db -> insert ( 'gems__token_replacements' , $ replacementLog ) ; return $ tokenId ; }
Creates an almost exact copy of this token at the same place in the track,
only without answers and other source data

Returns the new token id

@param string $newComment Description of why the token was replaced
@param int $userId The current user
@param array $otherValues Other values to set in the token
@return string The new token
Creates an almost exact copy of this token at the same place in the track only without answers and other source data