removeFromAttribute() public static method

Remove given values from a LDAP attribute
public static removeFromAttribute ( array &$data, string $attribName, mixed | array $value ) : void
$data array
$attribName string
$value mixed | array
return void
Exemplo n.º 1
0
 /**
  * Remove given values from a LDAP attribute
  *
  * @param  string      $attribName
  * @param  mixed|array $value
  * @return void
  */
 public function removeFromAttribute($attribName, $value)
 {
     Zend_Ldap_Attribute::removeFromAttribute($this->_currentData, $attribName, $value);
 }
Exemplo n.º 2
0
 public function testRemoveAttributeValueInteger()
 {
     $data = array('test' => array('1', '2', '3', '4'));
     Zend_Ldap_Attribute::removeFromAttribute($data, 'test', array(2, 4));
     $this->assertArrayHasKey('test', $data);
     $this->assertType('array', $data['test']);
     $this->assertEquals(2, count($data['test']));
     $this->assertContains('1', $data['test']);
     $this->assertContains('3', $data['test']);
     $this->assertNotContains('2', $data['test']);
     $this->assertNotContains('4', $data['test']);
 }