modul-is / orm

Simple lightweight ORM
12 stars 0 forks source link

Does it support getBy<property>() methods? #14

Closed omid-ebrahimi closed 2 years ago

omid-ebrahimi commented 2 years ago

I have replaced the YetORM package with this one because it supports the new PHP 8. But I found that getBy<property>() methods that were working on YetORM do not work here. I'm not sure if I missed something to make it work. I didn't find any document about this package so I ask it here. Does it support getBy<property>() methods? I have the same question about findBy<Property>() Thanks

kravcik commented 2 years ago

We don't like magic behind this feature. So if you call function getByColumn() - that function doesnt exist. Static analylis dont like this patterns.

Should be simple fix change - getByColumn(1) to getBy([column = 1]). Or create some custom BaseRepository and insert fn __call() with old functions from YetORM (https://github.com/uestla/YetORM/blob/master/src/YetORM/Repository.php#L235).

We can discuss in team, but I think we never implement it.

omid-ebrahimi commented 2 years ago

@kravcik thank you for explanation. I may change all getByColumn(1) to getBy([column => 1])