{"action":"created","comment":{"url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/comments/242265615","pull_request_review_id":185736431,"id":242265615,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjI2NTYxNQ==","diff_hunk":"@@ -365,16 +369,68 @@ protected function getClassConfiguration($meta)\n             $cacheId = $this->generateCacheId($meta->name);\n \n             if (false === $config = $cacheDriver->fetch($cacheId)) {\n-                $this->configs[$meta->name] = $this->reader->read($meta);\n+                $this->configs[$meta->name] = $this->getAuditableSettings($meta);\n \n                 return $this->configs[$meta->name];\n             }\n         }\n \n         // Re-fetch metadata on cache miss\n-        $this->configs[$meta->name] = $this->reader->read($meta);\n+        $this->configs[$meta->name] = $this->getAuditableSettings($meta);\n \n         return $this->configs[$meta->name];\n     }\n \n+    /**\n+     * Build class configuration\n+     *\n+     * @param ClassMetadataInfo $meta Class metadata\n+     *\n+     * @throws InvalidMappingException\n+     *\n+     * @return array\n+     */\n+    private function getAuditableSettings(ClassMetadataInfo $meta)\n+    {\n+        // if class has no parent, just return its configuration\n+        // or read configuration for each parent class in inheritance chain,\n+        // validate, merge them and return otherwise\n+        if (empty($meta->parentClasses)) {\n+            return $this->reader->read($meta->name);\n+        }\n+\n+        $configurationToMergeMap = [$meta->name => $this->reader->read($meta->name)];\n+        // 2. Retrieve all parent classes configuration\n+        foreach ($meta->parentClasses as $parentClass) {\n+            $configurationToMergeMap[$parentClass] = $this->reader->read($parentClass);\n+        }\n+\n+        // 3. Validate configuration inheritance\n+        $isChangelogPropertyConfigured = false;\n+        foreach ($configurationToMergeMap as $className => $classConfiguration) {\n+            if (array_key_exists('commentProperty', $classConfiguration)) {\n+                if ($isChangelogPropertyConfigured) {\n+                    throw new InvalidMappingException(\"Cannot override `commentProperty` for entity annotation in `$className`, it's already set in parent class.\");\n+                }\n+\n+                $isChangelogPropertyConfigured = true;\n+            }\n+        }\n+\n+        // 4. Build final class configuration: perform configuration inheritance\n+        return call_user_func_array('array_merge_recursive', $configurationToMergeMap);","path":"Event/AuditableListener.php","position":253,"original_position":253,"commit_id":"f816a5b3ef344215f22ad750745ca6c9a4666599","original_commit_id":"f816a5b3ef344215f22ad750745ca6c9a4666599","user":{"login":"Cosmologist","id":966525,"node_id":"MDQ6VXNlcjk2NjUyNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/966525?v=4","gravatar_id":"","url":"https://api.github.com/users/Cosmologist","html_url":"https://github.com/Cosmologist","followers_url":"https://api.github.com/users/Cosmologist/followers","following_url":"https://api.github.com/users/Cosmologist/following{/other_user}","gists_url":"https://api.github.com/users/Cosmologist/gists{/gist_id}","starred_url":"https://api.github.com/users/Cosmologist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cosmologist/subscriptions","organizations_url":"https://api.github.com/users/Cosmologist/orgs","repos_url":"https://api.github.com/users/Cosmologist/repos","events_url":"https://api.github.com/users/Cosmologist/events{/privacy}","received_events_url":"https://api.github.com/users/Cosmologist/received_events","type":"User","site_admin":false},"body":"оверхед - лучше вызвать напрямую","created_at":"2018-12-17T18:34:52Z","updated_at":"2018-12-17T18:34:52Z","html_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2#discussion_r242265615","pull_request_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/comments/242265615"},"html":{"href":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2#discussion_r242265615"},"pull_request":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2","id":236788286,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2Nzg4Mjg2","html_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2","diff_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2.diff","patch_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2.patch","issue_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/2","number":2,"state":"open","locked":false,"title":"feature-001: class configuration inheritance","user":{"login":"unsektor","id":529297,"node_id":"MDQ6VXNlcjUyOTI5Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/529297?v=4","gravatar_id":"","url":"https://api.github.com/users/unsektor","html_url":"https://github.com/unsektor","followers_url":"https://api.github.com/users/unsektor/followers","following_url":"https://api.github.com/users/unsektor/following{/other_user}","gists_url":"https://api.github.com/users/unsektor/gists{/gist_id}","starred_url":"https://api.github.com/users/unsektor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unsektor/subscriptions","organizations_url":"https://api.github.com/users/unsektor/orgs","repos_url":"https://api.github.com/users/unsektor/repos","events_url":"https://api.github.com/users/unsektor/events{/privacy}","received_events_url":"https://api.github.com/users/unsektor/received_events","type":"User","site_admin":false},"body":"Default behaviour for child classes that uses auditable is to inherit\r\nparent class configuration, it's useful for `Single Table Inheritance`\r\nor `Class Table Inheritance` entity inheritance type","created_at":"2018-12-07T08:26:20Z","updated_at":"2018-12-17T18:34:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"606df668d4e85feb5d59efb6cf0e3bbe799b7192","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2/commits","review_comments_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2/comments","review_comment_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/2/comments","statuses_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/statuses/f816a5b3ef344215f22ad750745ca6c9a4666599","head":{"label":"unsektor:feature-001","ref":"feature-001","sha":"f816a5b3ef344215f22ad750745ca6c9a4666599","user":{"login":"unsektor","id":529297,"node_id":"MDQ6VXNlcjUyOTI5Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/529297?v=4","gravatar_id":"","url":"https://api.github.com/users/unsektor","html_url":"https://github.com/unsektor","followers_url":"https://api.github.com/users/unsektor/followers","following_url":"https://api.github.com/users/unsektor/following{/other_user}","gists_url":"https://api.github.com/users/unsektor/gists{/gist_id}","starred_url":"https://api.github.com/users/unsektor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unsektor/subscriptions","organizations_url":"https://api.github.com/users/unsektor/orgs","repos_url":"https://api.github.com/users/unsektor/repos","events_url":"https://api.github.com/users/unsektor/events{/privacy}","received_events_url":"https://api.github.com/users/unsektor/received_events","type":"User","site_admin":false},"repo":{"id":160525785,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA1MjU3ODU=","name":"doctrine-auditable-bundle","full_name":"unsektor/doctrine-auditable-bundle","private":false,"owner":{"login":"unsektor","id":529297,"node_id":"MDQ6VXNlcjUyOTI5Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/529297?v=4","gravatar_id":"","url":"https://api.github.com/users/unsektor","html_url":"https://github.com/unsektor","followers_url":"https://api.github.com/users/unsektor/followers","following_url":"https://api.github.com/users/unsektor/following{/other_user}","gists_url":"https://api.github.com/users/unsektor/gists{/gist_id}","starred_url":"https://api.github.com/users/unsektor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unsektor/subscriptions","organizations_url":"https://api.github.com/users/unsektor/orgs","repos_url":"https://api.github.com/users/unsektor/repos","events_url":"https://api.github.com/users/unsektor/events{/privacy}","received_events_url":"https://api.github.com/users/unsektor/received_events","type":"User","site_admin":false},"html_url":"https://github.com/unsektor/doctrine-auditable-bundle","description":"Symony2 bundle for doctrine2 entity changes audit","fork":true,"url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle","forks_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/forks","keys_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/teams","hooks_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/hooks","issue_events_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/events","assignees_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/tags","blobs_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/languages","stargazers_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/stargazers","contributors_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/contributors","subscribers_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/subscribers","subscription_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/subscription","commits_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/merges","archive_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/downloads","issues_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/labels{/name}","releases_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/unsektor/doctrine-auditable-bundle/deployments","created_at":"2018-12-05T13:53:59Z","updated_at":"2018-12-05T13:54:01Z","pushed_at":"2018-12-14T11:22:57Z","git_url":"git://github.com/unsektor/doctrine-auditable-bundle.git","ssh_url":"git@github.com:unsektor/doctrine-auditable-bundle.git","clone_url":"https://github.com/unsektor/doctrine-auditable-bundle.git","svn_url":"https://github.com/unsektor/doctrine-auditable-bundle","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GlobalTradingTechnologies:master","ref":"master","sha":"671569974f02ab8bcfd2f6ddb9fefa75d06e6b2c","user":{"login":"GlobalTradingTechnologies","id":9194080,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTQwODA=","avatar_url":"https://avatars0.githubusercontent.com/u/9194080?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalTradingTechnologies","html_url":"https://github.com/GlobalTradingTechnologies","followers_url":"https://api.github.com/users/GlobalTradingTechnologies/followers","following_url":"https://api.github.com/users/GlobalTradingTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/GlobalTradingTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalTradingTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalTradingTechnologies/subscriptions","organizations_url":"https://api.github.com/users/GlobalTradingTechnologies/orgs","repos_url":"https://api.github.com/users/GlobalTradingTechnologies/repos","events_url":"https://api.github.com/users/GlobalTradingTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalTradingTechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":93394808,"node_id":"MDEwOlJlcG9zaXRvcnk5MzM5NDgwOA==","name":"doctrine-auditable-bundle","full_name":"GlobalTradingTechnologies/doctrine-auditable-bundle","private":false,"owner":{"login":"GlobalTradingTechnologies","id":9194080,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTQwODA=","avatar_url":"https://avatars0.githubusercontent.com/u/9194080?v=4","gravatar_id":"","url":"https://api.github.com/users/GlobalTradingTechnologies","html_url":"https://github.com/GlobalTradingTechnologies","followers_url":"https://api.github.com/users/GlobalTradingTechnologies/followers","following_url":"https://api.github.com/users/GlobalTradingTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/GlobalTradingTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/GlobalTradingTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GlobalTradingTechnologies/subscriptions","organizations_url":"https://api.github.com/users/GlobalTradingTechnologies/orgs","repos_url":"https://api.github.com/users/GlobalTradingTechnologies/repos","events_url":"https://api.github.com/users/GlobalTradingTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/GlobalTradingTechnologies/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle","description":"Symony2 bundle for doctrine2 entity changes audit","fork":false,"url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle","forks_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/forks","keys_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/teams","hooks_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/hooks","issue_events_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/events","assignees_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/tags","blobs_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/languages","stargazers_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/stargazers","contributors_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/contributors","subscribers_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/subscribers","subscription_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/subscription","commits_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/merges","archive_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/downloads","issues_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/labels{/name}","releases_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/deployments","created_at":"2017-06-05T10:58:00Z","updated_at":"2017-11-01T12:30:03Z","pushed_at":"2018-12-14T11:22:58Z","git_url":"git://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle.git","ssh_url":"git@github.com:GlobalTradingTechnologies/doctrine-auditable-bundle.git","clone_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle.git","svn_url":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle","homepage":null,"size":12,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2"},"html":{"href":"https://github.com/GlobalTradingTechnologies/doctrine-auditable-bundle/pull/2"},"issue":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/2"},"comments":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/GlobalTradingTechnologies/doctrine-auditable-bundle/statuses/f816a5b3ef344215f22ad750745ca6c9a4666599"}},"author_association":"NONE"}}
{"actor":{"display_login":"Cosmologist"}}