Category : doctrine-query

Currently I have a message system between two users (like ebay), and you can make soft delete from the current conversation (the person who deleted it cannot see the message but the other participant yes) Here you have my entities: Message.php <?php namespace AppEntity; use AppRepositoryMessageRepository; use DoctrineORMMapping as ORM; /** * @ORMEntity(repositoryClass=MessageRepository::class) */ class ..

Read more

Currently I have a message system (for example, like eBay between two different users, one conversation, two members). Now I want to allow members from the conversation to invite other members to the active conversation (new members will be able to read previous messages). What should be the proper way to define the entity in ..

Read more

I downloaded "Beberlei" package with composer. Everything is correctly added in my project : I changed the file config/"doctrine.yaml" by adding those functions : I’m trying to use them like this : public function findCitiesInRange() { $lat = 49.3167; $lng = 2.55; return $this->createQueryBuilder(‘v’) ->select(‘v’) ->addSelect(‘(6371 * acos(cos(radians(:lat)) * cos(radians(v.latitude)) * cos(radians(v.longitude) – radians(:lng)) + ..

Read more

I have this MySQL query, which gives me the right result : SELECT p.date_pointage, SUM(p.heure_pointage) AS heuresAbsences FROM pointage p JOIN affaires a on p.num_affaire_id = a.id WHERE (a.num_affaire LIKE ‘%99001%’ OR a.num_affaire LIKE ‘%99002%’ OR a.num_affaire LIKE ‘%99003%’ OR a.num_affaire LIKE ‘%99004%’ OR a.num_affaire LIKE ‘%99006%’ OR a.num_affaire LIKE ‘%99007%’ OR a.num_affaire LIKE ‘%99017%’) ..

Read more

This is my first project with Symfony / Doctrine I have this entity called Nuclei class Nuclei { /** * @var int * * @ORMId * @ORMColumn(name="id", type="integer", nullable=false) * @ORMGeneratedValue(strategy="NONE") */ private $id; /** * @var Utenti * * @ORMOneToOne(targetEntity="Utenti", mappedBy="nucleo") * */ private $utente; /** * @var Comuni * * @ORMManyToOne(targetEntity="Comuni", inversedBy="nuclei", fetch="EAGER") ..

Read more