How to unset 1 result in a query object in cakephp 3

339 views Asked by At

I want to get data from a table, loop through it and "unset" some entities before passing it to the view.

$shops = $table-find();
foreach ($shops as $shop) {
    if (condition 1) {
        unset($shop); //
    }
}

In the end I want to have a clean query with reduced results.

I tried to loop through $shops with formatResults() and map() but I was only able to set the entities to null.

0

There are 0 answers