This should be a pretty straightforward classes and interfaces question, but please bear with me while I lay out my example.

In the Propel ORM library, all the database tables are abstracted as classes called BaseTablename. Various methods for interacting with the database are defined in the base obect. Then the library also generates classes named after the tables, such as Tablename, which are super convenient for overriding the base methods and adding custom methods.

I'm just trying to override the default delete() method to be able to delete some dependent data. But when I declare the overriding method, I get the following error:

Fatal error: Declaration of Tablename::delete() must be compatible with that of Persistent::delete()

So, considering the following basic definitions, why is it that I cannot override the delete() method?

Update: I've added my parent::delete() call, which I failed to include in my original example code. It really would have made all the difference. Sorry folks, and thanks so much to those who confirmed the working code

The answer was that I needed to preserve the parameter on all declarations and calls. My overloaded function should have read:

This code works without errors. Ensure, that file on your server synchronized with local copy.
–
OZ_May 27 '11 at 0:03

Please see the changes I made to my question. I don't want to answer this question myself since it was my mistake that caused the question to be answerable; so between Alrik and OZ_, whoever posts the correct answer first, I'll award the Accept to. I still really appreciate you guys confirming the otherwise working code, though -- that helps me feel more confident that this was in fact the only problem.
–
Brian LacyMay 30 '11 at 14:21

As stated, I'm waiting for one of the original responders to do so. I won't take the credit when a couple folks went to significant effort to answer my question which turned out to be unsolvable.
–
Brian LacyMay 30 '11 at 14:27

this IS the Problem! - no, it's not a reason of the problem too. Error in declaration of method. Incompatible declarations when: a) method declared as static in class and as dynamic (normal) in interface, and vice versa; b) when names, or count of arguments (even optional) or types of arguments are different in the interface and in the class.
–
OZ_May 30 '11 at 15:52

I've just marked your answer Accepted because you were the first to respond with an accurate answer. The actual problem as initially described was unsolvable due to missing information. The REAL answer was that I needed to make sure the function signature remained identical to the original declaration, including when actually calling the method from my subclass.
–
Brian LacyJun 13 '11 at 12:33

Well I've run another simple test. Using your code but with two echo's and it works as expeted. Like in C in this case the interface acts as a prototype so as you say, it's needed to be the same params and visibility on the classes that it implements.