GraphAware\Reco4PHP\Result\Recommendations::getItemById PHP Method

getItemById() public method

public getItemById ( integer $id ) : Recommendation | null
$id integer
return Recommendation | null
    public function getItemById($id)
    {
        foreach ($this->getItems() as $item) {
            if ($item->item()->identity() === $id) {
                return $item;
            }
        }
        return null;
    }