Category: symfony4

validate embedded model in api platform

I have this Order model: <?php namespace AppEntity; use ApiPlatformCoreAnnotationApiResource; use SymfonyComponentSerializerAnnotationGroups; use DoctrineORMMapping as ORM; use SymfonyComponentSerializerAnnotationSerializedName; use SymfonyComponentValidatorConstraints as Assert; /** * @ApiResource( * itemOperations={ * “get”={ * “normalization_context”={ * “groups”={“order:view”} * } * }, * “patch”={ *…

ObjectManager isn’t recognized (Declaration must be compatible with FixtureInterface->load)

I have tried to create DataFixtures, I think that my code is correct because if I tried on another project it’s worked. So I don’t understand why just in that my actual project , the Object Manager isn’t working and…

How to disable "verify_peer" with Symfony Mailer component?

I’m configuring a mail server (postfix), with a self signed certificate, and it seems this self signed certificate is a problem for the Symfony Mailer component. On Swiftmailer, using some configuration such as: transport: stream_options: ssl: allow_self_signed: true or stream_options:…

Best approach for getting one specific record from an ArrayCollection

I have a “Customer” entity which has a OneToMany relation with “Phones”. Phones has a “IsMain” field to identify which record is the main phone and a “category” field for the type (i.e. mobile, landline, fax). I’m attempting to use…