Closed peter-gribanov closed 3 years ago
Reverts Happyr/Doctrine-Specification#305
Most of the cases look like:
/** @var array<array-key, JobInterface> $jobs */ $jobs = $this->jobRepository->match(new Running());
But there are cases in which we do not select the entire entity, but only individual fields or something else.
Get only profile info.
/** @var array<array-key, array<string, string>> $profiles */ $profiles = $this->jobRepository->match(Spec::andX( Spec::select( Spec::field('profile.title'), Spec::field('profile.name'), ), new Running(), ));
Get count jobs in types.
/** @var array<array-key, array<string, string>> $count_types*/ $count_types = $this->jobRepository->match(Spec::andX( Spec::select(Spec::selectAs(Spec::COUNT('type'), 'total')), Spec::groupBy('type'), new Running(), ));
Get related entities.
/** @var array<array-key, Group> $groups */ $groups = $this->jobRepository->match(Spec::andX( Spec::select('group'), Spec::groupBy('group.id'), new Running(), ));
Reverts Happyr/Doctrine-Specification#305
Most of the cases look like:
But there are cases in which we do not select the entire entity, but only individual fields or something else.
Get only profile info.
Get count jobs in types.
Get related entities.