/    Sign up×
Community /Pin to ProfileBookmark

Session object acting strange

I am setting a session object:

[code]
$_SESSION[VDH][emplead][EmpRentalUnitFiling] = new EMPRentalUnitFiling();
$_SESSION[VDH][emplead][EmpRentalUnitFiling]->DateStarted = date(“Y-m-d”);
$_SESSION[VDH][emplead][EmpRentalUnitFiling]->PropertyID = minimum_limit($_POST[propertyID]);
$_SESSION[VDH][emplead][EmpRentalUnitFiling]->PrimaryOwnerID = $_SESSION[VDH][emplead][OwnerUserID];
$_SESSION[VDH][emplead][EmpRentalUnitFiling]->Add();
[/code]

When i var_dump that object to the screen (or check if it is set) i get a nul value for that object.

Howver, if i var_dump the parent Session $_SESSION[VDH][emplead], i have that object listed, with a number sign and integer (“#3”).

so that, below is what i get when i var_dump the parent object:

[CODE]
array(3) { [“EmpRentalUnitFiling”]=> object(EMPRentalUnitFiling)#4 (16) { [“id”]=> int(37) [“DateStarted”]=> string(10) “2010-04-13” [“Completed”]=> NULL [“PropertyID”]=> string(2) “10” [“PrimaryOwnerID”]=> int(1) [“OtherOwnerIDs”]=> NULL [“PropertyManagerID”]=> NULL [“Quest25DistributePamphletsYN”]=> NULL [“CertifyTrueAndAccurate”]=> NULL [“SignersName”]=> NULL [“SignerSignature”]=> NULL [“SignerAddress1”]=> NULL [“SignerAddress2”]=> NULL [“SignerCity”]=> NULL [“SignerStateID”]=> NULL [“SignerZipCode”]=> NULL } [“OwnerUserID”]=> int(1) [“OwnerUserName”]=> string(7) “Michael” }
[/CODE]

Does anyone have experience wiht how i can just access this object ?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 13.2010 — I don't know why it should be different, but then we haven't seen the actual problematic var_dump() syntax, have we? (This may be a case where creating the single, smallest but complete piece of code that replicates the problem will help -- or immediately show you yourself where the problem is.)

On a side not (and probably not anything to do with this problem), your associative array indexes should be quoted. See "[url=http://php.net/manual/en/language.types.array.php#language.types.array.donts]Why is $foo[bar] wrong?[/url]".
×

Success!

Help @mparker1113 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...