Update query and affected rows

I have query update…

$this->GoodsItems->query()
    ->update('goods_items g, imports i')
    ->set([
        'g.price = i.price',
    ])
    ->where([
        'g.code = i.code',
    ])
    ->execute();

Can i get the IDs that have been updated from table goods_items?

Thank you

try add before some $variable =
and debug($variable); after.

You’re looking for the function rowCount().

If you don’t have intellisense, you can use get_class() on the $query object and search for that class on the CakePHP API.

$query = $this->GoodsItems->query()
    ->update('goods_items g, imports i')
    ->set([
        'g.price = i.price',
    ])
    ->where([
        'g.code = i.code',
    ])
    ->execute();

debug(get_class($query));
debug($query->count());
die;