Currently, all the logical code has been added in either event subscribers or block classes. It will be better to create a separate counter service that will have all the database access methods as well as other utility functions. This will help in making Drupal related class code more readable.

All the database access methods are currently using the query method which can also be replaced with select, insert and update methods for better control and abstraction.

Comments

gaurav.kapoor created an issue. See original summary.

  • gaurav.kapoor authored 1b67ae5 on 8.x-1.x
    Issue #3264628 by gaurav.kapoor: Add a counter service with all the...

  • gaurav.kapoor authored c539835 on 8.x-1.x
    Issue #3264628 by gaurav.kapoor: Add a counter service with all the...
gaurav.kapoor’s picture

Status: Active » Fixed

All the scattered code related to accessing databases or external libraries has been moved to service. Only the required code has been kept in the Block and Event Subscriber class.

  • gaurav.kapoor authored 24431ee on 8.x-1.x
    Issue #3264628 by gaurav.kapoor: Removed unwanted database access code.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.