{"action":"created","comment":{"url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/comments/59122521","id":59122521,"diff_hunk":"@@ -0,0 +1,287 @@\n+<?php\n+namespace Mongolid\\DataMapper;\n+\n+use Mongolid\\Schema;\n+use Mongolid\\Container\\Ioc;\n+use Mongolid\\Connection\\Pool;\n+use Mongolid\\Cursor\\Cursor;\n+use MongoDB\\Collection;\n+use MongoDB\\BSON\\ObjectID;\n+\n+/**\n+ * The DataMapper class will abstract how an Entity is persisted and retrieved\n+ * from the database.\n+ * The DataMapper will always use a Schema trought the SchemaMapper to parse the\n+ * document in and out of the database.\n+ *\n+ * @package  Mongolid\n+ */\n+class DataMapper\n+{\n+    /**\n+     * Name of the schema class to be used\n+     * @var string\n+     */\n+    public $schemaClass = Schema::class;\n+\n+    /**\n+     * Schema object. Will be set after the $schemaClass\n+     * @var Schema\n+     */\n+    public $schema;\n+\n+    /**\n+     * Connections that are going to be used to interact with the database\n+     * @var Pool\n+     */\n+    protected $connPool;\n+\n+    /**\n+     * @param Pool $connPool The connections that are going to be used to interact with the database.\n+     */\n+    public function __construct(Pool $connPool)\n+    {\n+        $this->connPool = $connPool;\n+    }\n+\n+    /**\n+     * Upserts the given object into database. Returns success if write concern\n+     * is acknowledged.\n+     *\n+     * @param  mixed $object The object used in the operation.\n+     *\n+     * @return boolean Success (but always false if write concern is Unacknowledged)","path":"src/Mongolid/DataMapper/DataMapper.php","position":61,"original_position":53,"commit_id":"2696d9af46d414235ea79a5076ea09094b48a5bf","original_commit_id":"ead5bff668f1101004194741ae91580e566e3096","user":{"login":"Zizaco","id":777635,"avatar_url":"https://avatars.githubusercontent.com/u/777635?v=3","gravatar_id":"","url":"https://api.github.com/users/Zizaco","html_url":"https://github.com/Zizaco","followers_url":"https://api.github.com/users/Zizaco/followers","following_url":"https://api.github.com/users/Zizaco/following{/other_user}","gists_url":"https://api.github.com/users/Zizaco/gists{/gist_id}","starred_url":"https://api.github.com/users/Zizaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zizaco/subscriptions","organizations_url":"https://api.github.com/users/Zizaco/orgs","repos_url":"https://api.github.com/users/Zizaco/repos","events_url":"https://api.github.com/users/Zizaco/events{/privacy}","received_events_url":"https://api.github.com/users/Zizaco/received_events","type":"User","site_admin":false},"body":"Yes, I agree. But for compatibility purposes, what do you think of changing this in v2.1?","created_at":"2016-04-09T22:20:18Z","updated_at":"2016-04-09T22:20:18Z","html_url":"https://github.com/leroy-merlin-br/mongolid/pull/38#discussion_r59122521","pull_request_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/comments/59122521"},"html":{"href":"https://github.com/leroy-merlin-br/mongolid/pull/38#discussion_r59122521"},"pull_request":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38","id":61849891,"html_url":"https://github.com/leroy-merlin-br/mongolid/pull/38","diff_url":"https://github.com/leroy-merlin-br/mongolid/pull/38.diff","patch_url":"https://github.com/leroy-merlin-br/mongolid/pull/38.patch","issue_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/38","number":38,"state":"open","locked":false,"title":"New Design and PHP7 support","user":{"login":"Zizaco","id":777635,"avatar_url":"https://avatars.githubusercontent.com/u/777635?v=3","gravatar_id":"","url":"https://api.github.com/users/Zizaco","html_url":"https://github.com/Zizaco","followers_url":"https://api.github.com/users/Zizaco/followers","following_url":"https://api.github.com/users/Zizaco/following{/other_user}","gists_url":"https://api.github.com/users/Zizaco/gists{/gist_id}","starred_url":"https://api.github.com/users/Zizaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zizaco/subscriptions","organizations_url":"https://api.github.com/users/Zizaco/orgs","repos_url":"https://api.github.com/users/Zizaco/repos","events_url":"https://api.github.com/users/Zizaco/events{/privacy}","received_events_url":"https://api.github.com/users/Zizaco/received_events","type":"User","site_admin":false},"body":"**W I P**","created_at":"2016-03-06T18:12:34Z","updated_at":"2016-04-09T22:20:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"GuilhermeGuitte","id":1062859,"avatar_url":"https://avatars.githubusercontent.com/u/1062859?v=3","gravatar_id":"","url":"https://api.github.com/users/GuilhermeGuitte","html_url":"https://github.com/GuilhermeGuitte","followers_url":"https://api.github.com/users/GuilhermeGuitte/followers","following_url":"https://api.github.com/users/GuilhermeGuitte/following{/other_user}","gists_url":"https://api.github.com/users/GuilhermeGuitte/gists{/gist_id}","starred_url":"https://api.github.com/users/GuilhermeGuitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuilhermeGuitte/subscriptions","organizations_url":"https://api.github.com/users/GuilhermeGuitte/orgs","repos_url":"https://api.github.com/users/GuilhermeGuitte/repos","events_url":"https://api.github.com/users/GuilhermeGuitte/events{/privacy}","received_events_url":"https://api.github.com/users/GuilhermeGuitte/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/leroy-merlin-br/mongolid/milestones/2","html_url":"https://github.com/leroy-merlin-br/mongolid/milestones/v2.0","labels_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/milestones/2/labels","id":1676026,"number":2,"title":"v2.0","description":"","creator":{"login":"Zizaco","id":777635,"avatar_url":"https://avatars.githubusercontent.com/u/777635?v=3","gravatar_id":"","url":"https://api.github.com/users/Zizaco","html_url":"https://github.com/Zizaco","followers_url":"https://api.github.com/users/Zizaco/followers","following_url":"https://api.github.com/users/Zizaco/following{/other_user}","gists_url":"https://api.github.com/users/Zizaco/gists{/gist_id}","starred_url":"https://api.github.com/users/Zizaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zizaco/subscriptions","organizations_url":"https://api.github.com/users/Zizaco/orgs","repos_url":"https://api.github.com/users/Zizaco/repos","events_url":"https://api.github.com/users/Zizaco/events{/privacy}","received_events_url":"https://api.github.com/users/Zizaco/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":9,"state":"open","created_at":"2016-03-31T13:13:42Z","updated_at":"2016-04-09T13:42:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38/commits","review_comments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38/comments","review_comment_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/38/comments","statuses_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/statuses/2696d9af46d414235ea79a5076ea09094b48a5bf","head":{"label":"leroy-merlin-br:v2.0.0","ref":"v2.0.0","sha":"2696d9af46d414235ea79a5076ea09094b48a5bf","user":{"login":"leroy-merlin-br","id":4422202,"avatar_url":"https://avatars.githubusercontent.com/u/4422202?v=3","gravatar_id":"","url":"https://api.github.com/users/leroy-merlin-br","html_url":"https://github.com/leroy-merlin-br","followers_url":"https://api.github.com/users/leroy-merlin-br/followers","following_url":"https://api.github.com/users/leroy-merlin-br/following{/other_user}","gists_url":"https://api.github.com/users/leroy-merlin-br/gists{/gist_id}","starred_url":"https://api.github.com/users/leroy-merlin-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leroy-merlin-br/subscriptions","organizations_url":"https://api.github.com/users/leroy-merlin-br/orgs","repos_url":"https://api.github.com/users/leroy-merlin-br/repos","events_url":"https://api.github.com/users/leroy-merlin-br/events{/privacy}","received_events_url":"https://api.github.com/users/leroy-merlin-br/received_events","type":"Organization","site_admin":false},"repo":{"id":9799450,"name":"mongolid","full_name":"leroy-merlin-br/mongolid","owner":{"login":"leroy-merlin-br","id":4422202,"avatar_url":"https://avatars.githubusercontent.com/u/4422202?v=3","gravatar_id":"","url":"https://api.github.com/users/leroy-merlin-br","html_url":"https://github.com/leroy-merlin-br","followers_url":"https://api.github.com/users/leroy-merlin-br/followers","following_url":"https://api.github.com/users/leroy-merlin-br/following{/other_user}","gists_url":"https://api.github.com/users/leroy-merlin-br/gists{/gist_id}","starred_url":"https://api.github.com/users/leroy-merlin-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leroy-merlin-br/subscriptions","organizations_url":"https://api.github.com/users/leroy-merlin-br/orgs","repos_url":"https://api.github.com/users/leroy-merlin-br/repos","events_url":"https://api.github.com/users/leroy-merlin-br/events{/privacy}","received_events_url":"https://api.github.com/users/leroy-merlin-br/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leroy-merlin-br/mongolid","description":"Easy, powerful and ultrafast ODM for PHP and MongoDB","fork":false,"url":"https://api.github.com/repos/leroy-merlin-br/mongolid","forks_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/forks","keys_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/teams","hooks_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/hooks","issue_events_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/events{/number}","events_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/events","assignees_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/assignees{/user}","branches_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/branches{/branch}","tags_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/tags","blobs_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/refs{/sha}","trees_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/statuses/{sha}","languages_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/languages","stargazers_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/stargazers","contributors_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/contributors","subscribers_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/subscribers","subscription_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/subscription","commits_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/commits{/sha}","git_commits_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/commits{/sha}","comments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/comments{/number}","issue_comment_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/comments{/number}","contents_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/contents/{+path}","compare_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/merges","archive_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/downloads","issues_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues{/number}","pulls_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls{/number}","milestones_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/milestones{/number}","notifications_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/labels{/name}","releases_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/releases{/id}","deployments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/deployments","created_at":"2013-05-01T20:27:54Z","updated_at":"2016-02-07T03:27:02Z","pushed_at":"2016-04-09T22:14:02Z","git_url":"git://github.com/leroy-merlin-br/mongolid.git","ssh_url":"git@github.com:leroy-merlin-br/mongolid.git","clone_url":"https://github.com/leroy-merlin-br/mongolid.git","svn_url":"https://github.com/leroy-merlin-br/mongolid","homepage":null,"size":318,"stargazers_count":16,"watchers_count":16,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":15,"forks":12,"open_issues":15,"watchers":16,"default_branch":"master"}},"base":{"label":"leroy-merlin-br:master","ref":"master","sha":"e6bbd34792fbff9e068274fad26f96748ea6e39c","user":{"login":"leroy-merlin-br","id":4422202,"avatar_url":"https://avatars.githubusercontent.com/u/4422202?v=3","gravatar_id":"","url":"https://api.github.com/users/leroy-merlin-br","html_url":"https://github.com/leroy-merlin-br","followers_url":"https://api.github.com/users/leroy-merlin-br/followers","following_url":"https://api.github.com/users/leroy-merlin-br/following{/other_user}","gists_url":"https://api.github.com/users/leroy-merlin-br/gists{/gist_id}","starred_url":"https://api.github.com/users/leroy-merlin-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leroy-merlin-br/subscriptions","organizations_url":"https://api.github.com/users/leroy-merlin-br/orgs","repos_url":"https://api.github.com/users/leroy-merlin-br/repos","events_url":"https://api.github.com/users/leroy-merlin-br/events{/privacy}","received_events_url":"https://api.github.com/users/leroy-merlin-br/received_events","type":"Organization","site_admin":false},"repo":{"id":9799450,"name":"mongolid","full_name":"leroy-merlin-br/mongolid","owner":{"login":"leroy-merlin-br","id":4422202,"avatar_url":"https://avatars.githubusercontent.com/u/4422202?v=3","gravatar_id":"","url":"https://api.github.com/users/leroy-merlin-br","html_url":"https://github.com/leroy-merlin-br","followers_url":"https://api.github.com/users/leroy-merlin-br/followers","following_url":"https://api.github.com/users/leroy-merlin-br/following{/other_user}","gists_url":"https://api.github.com/users/leroy-merlin-br/gists{/gist_id}","starred_url":"https://api.github.com/users/leroy-merlin-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leroy-merlin-br/subscriptions","organizations_url":"https://api.github.com/users/leroy-merlin-br/orgs","repos_url":"https://api.github.com/users/leroy-merlin-br/repos","events_url":"https://api.github.com/users/leroy-merlin-br/events{/privacy}","received_events_url":"https://api.github.com/users/leroy-merlin-br/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leroy-merlin-br/mongolid","description":"Easy, powerful and ultrafast ODM for PHP and MongoDB","fork":false,"url":"https://api.github.com/repos/leroy-merlin-br/mongolid","forks_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/forks","keys_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/teams","hooks_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/hooks","issue_events_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/events{/number}","events_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/events","assignees_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/assignees{/user}","branches_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/branches{/branch}","tags_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/tags","blobs_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/refs{/sha}","trees_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/statuses/{sha}","languages_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/languages","stargazers_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/stargazers","contributors_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/contributors","subscribers_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/subscribers","subscription_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/subscription","commits_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/commits{/sha}","git_commits_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/git/commits{/sha}","comments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/comments{/number}","issue_comment_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/comments{/number}","contents_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/contents/{+path}","compare_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/merges","archive_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/downloads","issues_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues{/number}","pulls_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls{/number}","milestones_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/milestones{/number}","notifications_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/labels{/name}","releases_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/releases{/id}","deployments_url":"https://api.github.com/repos/leroy-merlin-br/mongolid/deployments","created_at":"2013-05-01T20:27:54Z","updated_at":"2016-02-07T03:27:02Z","pushed_at":"2016-04-09T22:14:02Z","git_url":"git://github.com/leroy-merlin-br/mongolid.git","ssh_url":"git@github.com:leroy-merlin-br/mongolid.git","clone_url":"https://github.com/leroy-merlin-br/mongolid.git","svn_url":"https://github.com/leroy-merlin-br/mongolid","homepage":null,"size":318,"stargazers_count":16,"watchers_count":16,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":15,"forks":12,"open_issues":15,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38"},"html":{"href":"https://github.com/leroy-merlin-br/mongolid/pull/38"},"issue":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/38"},"comments":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/leroy-merlin-br/mongolid/statuses/2696d9af46d414235ea79a5076ea09094b48a5bf"}}}}