OEModule\PASAPI\resources\BaseResource::__construct PHP Method

__construct() public method

BaseResource constructor.
public __construct ( $version, array $options = [] )
$version
$options array
    public function __construct($version, $options = array())
    {
        if (!$version) {
            throw new \Exception('Schema version required to create resource');
        }
        $this->version = $version;
        $this->schema = static::getSchema($version);
        if (!$this->schema) {
            throw new \Exception('Schema not found for resource ' . static::$resource_type);
        }
        foreach ($options as $key => $value) {
            $this->{$key} = $value;
        }
    }