Jump to content

Recommended Posts

Ok, I'm admittedly new to php. This seems like a small thing, but it doesn't appear to work in php.

 

class mcuTransBuilder {

public $mcuToken;
public $userToken;

public $common;

function __construct() {
	//create a single Common Parameter class.
	$common = new buildCommonTrans();
	print "constructor	object created";
}

/* Sets mcu returned tokens for future transactions */
function setSessionTokens($MCU, $User) {
	print "Inside function";
	$this->common->setTokens($MCU,$User);
}

function createLogin($loginName, $password) {
	$login = new buildTrans_Login();
	return $login->buildXMLString($loginName,$password, $common);
}
}

 

Basically common is another class that is supposed to hold and do a few functions that will be used in a lot of other calls. However, for some reason when I try to call setTokens in the setSessionTokens method it just stops processing there. I can do the call in the constructor fine, but I'd really like to know why it won't do it in another method. I've tried it several different ways in terms of syntax, so I'm thinking something else is at work here.

Link to comment
https://forums.phpfreaks.com/topic/133245-problem-using-classes/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.