Correct Implementation of Virtual Functions in PHP?

前端 未结 3 1020
臣服心动
臣服心动 2021-02-12 10:42

at my working place (php only) we have a base class for database abstraction. When you want to add a new database table to the base layer, you have to create a subclass of this

3条回答
  •  一个人的身影
    2021-02-12 11:15

    You can always use the "final" keyword to prevent some of the classes functions from being overridden if people are using the class in the wrong way.

    It sounds to me like they are unable to acheive certain functionality hence overriding the methods. You may need to take a look at the design of your classes.

提交回复
热议问题