-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-675 databox fixes & replace source file feat (#463)
- Loading branch information
Showing
27 changed files
with
370 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
databox/api/src/Api/Processor/PrepareSubstitutionProcessor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Api\Processor; | ||
|
||
use Alchemy\AuthBundle\Security\Traits\SecurityAwareTrait; | ||
use Alchemy\CoreBundle\Util\DoctrineUtil; | ||
use ApiPlatform\Metadata\Operation; | ||
use ApiPlatform\State\ProcessorInterface; | ||
use App\Api\Model\Input\Attribute\AssetAttributeBatchUpdateInput; | ||
use App\Attribute\BatchAttributeManager; | ||
use App\Entity\Core\Asset; | ||
use App\Security\Voter\AssetVoter; | ||
use Doctrine\ORM\EntityManagerInterface; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
final class PrepareSubstitutionProcessor implements ProcessorInterface | ||
{ | ||
use SecurityAwareTrait; | ||
|
||
public function __construct( | ||
private readonly BatchAttributeManager $batchAttributeManager, | ||
private readonly EntityManagerInterface $em, | ||
) { | ||
} | ||
|
||
/** | ||
* @param Asset $data | ||
*/ | ||
public function process($data, Operation $operation, array $uriVariables = [], array $context = []): Asset | ||
{ | ||
$data->setPendingUploadToken(Uuid::uuid4()->toString()); | ||
|
||
$this->em->persist($data); | ||
$this->em->flush(); | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.