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;
}
}