Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 6
    The invisible gorilla here is why is hasAccount doing the searching loop in PHP instead of letting the database do the search? The database can use indexes to search on IDs that will make this problem irrelevant. Commented Jul 18, 2019 at 12:57
  • Thanks everyone, using the database to do the query will probably be the most efficient way. To know which table should I query against, I could add a method or would you recommend another way? I was trying to keep my Entity unaware of the data layer so this method should probably be in another layer. Commented Jul 18, 2019 at 14:41