Reusable VS clean code - where's the balance?
- by Radek Šimko
Let's say I have a data model for a blog posts and have two use-cases of that model - getting all blogposts and getting only blogposts which were written by specific author.
There are basically two ways how I can realize that.
1st model
class Articles {
public function getPosts() {
return $this->connection->find()
…