{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/10793","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10793/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10793/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10793/events","html_url":"https://github.com/phalcon/cphalcon/issues/10793","id":100950339,"number":10793,"title":"Model assign function in MongoDB collection","user":{"login":"iwalkalone69","id":6930037,"avatar_url":"https://avatars.githubusercontent.com/u/6930037?v=3","gravatar_id":"","url":"https://api.github.com/users/iwalkalone69","html_url":"https://github.com/iwalkalone69","followers_url":"https://api.github.com/users/iwalkalone69/followers","following_url":"https://api.github.com/users/iwalkalone69/following{/other_user}","gists_url":"https://api.github.com/users/iwalkalone69/gists{/gist_id}","starred_url":"https://api.github.com/users/iwalkalone69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwalkalone69/subscriptions","organizations_url":"https://api.github.com/users/iwalkalone69/orgs","repos_url":"https://api.github.com/users/iwalkalone69/repos","events_url":"https://api.github.com/users/iwalkalone69/events{/privacy}","received_events_url":"https://api.github.com/users/iwalkalone69/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-08-14T07:11:06Z","updated_at":"2015-08-18T16:01:23Z","closed_at":"2015-08-18T16:01:23Z","body":"The support to assign to collection class by array like in models. I've made a collection base with that and works:\r\n\r\n    public function assign(array $data)\r\n    {\r\n        foreach ($data as $property => $value) {\r\n            if (property_exists(get_class($this), $property)) {\r\n                $this->$property = $value;\r\n            }\r\n        }\r\n    }\r\n\r\nBut probably you can adapt and improve it.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/132259228","html_url":"https://github.com/phalcon/cphalcon/issues/10793#issuecomment-132259228","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/10793","id":132259228,"user":{"login":"iwalkalone69","id":6930037,"avatar_url":"https://avatars.githubusercontent.com/u/6930037?v=3","gravatar_id":"","url":"https://api.github.com/users/iwalkalone69","html_url":"https://github.com/iwalkalone69","followers_url":"https://api.github.com/users/iwalkalone69/followers","following_url":"https://api.github.com/users/iwalkalone69/following{/other_user}","gists_url":"https://api.github.com/users/iwalkalone69/gists{/gist_id}","starred_url":"https://api.github.com/users/iwalkalone69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwalkalone69/subscriptions","organizations_url":"https://api.github.com/users/iwalkalone69/orgs","repos_url":"https://api.github.com/users/iwalkalone69/repos","events_url":"https://api.github.com/users/iwalkalone69/events{/privacy}","received_events_url":"https://api.github.com/users/iwalkalone69/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T16:01:22Z","updated_at":"2015-08-18T16:01:22Z","body":"Sorry. You're right."}}