There are 2 tables: Providers and Adverts. A Provider has Adverts.
First table "Provider":
- ID
- ...
Second table "Advert":
- ID
- Begin (DateTime)
- End (DateTime)
- ...
Relation:
/**
* @ORM\OneToMany(targetEntity="Advert", mappedBy="provider", cascade={"persist"})
*/
private $adverts;
I want:
All Providers who DON'T have any adverts which are currently active (= currently between "Begin" and "End") AND DON'T have any adverts which are planned for the future (= "Begin" and "End" are in the future).
In other words:
I want ALL Providers who DON'T have any current or upcoming adverts.
My issue:
I don't know and find any information how to do it.
I use Doctrine2 with Symfony 2.8 / 3.0.