public function getOptional($key, $defaultValue = null)
  {
    if (array_key_exists($key, $this->data)) {
      return $this->data[$key];
    }
    return $defaultValue;
  }
public function getOptional($key, $defaultValue = null)
  {
    if (array_key_exists($key, $this->data)) {
      return $this->data[$key];
    }
    return $defaultValue;
  }
public function getOptional ( $ key , $ defaultValue = null ) { if ( array_key_exists ( $ key , $ this -> data ) ) { return $ this -> data [ $ key ] ; } return $ defaultValue ; }
Use this method for optional values.
@param $key string | The key name.
@return object
Use this method for optional values .