yiisoft / active-record

Active Record database abstraction layer
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
65 stars 27 forks source link

Remove parameter `$throwException` from `ActiveRecordInterface::relationQuery()` #331

Closed Tigrov closed 1 month ago

Tigrov commented 1 month ago

Looks like a legacy from the old version where behaviors were built in.

Currently, an exception will only be thrown if the relation query is not realized or is realized with an error. In this case, there is no need to suppress the error.

https://github.com/yiisoft/active-record/blob/a4816d0ee20c86531413f52e47bfd1d831ac3a04/src/ActiveRecordInterface.php#L222

After changes:

public function relationQuery(string $name): ActiveQueryInterface;