Skip to content

Commit 90e577c

Browse files
committed
feature symfony#18492 [LDAP] Check whether an entry attribute exists (hiddewie)
This PR was merged into the 3.1-dev branch. Discussion ---------- [LDAP] Check whether an entry attribute exists | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Currently a method exists for getting the value of an attribute. It would make the Entry class more complete to be able to simply test if an attribute exists in the entry. Commits ------- 56ef8a0 [LDAP] Check whether an entry attribute exists
2 parents becdbd9 + 56ef8a0 commit 90e577c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/Ldap/Entry.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ public function getDn()
3535
return $this->dn;
3636
}
3737

38+
/**
39+
* Returns whether an attribute exists.
40+
*
41+
* @param $name string The name of the attribute
42+
*
43+
* @return bool
44+
*/
45+
public function hasAttribute($name)
46+
{
47+
return isset($this->attributes[$name]);
48+
}
49+
3850
/**
3951
* Returns a specific attribute's value.
4052
*

0 commit comments

Comments
 (0)