use Doctrine\Common\Collections\Criteria;
/**
* @ORM\Entity
*/
class Group {
// ...
public function getOwner() {
$criteria = Criteria::create()->where(фильтруем по роли или что-то ещё);
return $this->getUsers()->matching($criteria);
}
}
->add(
'createdAt',
'doctrine_orm_date_range',
[],
'sonata_type_date_range_picker',
[
'field_options_start' => [
'format' => 'dd.MM.yyyy'
],
'field_options_end' => [
'format' => 'dd.MM.yyyy'
]
]
)
php app/console doctrine:mapping:import AppBundle annotation
$builder->add('date', DateType::class, array(
'widget' => 'single_text',
// this is actually the default format for single_text
'format' => 'yyyy-MM-dd',
));