$id = 1;
$product = $this->Products->get($id);
$offers = $this->Products->Offers->find()->where(['Offers.product_id' => $id]);
$offers
will contain two kind of rows. One with type
a
that points to another row in $offers
of type
b
using another field offer_id
.
This is why I need a Model->get()
like method that so that I can locate an item using the primary key of the result set.
In short, I need to get a result from result set by passing id. Like for example by doing:
$offers->getResultByPrimaryKey($offer_id)
Is it possible?