Gc\Core\Object::getOrigData PHP Method

getOrigData() public method

Get Original data
public getOrigData ( string $key = null ) : mixed
$key string Key
return mixed
    public function getOrigData($key = null)
    {
        if (is_null($key)) {
            return $this->origData;
        }
        return isset($this->origData[$key]) ? $this->origData[$key] : null;
    }

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'));
 }