JBZoo\Data\Data::remove PHP Method

remove() public method

Remove a value from the data
public remove ( string $name )
$name string The key of the data to remove
    public function remove($name)
    {
        if ($this->has($name)) {
            $this->offsetUnset($name);
        }
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: dataTest.php プロジェクト: jbzoo/data
 public function testRemove()
 {
     $data = new Data($this->_test);
     is('qwerty', $data->get('string'));
     $data->remove('string');
     isFalse($data->has('string'));
     isNull($data->get('string'));
 }