{"comment":{"created_at":"2011-10-09T01:01:41Z","body":"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.\r\n\r\nCheers\r\nTom\r\n\r\nOn 9 Oct 2011, at 01:26, Coen Hyde<reply@reply.github.com> wrote:\r\n\r\n> Hi Tom,\r\n> \r\n> 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?\r\n> \r\n> -- \r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/coen-hyde/Shanty-Mongo/issues/41#issuecomment-2334551","updated_at":"2011-10-09T01:01:41Z","url":"https://api.github.com/repos/coen-hyde/Shanty-Mongo/issues/comments/2334657","id":2334657,"user":{"avatar_url":"https://secure.gravatar.com/avatar/0b668da31995d4dfb4b2e3a66b68fb61?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/tholder","id":41235,"login":"tholder"}},"action":"created","issue":{"number":41,"created_at":"2011-10-08T21:42:22Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Seems to be a bit of a bug/niggle when setting an object using a property setter. The following works:\r\n\r\n                $data = array();\r\n                $data['appName'] = $this->_getParam('appName');\r\n                $data['urlKey'] = $this->_getParam('urlKey');\r\n                $data['owner'] = $this->company;\r\n                $data['createdBy'] = $this->user;\r\n                \r\n\t\t\t\t$app = new Model_Mongo_Application($data);\r\n\t\t\t\t$app->save();\r\n\r\nThe following doesn't:\r\n\r\n\t\t\t\t$app = new Model_Mongo_Application();\r\n\t\t\t\t$app->appName = $this->_getParam('appName');\r\n\t\t\t\t$app->urlKey = $this->_getParam('urlKey');\r\n\t\t\t\t$app->owner = $this->company;\r\n\t\t\t\t$app->createdBy = $this->user;\r\n\t\t\t\t$app->save();\r\n\r\nIt produces:\r\n\r\nShanty_Mongo_Exception: Property 'owner' must not be null. in /Users/tholder/Sites/listenablefe/library/Shanty/Mongo/Document.php on line 805\r\n\r\nModel is defined with requirements like:\r\n\r\n\tprotected static $_requirements = array(\r\n        'appName' => array('Required'),\r\n        'urlKey' => array('Required'),\r\n        'owner' => array('Document:Model_Mongo_Company', 'AsReference', 'Required'),\r\n        'createdBy' => array('Document:Model_Mongo_User', 'AsReference', 'Required')\r\n    );","comments":2,"title":"Issue setting AsReference object through property","updated_at":"2011-10-09T01:01:41Z","url":"https://api.github.com/repos/coen-hyde/Shanty-Mongo/issues/41","id":1854026,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/0b668da31995d4dfb4b2e3a66b68fb61?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/tholder","id":41235,"login":"tholder"},"html_url":"https://github.com/coen-hyde/Shanty-Mongo/issues/41","labels":[],"state":"open"},"legacy":{"issue_id":1854026,"comment_id":2334657}}