I have one entity Hike which have relation with another named Department
<?php
class Hike
{
private $id;
private $name;
private $description;
/**
* @ORM\ManyToOne(targetEntity=Department::class, inversedBy="hikes")
* @ORM\JoinColumn(nullable=false)
* @Assert\NotBlank(message="libdepartmentRequired")
*/
private $department;
// ...
}
<?php
class Department
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=3)
*/
private $department_code;
/**
* @ORM\Column(type="string", length=255)
*/
private $department_nom;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Hike", mappedBy="department")
*/
private $hikes;
// ...
}
In easyAdmin3 rendering is fine like
But when I sorting by department
I see that easyAdmin3 sort by department's id, and I would like sorting by department_nom
I saw many solutions but they all using easyAdmin2 and easy_admin.yaml which no longer exists now.
There is a way to achieve that ?
Use configureCrud. Something like this should do the trick.
You can also use the filter to get the resultat wanted.