Horde_Kolab_Server_Object_Attribute_Value::consume PHP Method

consume() public method

Indicate that a value will be saved by deleting it from the original data array.
public consume ( array &$changes ) : null
$changes array
return null
    public function consume(array &$changes)
    {
        if (isset($changes[$this->name])) {
            unset($changes[$this->name]);
        }
    }

Usage Example

Beispiel #1
0
 public function testMethodConsumeHasPostconditionThatTheAttributeValueHasBeenRemovedFromTheDataArray()
 {
     $attribute = new Horde_Kolab_Server_Object_Attribute_Value($this->object, $this->composite, 'name', 'name');
     $data = array('name' => 'test');
     $attribute->consume($data);
     $this->assertEquals(array(), $data);
 }
Horde_Kolab_Server_Object_Attribute_Value