public function newModel($modelName, $mixed = null) {
    if(substr_count("\\", $modelName) > 0) {
      throw new InvalidArgumentException("Do not provide the full namespace plus classname of the desired model.  Only the model classname is required.  E.G. Cloud");
    }

    $prefix = $this->version == '1.0' ? 'Ec2\\' : 'Mc\\';

    $modelName = "\\RGeyer\\Guzzle\\Rs\\Model\\" . $prefix . $modelName;

    if(!class_exists($modelName)) {
      throw new \InvalidArgumentException("The model $modelName does not exist");
    }

    $model = new $modelName($mixed);
    $model->setClient($this);

    return $model;
  }
public function newModel($modelName, $mixed = null) {
    if(substr_count("\\", $modelName) > 0) {
      throw new InvalidArgumentException("Do not provide the full namespace plus classname of the desired model.  Only the model classname is required.  E.G. Cloud");
    }

    $prefix = $this->version == '1.0' ? 'Ec2\\' : 'Mc\\';

    $modelName = "\\RGeyer\\Guzzle\\Rs\\Model\\" . $prefix . $modelName;

    if(!class_exists($modelName)) {
      throw new \InvalidArgumentException("The model $modelName does not exist");
    }

    $model = new $modelName($mixed);
    $model->setClient($this);

    return $model;
  }
public function newModel ( $ modelName , $ mixed = null ) { if ( substr_count ( "\\" , $ modelName ) > 0 ) { throw new InvalidArgumentException ( "Do not provide the full namespace plus classname of the desired model.  Only the model classname is required.  E.G. Cloud" ) ; } $ prefix = $ this -> version == '1.0' ? 'Ec2\\' : 'Mc\\' ; $ modelName = "\\RGeyer\\Guzzle\\Rs\\Model\\" . $ prefix . $ modelName ; if ( ! class_exists ( $ modelName ) ) { throw new \ InvalidArgumentException ( "The model $modelName does not exist" ) ; } $ model = new $ modelName ( $ mixed ) ; $ model -> setClient ( $ this ) ; return $ model ; }
Returns a new model of the specified type, which will use this client for making API calls

@throws \InvalidArgumentException If a namespace is specified, or if the model does not exist
@param $modelName The classname of the model you want to instantiate.  Do NOT include the fully qualified class name with namespace.  E.G. Cloud not \RGeyer\Guzzle\Rs\Model\1.5\Cloud
@param mixed $mixed Any of the acceptable parameter types for ModelBase::__construct
@return \RGeyer\Guzzle\Rs\ModelBase A model object of the type specified in $modelName
Returns a new model of the specified type which will use this client for making API calls