{"action":"created","comment":{"url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/comments/34482915","id":34482915,"diff_hunk":"@@ -1283,6 +1283,57 @@ public function delete($dn, $recursively = false)\n     }\n \n     /**\n+     * Delete single attributes from an LDAP-Node\n+\n+     * This method removes single attributes from a node identified by\n+     * <var>$dn>/var>. The attributes have to be given as array where the\n+     * array-key is the attribute-name and the array-value is the attribute-value\n+     * that is to be removed.\n+     *\n+     * To remove multiple entries of an attribute pass an array with the values\n+     * to be removed as value of the key.\n+     *\n+     * So if you want to remove more than one 'memberUid'-attribute you would\n+     * pass ```array('memberUid' => ['uid1', 'uid2',...]);``` as <var>$attributes</var>\n+     *\n+     * Beware that passing an empty array will remove <strong>all</strong> entries\n+     * of the attribute. Therefore you'Ll have to set the <var>$emptyAll</var>-flag!\n+     *\n+     *\n+     * @param       $dn\n+     * @param array $attributes\n+     * @param bool  $emptyAll\n+     *\n+     * @return self\n+     */\n+    public function deleteAttributes($dn, array $attributes, $emptyAll = false)\n+    {\n+        // Safety-flap: Check whether there are empty arrays that would cause\n+        // complete removal of entries without the emptyAll flag.\n+        foreach ($attributes as $key => $value) {\n+            if ($emptyAll !== true && empty($value)) {\n+                unset($attributes[$key]);\n+            }\n+        }\n+\n+        if ($dn instanceof Dn) {\n+            $dn = $dn->toString();\n+        }\n+\n+//        $resource = $this->getResource();\n+\n+        ErrorHandler::start(E_WARNING);","path":"src/Ldap.php","position":43,"original_position":43,"commit_id":"a01ff21946000cc5f6b73956f53766172cb1c32d","original_commit_id":"a01ff21946000cc5f6b73956f53766172cb1c32d","user":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"body":"I just copied the behaviour of the other methods in the class that all have the ```ErrorHandler``` around the calls to the native ```ldap_*```-functions. Not sure whether they are necessary","created_at":"2015-07-13T16:40:51Z","updated_at":"2015-07-13T16:40:51Z","html_url":"https://github.com/zendframework/zend-ldap/pull/6#discussion_r34482915","pull_request_url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/comments/34482915"},"html":{"href":"https://github.com/zendframework/zend-ldap/pull/6#discussion_r34482915"},"pull_request":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6","id":39712207,"html_url":"https://github.com/zendframework/zend-ldap/pull/6","diff_url":"https://github.com/zendframework/zend-ldap/pull/6.diff","patch_url":"https://github.com/zendframework/zend-ldap/pull/6.patch","issue_url":"https://api.github.com/repos/zendframework/zend-ldap/issues/6","number":6,"state":"open","locked":false,"title":"Adds an attribute-level delete","user":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"body":"This PR adds a way to delete on an attribute leven withou the need to\r\nremove a complete node and recreate it again.\r\n\r\nThis PR fixes issue #4","created_at":"2015-07-10T18:41:06Z","updated_at":"2015-07-13T16:40:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36ef9a90234f240f2019a9a4d8d6d1ff628d2a35","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6/commits","review_comments_url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6/comments","review_comment_url":"https://api.github.com/repos/zendframework/zend-ldap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendframework/zend-ldap/issues/6/comments","statuses_url":"https://api.github.com/repos/zendframework/zend-ldap/statuses/a01ff21946000cc5f6b73956f53766172cb1c32d","head":{"label":"heiglandreas:hotfix/issue-4","ref":"hotfix/issue-4","sha":"a01ff21946000cc5f6b73956f53766172cb1c32d","user":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"repo":{"id":36821733,"name":"zend-ldap","full_name":"heiglandreas/zend-ldap","owner":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heiglandreas/zend-ldap","description":"Ldap component from Zend Framework","fork":true,"url":"https://api.github.com/repos/heiglandreas/zend-ldap","forks_url":"https://api.github.com/repos/heiglandreas/zend-ldap/forks","keys_url":"https://api.github.com/repos/heiglandreas/zend-ldap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heiglandreas/zend-ldap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heiglandreas/zend-ldap/teams","hooks_url":"https://api.github.com/repos/heiglandreas/zend-ldap/hooks","issue_events_url":"https://api.github.com/repos/heiglandreas/zend-ldap/issues/events{/number}","events_url":"https://api.github.com/repos/heiglandreas/zend-ldap/events","assignees_url":"https://api.github.com/repos/heiglandreas/zend-ldap/assignees{/user}","branches_url":"https://api.github.com/repos/heiglandreas/zend-ldap/branches{/branch}","tags_url":"https://api.github.com/repos/heiglandreas/zend-ldap/tags","blobs_url":"https://api.github.com/repos/heiglandreas/zend-ldap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heiglandreas/zend-ldap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heiglandreas/zend-ldap/git/refs{/sha}","trees_url":"https://api.github.com/repos/heiglandreas/zend-ldap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heiglandreas/zend-ldap/statuses/{sha}","languages_url":"https://api.github.com/repos/heiglandreas/zend-ldap/languages","stargazers_url":"https://api.github.com/repos/heiglandreas/zend-ldap/stargazers","contributors_url":"https://api.github.com/repos/heiglandreas/zend-ldap/contributors","subscribers_url":"https://api.github.com/repos/heiglandreas/zend-ldap/subscribers","subscription_url":"https://api.github.com/repos/heiglandreas/zend-ldap/subscription","commits_url":"https://api.github.com/repos/heiglandreas/zend-ldap/commits{/sha}","git_commits_url":"https://api.github.com/repos/heiglandreas/zend-ldap/git/commits{/sha}","comments_url":"https://api.github.com/repos/heiglandreas/zend-ldap/comments{/number}","issue_comment_url":"https://api.github.com/repos/heiglandreas/zend-ldap/issues/comments{/number}","contents_url":"https://api.github.com/repos/heiglandreas/zend-ldap/contents/{+path}","compare_url":"https://api.github.com/repos/heiglandreas/zend-ldap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heiglandreas/zend-ldap/merges","archive_url":"https://api.github.com/repos/heiglandreas/zend-ldap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heiglandreas/zend-ldap/downloads","issues_url":"https://api.github.com/repos/heiglandreas/zend-ldap/issues{/number}","pulls_url":"https://api.github.com/repos/heiglandreas/zend-ldap/pulls{/number}","milestones_url":"https://api.github.com/repos/heiglandreas/zend-ldap/milestones{/number}","notifications_url":"https://api.github.com/repos/heiglandreas/zend-ldap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heiglandreas/zend-ldap/labels{/name}","releases_url":"https://api.github.com/repos/heiglandreas/zend-ldap/releases{/id}","created_at":"2015-06-03T18:14:35Z","updated_at":"2015-06-03T18:14:36Z","pushed_at":"2015-07-10T22:01:08Z","git_url":"git://github.com/heiglandreas/zend-ldap.git","ssh_url":"git@github.com:heiglandreas/zend-ldap.git","clone_url":"https://github.com/heiglandreas/zend-ldap.git","svn_url":"https://github.com/heiglandreas/zend-ldap","homepage":"https://github.com/zendframework/zf2","size":34027,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zendframework:master","ref":"master","sha":"962d0f6cfab985844b6779c316d6a62547bd8b0a","user":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"repo":{"id":35280810,"name":"zend-ldap","full_name":"zendframework/zend-ldap","owner":{"login":"zendframework","id":296074,"avatar_url":"https://avatars.githubusercontent.com/u/296074?v=3","gravatar_id":"","url":"https://api.github.com/users/zendframework","html_url":"https://github.com/zendframework","followers_url":"https://api.github.com/users/zendframework/followers","following_url":"https://api.github.com/users/zendframework/following{/other_user}","gists_url":"https://api.github.com/users/zendframework/gists{/gist_id}","starred_url":"https://api.github.com/users/zendframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendframework/subscriptions","organizations_url":"https://api.github.com/users/zendframework/orgs","repos_url":"https://api.github.com/users/zendframework/repos","events_url":"https://api.github.com/users/zendframework/events{/privacy}","received_events_url":"https://api.github.com/users/zendframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendframework/zend-ldap","description":"Ldap component from Zend Framework","fork":false,"url":"https://api.github.com/repos/zendframework/zend-ldap","forks_url":"https://api.github.com/repos/zendframework/zend-ldap/forks","keys_url":"https://api.github.com/repos/zendframework/zend-ldap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendframework/zend-ldap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendframework/zend-ldap/teams","hooks_url":"https://api.github.com/repos/zendframework/zend-ldap/hooks","issue_events_url":"https://api.github.com/repos/zendframework/zend-ldap/issues/events{/number}","events_url":"https://api.github.com/repos/zendframework/zend-ldap/events","assignees_url":"https://api.github.com/repos/zendframework/zend-ldap/assignees{/user}","branches_url":"https://api.github.com/repos/zendframework/zend-ldap/branches{/branch}","tags_url":"https://api.github.com/repos/zendframework/zend-ldap/tags","blobs_url":"https://api.github.com/repos/zendframework/zend-ldap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendframework/zend-ldap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendframework/zend-ldap/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendframework/zend-ldap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendframework/zend-ldap/statuses/{sha}","languages_url":"https://api.github.com/repos/zendframework/zend-ldap/languages","stargazers_url":"https://api.github.com/repos/zendframework/zend-ldap/stargazers","contributors_url":"https://api.github.com/repos/zendframework/zend-ldap/contributors","subscribers_url":"https://api.github.com/repos/zendframework/zend-ldap/subscribers","subscription_url":"https://api.github.com/repos/zendframework/zend-ldap/subscription","commits_url":"https://api.github.com/repos/zendframework/zend-ldap/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendframework/zend-ldap/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendframework/zend-ldap/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendframework/zend-ldap/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendframework/zend-ldap/contents/{+path}","compare_url":"https://api.github.com/repos/zendframework/zend-ldap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendframework/zend-ldap/merges","archive_url":"https://api.github.com/repos/zendframework/zend-ldap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendframework/zend-ldap/downloads","issues_url":"https://api.github.com/repos/zendframework/zend-ldap/issues{/number}","pulls_url":"https://api.github.com/repos/zendframework/zend-ldap/pulls{/number}","milestones_url":"https://api.github.com/repos/zendframework/zend-ldap/milestones{/number}","notifications_url":"https://api.github.com/repos/zendframework/zend-ldap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendframework/zend-ldap/labels{/name}","releases_url":"https://api.github.com/repos/zendframework/zend-ldap/releases{/id}","created_at":"2015-05-08T13:28:02Z","updated_at":"2015-06-20T11:44:23Z","pushed_at":"2015-07-10T22:01:08Z","git_url":"git://github.com/zendframework/zend-ldap.git","ssh_url":"git@github.com:zendframework/zend-ldap.git","clone_url":"https://github.com/zendframework/zend-ldap.git","svn_url":"https://github.com/zendframework/zend-ldap","homepage":"https://github.com/zendframework/zf2","size":34182,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6"},"html":{"href":"https://github.com/zendframework/zend-ldap/pull/6"},"issue":{"href":"https://api.github.com/repos/zendframework/zend-ldap/issues/6"},"comments":{"href":"https://api.github.com/repos/zendframework/zend-ldap/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendframework/zend-ldap/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/zendframework/zend-ldap/statuses/a01ff21946000cc5f6b73956f53766172cb1c32d"}}}}