Toby's Log page 20

Purchase: New laptop, Lenovo Yoga 7i

Last month, I finally bought a new laptop with plans to replace my aging 2009 Macbook as my primary computer. It is a Lenovo Yoga 7i, purchased from MicroCenter. It is a switch from Mac, which has been my primary OS for pretty much since I’ve been using computers, but it has touch screen and I hope to switch to the open world of Linux.

Continue reading post "Purchase: New laptop, Lenovo Yoga 7i"

Sorting with `FIELD()` function in Doctrine

I recently needed to sort query results to match the order of IDs passed to it for use in a WHERE … IN() clause. In MySQL, this can be done using the FIELD() function in the ORDERY BY clause. For Doctrine, which doesn’t have the FIELD() function and doesn’t allow functions in the ORDER BY clause, there’s a little more work needed to make use of it.

Continue reading post "Sorting with `FIELD()` function in Doctrine"