In my database I have the columns id
, uid
and data
and I would like to sort id
by DESC
.
$this->getDoctrine()->getRepository(FormInputs::class)->findBy(['uid' => $uid], ['id', 'DESC']);
If I use the second parameter (['id', 'DESC']
), I get the following error:
Invalid order by orientation specified for App\Entity\FormInputs#0
Why am I getting this error?
Try Passing that like
$this->getDoctrine()->getRepository(FormInputs::class)->
findBy(
array('uid'=>$uid),
array('id'=>'DESC')
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With