Open tholder opened 13 years ago
Hi Tom,
That's weired, but I'd wagger that something else must be going on. This stuff is pretty well tested. I assume $this->company is an instantiated shanty document object?
Yes it is. I will try and get to the bottom of it when I get a mo. Possibly because $this->company has been passed over session.
Cheers Tom
On 9 Oct 2011, at 01:26, Coen Hydereply@reply.github.com wrote:
Hi Tom,
That's weired, but I'd wagger that something else must be going on. This stuff is pretty well tested. I assume $this->company is an instantiated shanty document object?
Reply to this email directly or view it on GitHub: https://github.com/coen-hyde/Shanty-Mongo/issues/41#issuecomment-2334551
Ah, yes, there would be an issue with sleeping and wakeup. Infact there aren't any sleep or wake up methods. It shouldn't be too hard to implement i'd say.
Actually, not sure this is as simple as that, I've removed the serialization and loaded a new object on each page.
$this->company is actually an object that comes from the user document.
$this->user is defined like:
protected static $_requirements = array(
'username' => array('Required'),
'forename' => array('Required'),
'email' => array('Required'),
'secret' => array('Required'),
'companies' => array('DocumentSet'),
'companies.$' => array('Document:Model_Mongo_UserCompanyAccess')
);
And $this->company is pulled from the companies documentset.
Model_Mongo_UserCompanyAccess is defined like:
protected static $_requirements = array(
'company' => array('Document:Model_Mongo_Company', 'AsReference'),
'isPrimary' => 'Required'
);
So, when a user has a document set with objects that are AsReference, does it need to refresh them some how?
Seems to be a bit of a bug/niggle when setting an object using a property setter. The following works:
The following doesn't:
It produces:
Shanty_Mongo_Exception: Property 'owner' must not be null. in /Users/tholder/Sites/listenablefe/library/Shanty/Mongo/Document.php on line 805
Model is defined with requirements like: