Jump to content

[Solved] Override class still existing


MacroProg

Recommended Posts

Hello.

 

I need to override the PDF class to add it a new static function.

 

My problem is the next : there is yet an override of the PDF class done.

 

How can I do to add mine ?

 

Can I name PDF2.php my file ? DO I have to add it to the existing file ?

 

Thanks for your answers.

Edited by MacroProg (see edit history)
Link to comment
Share on other sites

That's what I think about, but this isn't a very good solution because, if the other module that firstly installed the override of PDF is uninstall, it will broke my module.

 

Well, I will think about it, and if I found another way or a solution for this problem, I will post it.

 

Otherwise, if anyone has another solution, thanks to telling me.

Link to comment
Share on other sites

yes, creating an override is the appropriate action, however you do not want to because an override already exists. your options then are

1) edit the existing override and add your functionality

2) create your own custom PDF class (ie. PDF2.php) that perhaps extends PDF.php

  • Like 1
Link to comment
Share on other sites

Well, I start with your first solution but I didn't thougth about your 2nd. It's interesting. Ok, thanks, for your help, I will see which one is better for me (probably the 2nd because this avoid the problem of uninstall).

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...