basercms icon indicating copy to clipboard operation
basercms copied to clipboard

SitesService findByUrl と findById で返り値が異なる

Open seto1 opened this issue 3 years ago • 2 comments

https://github.com/baserproject/ucmitz/blob/dev/plugins/baser-core/src/Service/SitesService.php#L221

findByUrl: Entity findById: Query

どちらもEntityの方が使いやすそう 他のクラスの状況を調査

seto1 avatar Jun 27 '22 03:06 seto1

  • findByはcakeの動的なfinder
    • https://book.cakephp.org/4/ja/orm/retrieving-data-and-resultsets.html#dynamic-finders
  • findByUrlは分かりやすいがcakeの名称と被っている
    • 名称について要検討
    • もしくはサービスクラスでクエリを返す必要性について検討

seto1 avatar Jun 28 '22 07:06 seto1

関連: https://github.com/baserproject/ucmitz/issues/642

使用状況を調べて不要な関数は削除する

seto1 avatar Jun 30 '22 06:06 seto1