Gc\Core\Object::setOrigData PHP Method

setOrigData() public method

Set Original data
public setOrigData ( string $key = null, mixed $data = null ) : Object
$key string Key
$data mixed Data
return Object
    public function setOrigData($key = null, $data = null)
    {
        if (is_null($key)) {
            $this->origData = $this->data;
        } else {
            $this->origData[$key] = $data;
        }
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testSetAllOrigData()
 {
     $this->object->setData(array('k' => 'v', 'k2' => 'v2'));
     $this->object->setOrigData();
     $this->assertEquals('v', $this->object->getOrigData('k'));
 }