mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 11:18:51 +02:00
Added basic API to access and edit manufacturer entities
This commit is contained in:
parent
f5a15b23d6
commit
676c8eeefb
11 changed files with 96 additions and 21 deletions
|
@ -49,6 +49,11 @@ class StructuralElementDenormalizer implements DenormalizerInterface
|
|||
|
||||
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
|
||||
{
|
||||
//Only denormalize if we are doing a file import operation
|
||||
if (!($context['partdb_import'] ?? false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return is_array($data)
|
||||
&& is_subclass_of($type, AbstractStructuralDBElement::class)
|
||||
//Only denormalize if we are doing a file import operation
|
||||
|
|
|
@ -39,6 +39,11 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface
|
|||
|
||||
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
|
||||
{
|
||||
//Only denormalize if we are doing a file import operation
|
||||
if (!($context['partdb_import'] ?? false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,11 @@ class StructuralElementNormalizer implements NormalizerInterface
|
|||
|
||||
public function supportsNormalization($data, string $format = null, array $context = []): bool
|
||||
{
|
||||
//Only normalize if we are doing a file export operation
|
||||
if (!($context['partdb_export'] ?? false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $data instanceof AbstractStructuralDBElement;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue