Best way to override a evaluate method from Page class

I was following this question!/general:group-blog-items-by-year- and I’ve made some tests (I’m newbie with Grav).

After some tests I got the approach working using ‘@taxonomy.category’: with an array of categories as items.
I have several posts on different categories (subdirectories) and I’m showing all those posts on blog page. To achieve that behavior I’ve changed line 2520 on class Grav\Common\Page\Page from:

$results = $taxonomy_map->findTaxonomy($params)->published();


$results = $taxonomy_map->findTaxonomy($params, 'or')->published();

So, my questions are:

  1. Has this approach sense?
  2. Which is the right way to override a method without changing the core code?