Zend_Ldap_Attribute::attributeHasValue PHP Method

attributeHasValue() public static method

Checks if the given value(s) exist in the attribute
public static attributeHasValue ( array &$data, string $attribName, mixed | array $value ) : boolean
$data array
$attribName string
$value mixed | array
return boolean
    public static function attributeHasValue(array &$data, $attribName, $value)
    {
        $attribName = strtolower($attribName);
        if (!isset($data[$attribName])) {
            return false;
        }
        if (is_scalar($value)) {
            $value = array($value);
        }
        foreach ($value as $v) {
            $v = self::_valueToLdap($v);
            if (!in_array($v, $data[$attribName], true)) {
                return false;
            }
        }
        return true;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Checks if the given value(s) exist in the attribute
  *
  * @param  string      $attribName
  * @param  mixed|array $value
  * @return boolean
  */
 public function attributeHasValue($attribName, $value)
 {
     return Zend_Ldap_Attribute::attributeHasValue($this->_currentData, $attribName, $value);
 }
All Usage Examples Of Zend_Ldap_Attribute::attributeHasValue