I am converting my procedural php project to OOP. I stuck on one problem. What is the best way of retrieving table data?
Passing the id with constructor
new Rate(new Currency($currencyId), $amount);
or first setting the id and calling getId() method?
$currency = (new Currency())->setId($currencyId);
new Rate($currency->getId(), $amount)