removeDuplicatesFromAttribute() public static method

Removes duplicate values from a LDAP attribute
public static removeDuplicatesFromAttribute ( array &$data, string $attribName ) : void
$data array
$attribName string
return void
Exemplo n.º 1
0
 /**
  * Removes duplicate values from a LDAP attribute
  *
  * @param  string $attribName
  * @return void
  */
 public function removeDuplicatesFromAttribute($attribName)
 {
     Zend_Ldap_Attribute::removeDuplicatesFromAttribute($this->_currentData, $attribName);
 }
Exemplo n.º 2
0
 public function testRemoveDuplicates()
 {
     $data = array('strings1' => array('value1', 'value2', 'value2', 'value3'), 'strings2' => array('value1', 'value2', 'value3', 'value4'), 'boolean1' => array('TRUE', 'TRUE', 'TRUE', 'TRUE'), 'boolean2' => array('TRUE', 'FALSE', 'TRUE', 'FALSE'));
     $expected = array('strings1' => array('value1', 'value2', 'value3'), 'strings2' => array('value1', 'value2', 'value3', 'value4'), 'boolean1' => array('TRUE'), 'boolean2' => array('TRUE', 'FALSE'));
     Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'strings1');
     Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'strings2');
     Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'boolean1');
     Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'boolean2');
     $this->assertEquals($expected, $data);
 }