public function __construct(array $schema, $validate = false)
{
$this->schema = $schema;
if (isset($this->schema['prefix'])) {
$this->prefix = $this->schema['prefix'];
}
if ($validate) {
// we validate the schema using the meta schema, defining the structure of our schema
try {
$this->validateSchema();
} catch (\Exception $e) {
throw new \Exception("Unable to validate schema with error: {$e->getMessage()}");
}
}
}