{"action":"created","comment":{"url":"https://api.github.com/repos/dantleech/sulu/pulls/comments/61741082","id":61741082,"diff_hunk":"@@ -0,0 +1,459 @@\n+<?php\n+\n+/*\n+ * This file is part of Sulu.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+namespace Sulu\\Component\\Content\\Document;\n+\n+use Sulu\\Bundle\\ContentBundle\\Document\\RouteDocument;\n+use Sulu\\Bundle\\DocumentManagerBundle\\Bridge\\DocumentInspector;\n+use Sulu\\Bundle\\DocumentManagerBundle\\Bridge\\DocumentManagerRegistry;\n+use Sulu\\Bundle\\DocumentManagerBundle\\Bridge\\PropertyEncoder;\n+use Sulu\\Component\\Content\\Document\\Behavior\\ResourceSegmentBehavior;\n+use Sulu\\Component\\Content\\Document\\Behavior\\SynchronizeBehavior;\n+use Sulu\\Component\\Content\\Document\\Syncronization\\DocumentRegistrator;\n+use Sulu\\Component\\DocumentManager\\Behavior\\Mapping\\LocaleBehavior;\n+use Sulu\\Component\\Content\\Document\\Syncronization\\Mapping;\n+use Sulu\\Component\\DocumentManager\\DocumentManagerInterface;\n+use Sulu\\Component\\DocumentManager\\DocumentManagerContext;\n+use Psr\\Log\\LoggerInterface;\n+use PHPCR\\Util\\PathHelper;\n+\n+/**\n+ * The synchronization manager handles the synchronization of documents\n+ * from the DEFAULT document manger to the PUBLISH document manager.\n+ *\n+ * NOTE: In the future multiple target document managers may be supported.\n+ */\n+class SynchronizationManager\n+{\n+    const PASSIVE_MANAGER_NAME = '_passive_default_manager';\n+\n+    /**\n+     * @var DocumentManagerRegistryInterface\n+     */\n+    private $registry;\n+\n+    /**\n+     * @var PropertyEncoder\n+     */\n+    private $encoder;\n+\n+    /**\n+     * @var string\n+     */\n+    private $targetContextName;\n+\n+    /**\n+     * @var DocumentRegistrator\n+     */\n+    private $registrator;\n+\n+    /**\n+     * @var array\n+     */\n+    private $mapping;\n+\n+    /**\n+     * @var LoggerInterface\n+     */\n+    private $logger;\n+\n+    public function __construct(\n+        DocumentManagerRegistry $registry,\n+        PropertyEncoder $encoder,\n+        $targetContextName,\n+        Mapping $mapping,\n+        $registrator = null,\n+        LoggerInterface $logger = null","path":"src/Sulu/Component/Content/Document/SynchronizationManager.php","position":74,"original_position":74,"commit_id":"e226c3b744e3d65f0ec41bd1a4a4defec5e49856","original_commit_id":"e226c3b744e3d65f0ec41bd1a4a4defec5e49856","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"What do you mean?","created_at":"2016-05-02T13:56:22Z","updated_at":"2016-05-02T13:56:22Z","html_url":"https://github.com/dantleech/sulu/pull/2#discussion_r61741082","pull_request_url":"https://api.github.com/repos/dantleech/sulu/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/comments/61741082"},"html":{"href":"https://github.com/dantleech/sulu/pull/2#discussion_r61741082"},"pull_request":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/dantleech/sulu/pulls/2","id":66158709,"html_url":"https://github.com/dantleech/sulu/pull/2","diff_url":"https://github.com/dantleech/sulu/pull/2.diff","patch_url":"https://github.com/dantleech/sulu/pull/2.patch","issue_url":"https://api.github.com/repos/dantleech/sulu/issues/2","number":2,"state":"open","locked":false,"title":"Document Manager Sync.","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"### Implemented:\r\n\r\n- [x] Named document managers: Would make debugging much easier.\r\n- [x] Option to disable/enable the subscriber.\r\n- [x] Rename `publish` config key to `synchronize`\r\n- [x] Remove `syncrhonizeSingle` / `synchronizeFull` - should be `push` with option to flush managers.\r\n- [x] Remove \"publish document manager\" (PDM) concept. We should generalize.\r\n\r\n### TODO:\r\n\r\n- [ ] Consider removing `SynchronizeBehavior` - all documents should be syncrhonized by default regardless of the interface they implement - however we then need to implicitly add the `synchronized-managers` field.","created_at":"2016-04-12T13:38:44Z","updated_at":"2016-05-02T13:56:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"476b9359657b5a6a31ac10bde72af5b94ad8e34d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dantleech/sulu/pulls/2/commits","review_comments_url":"https://api.github.com/repos/dantleech/sulu/pulls/2/comments","review_comment_url":"https://api.github.com/repos/dantleech/sulu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dantleech/sulu/issues/2/comments","statuses_url":"https://api.github.com/repos/dantleech/sulu/statuses/e226c3b744e3d65f0ec41bd1a4a4defec5e49856","head":{"label":"dantleech:dm_sync","ref":"dm_sync","sha":"e226c3b744e3d65f0ec41bd1a4a4defec5e49856","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"repo":{"id":21705580,"name":"sulu","full_name":"dantleech/sulu","owner":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dantleech/sulu","description":"Sulu 2.0 core bundle & components","fork":true,"url":"https://api.github.com/repos/dantleech/sulu","forks_url":"https://api.github.com/repos/dantleech/sulu/forks","keys_url":"https://api.github.com/repos/dantleech/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dantleech/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dantleech/sulu/teams","hooks_url":"https://api.github.com/repos/dantleech/sulu/hooks","issue_events_url":"https://api.github.com/repos/dantleech/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/dantleech/sulu/events","assignees_url":"https://api.github.com/repos/dantleech/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/dantleech/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/dantleech/sulu/tags","blobs_url":"https://api.github.com/repos/dantleech/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dantleech/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dantleech/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/dantleech/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dantleech/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/dantleech/sulu/languages","stargazers_url":"https://api.github.com/repos/dantleech/sulu/stargazers","contributors_url":"https://api.github.com/repos/dantleech/sulu/contributors","subscribers_url":"https://api.github.com/repos/dantleech/sulu/subscribers","subscription_url":"https://api.github.com/repos/dantleech/sulu/subscription","commits_url":"https://api.github.com/repos/dantleech/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/dantleech/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/dantleech/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/dantleech/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/dantleech/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/dantleech/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dantleech/sulu/merges","archive_url":"https://api.github.com/repos/dantleech/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dantleech/sulu/downloads","issues_url":"https://api.github.com/repos/dantleech/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/dantleech/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/dantleech/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/dantleech/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dantleech/sulu/labels{/name}","releases_url":"https://api.github.com/repos/dantleech/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/dantleech/sulu/deployments","created_at":"2014-07-10T18:30:43Z","updated_at":"2016-03-14T15:37:38Z","pushed_at":"2016-04-29T13:45:09Z","git_url":"git://github.com/dantleech/sulu.git","ssh_url":"git@github.com:dantleech/sulu.git","clone_url":"https://github.com/dantleech/sulu.git","svn_url":"https://github.com/dantleech/sulu","homepage":"www.sulu.io","size":66943,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"dantleech:document_context","ref":"document_context","sha":"93c3134bb3adaa45f0b754668f3cf0d14901125c","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"repo":{"id":21705580,"name":"sulu","full_name":"dantleech/sulu","owner":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dantleech/sulu","description":"Sulu 2.0 core bundle & components","fork":true,"url":"https://api.github.com/repos/dantleech/sulu","forks_url":"https://api.github.com/repos/dantleech/sulu/forks","keys_url":"https://api.github.com/repos/dantleech/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dantleech/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dantleech/sulu/teams","hooks_url":"https://api.github.com/repos/dantleech/sulu/hooks","issue_events_url":"https://api.github.com/repos/dantleech/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/dantleech/sulu/events","assignees_url":"https://api.github.com/repos/dantleech/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/dantleech/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/dantleech/sulu/tags","blobs_url":"https://api.github.com/repos/dantleech/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dantleech/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dantleech/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/dantleech/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dantleech/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/dantleech/sulu/languages","stargazers_url":"https://api.github.com/repos/dantleech/sulu/stargazers","contributors_url":"https://api.github.com/repos/dantleech/sulu/contributors","subscribers_url":"https://api.github.com/repos/dantleech/sulu/subscribers","subscription_url":"https://api.github.com/repos/dantleech/sulu/subscription","commits_url":"https://api.github.com/repos/dantleech/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/dantleech/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/dantleech/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/dantleech/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/dantleech/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/dantleech/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dantleech/sulu/merges","archive_url":"https://api.github.com/repos/dantleech/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dantleech/sulu/downloads","issues_url":"https://api.github.com/repos/dantleech/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/dantleech/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/dantleech/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/dantleech/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dantleech/sulu/labels{/name}","releases_url":"https://api.github.com/repos/dantleech/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/dantleech/sulu/deployments","created_at":"2014-07-10T18:30:43Z","updated_at":"2016-03-14T15:37:38Z","pushed_at":"2016-04-29T13:45:09Z","git_url":"git://github.com/dantleech/sulu.git","ssh_url":"git@github.com:dantleech/sulu.git","clone_url":"https://github.com/dantleech/sulu.git","svn_url":"https://github.com/dantleech/sulu","homepage":"www.sulu.io","size":66943,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/2"},"html":{"href":"https://github.com/dantleech/sulu/pull/2"},"issue":{"href":"https://api.github.com/repos/dantleech/sulu/issues/2"},"comments":{"href":"https://api.github.com/repos/dantleech/sulu/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dantleech/sulu/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/dantleech/sulu/statuses/e226c3b744e3d65f0ec41bd1a4a4defec5e49856"}}}}