Category: entity

How to retrieve Entity instance of an EntityType field inside a twig template in Symfony

I am currently experiencing a problem with recovering the data I need, and I really hope that you will be able to help me. I am trying to create a form via the Symfony formbuilder to create an object that…

Why are Drupal Entity Events not firing?

namespace Drupalta3mal_utilitiesEventSubscriber; use SymfonyComponentEventDispatcherEventSubscriberInterface; use DrupalCoreEntityEntityTypeEvents; use DrupalCoreEntityEntityTypeEvent; class EntityEvents implements EventSubscriberInterface { public function onCreate(EntityTypeEvent $event) { //Do things on creation } public function onUpdate(EntityTypeEvent $event) { dd(‘on update now’); } public function onDelete(EntityTypeEvent $event) { //Do things on…

Symfony Accessing to parent entity inside entity class

In Symfony 5, I’ve created 2 entities related with a ManyToOne relation : Project is the parent, Serie is the child. Project entity : namespace AppEntity; use DoctrineCommonCollectionsArrayCollection; use DoctrineCommonCollectionsCollection; use DoctrineORMMapping as ORM; /** * @ORMEntity(repositoryClass=”AppRepositorySerieRepository”) */ class Serie…

Symfony 4 Doctrine 2 findby dosent apply Join and custom join doesn’t work

i’m relatively new with Symfony 4 and Doctrine ORM. I’m trying to get all comments posted from one user when browsing this user profile page. Here’s my comment entity <?php namespace AppEntity; use DoctrineORMMapping as ORM; /** * @ORMEntity(repositoryClass=”AppRepositoryCommentsRepository”) */…