public function unsetData($key = null)
    {
        if (is_string($key) && 0 < strlen($key)) {
            unset($this->data[$key]);
        } else {
            $this->data = [];
        }

        return $this;
    }
public function unsetData($key = null)
    {
        if (is_string($key) && 0 < strlen($key)) {
            unset($this->data[$key]);
        } else {
            $this->data = [];
        }

        return $this;
    }
public function unsetData ( $ key = null ) { if ( is_string ( $ key ) && 0 < strlen ( $ key ) ) { unset ( $ this -> data [ $ key ] ) ; } else { $ this -> data = [ ] ; } return $ this ; }
Unsets the data for the given key.

@param string $key

@return DataInterface|$this
Unsets the data for the given key .