Add syncPropValues method to Propable trait; update StoreProductRequest and UpdateProductRequest to handle props validation
This commit is contained in:
@@ -60,6 +60,16 @@ trait Propable
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $props
|
||||
*/
|
||||
public function syncPropValues(array $props): void
|
||||
{
|
||||
foreach ($props as $codigo => $value) {
|
||||
$this->setPropValue($codigo, $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function deletePropValue(Prop|string $prop): bool
|
||||
{
|
||||
$resolvedProp = $this->resolveProp($prop);
|
||||
|
||||
Reference in New Issue
Block a user