|
|
@ -14,7 +14,6 @@ final class PermissionQueryBuilder |
|
|
|
|
|
|
|
#[QueryBuilderRequiredField] |
|
|
|
protected string $On = ""; |
|
|
|
protected string $As = ""; |
|
|
|
|
|
|
|
|
|
|
|
public function On(string $relativePath): PermissionQueryBuilder |
|
|
@ -24,22 +23,12 @@ final class PermissionQueryBuilder |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function As(string $relativePath): PermissionQueryBuilder |
|
|
|
{ |
|
|
|
self::ValidateDeegraphPath(target: $relativePath); |
|
|
|
$this->As = $relativePath; |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function Build(): PermissionQuery |
|
|
|
{ |
|
|
|
self::ValidateValues(target: $this); |
|
|
|
|
|
|
|
$builder = "PERMISSIONS ON ". $this->On; |
|
|
|
|
|
|
|
if($this->As != "") $builder .= " AS {". $this->As . "}"; |
|
|
|
|
|
|
|
return new PermissionQuery(queryString: $builder); |
|
|
|
} |
|
|
|
} |
|
|
|