I have the
Class User {
@OneToMany
private $profiles
}
Now I have the $user entity in my controller but I also want the first or last profile based on date. How can I achieve this?
I have the method getProfiles() but I think that will return the array collection.
will do it, as long as you are declaring the
$profilesproperty as ain the constructor of your class.