skip to Main Content

Php – Sylius override AvailableProductOptionValuesResolver

With sylius 1.13 i wan't to override AvailableProductOptionValuesResolver.php I've copied the original class in src/Component/Product/Resolver/AvailableProductOptionValuesResolver.php and change the namespace and add debug: <?php namespace AppComponentProductResolver; class AvailableProductOptionValuesResolver implements AvailableProductOptionValuesResolverInterface { public function resolve(ProductInterface $product, ProductOptionInterface $productOption): Collection { dd('modify'); What…

VIEW QUESTION

Php – Symfony 6 Validation Constraints: How to assert that a string has exact length 4

Here is my simplified class of my DTO which is filled by the Serializer: <?php namespace AppApiDto; use OpenApiAttributes as OA; use SymfonyComponentSerializerAnnotationGroups as SerializerGroups; use SymfonyComponentValidatorConstraints as Assert; #[OASchema()] readonly class WorkHour implements DtoInterface { public function __construct( #[OAProperty(description:…

VIEW QUESTION

Php – Symfony Doctrine have two property for the same column in database

Here's a sample entity use ApiPlatformMetadataApiResource; use DoctrineORMMapping as ORM; use SymfonyComponentSerializerAnnotationGroups; #[ORMTable(name: 'user')] #[ApiResource( operations: [new GetCollection()], normalizationContext: [ 'groups' => [ 'user:id', 'user:score', 'user:user_score', ], ] )] class User { #[ORMId] #[ORMGeneratedValue] #[ORMColumn(name: 'ID_USER', type: 'integer')] #[Groups(groups: ['user:id'])]…

VIEW QUESTION

Php – Symfony 6 website skeleton 404 for controller

I am trying out Symfony the first time. I installed it with composer create-project symfony/website-skeleton crudapp I have an Apache config like this: <VirtualHost *:80> ServerName localhost DocumentRoot "c:/.../Symfony/crudapp/public/" <Directory "c:/.../Symfony/crudapp/public/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local…

VIEW QUESTION
Back To Top
Search