private function _create_link_receipt(&$receipt, &$token, &$target) { if (!array_key_exists('create_status', $this->_request_data)) { $this->_request_data['create_status'] = array('receipts' => array(), 'links' => array()); } //Store the click in database $link = new org_openpsa_directmarketing_link_log_dba(); $link->person = $receipt->person; $link->message = $receipt->message; $link->target = $target; $link->token = $token; $this->_request_data['create_status']['links'][$target] = $link->create(); //Create received and read receipts $read_receipt = new org_openpsa_directmarketing_campaign_messagereceipt_dba(); $read_receipt->person = $receipt->person; $read_receipt->message = $receipt->message; $read_receipt->token = $token; $read_receipt->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_messagereceipt_dba::RECEIVED; $this->_request_data['create_status']['receipts'][$token] = $read_receipt->create(); }