How to delete a PHP object from its class?

后端 未结 7 791
攒了一身酷
攒了一身酷 2021-01-02 06:51

I know that for some that might sound stupid, but I was thinking if I hava a delete() method in a class that removes all the object data (from DB and file system), how can I

7条回答
  •  礼貌的吻别
    2021-01-02 07:04

    Another approach is to make the delete-method static, which then could receive a PDO object and data, that determines what to delete. This way you don't need to initialise the object.

提交回复
热议问题