data = $raw; $obj->name = $name; return $obj; } /** * Get a name. */ public function getName(): string { return $this->name; } /** * Get a key. */ public function getKey(): string { return $this->data['key']; } /** * Whether is unique. */ public function isUnique(): bool { $type = $this->data['type'] ?? null; return $type === 'unique'; } /** * Get a column list. */ public function getColumnList(): array { return $this->data['columns'] ?? []; } }