Working in a symfony model, I want to override a function and call the overridden function from within the overriding one, along the lines of
class MyClass extends BaseMyClass {
function setMyProperty($p) {
parent::setMyProperty($p);
//do some other stuff
}
}
This is resulting in a segmentation fault. I don’t want to alter the parent class – it’s been generated by symfony, and may feasibly be overwritten in the future if the model is rebuilt. This seems like something that should be straightforward, but I’m struggling to find the solution.
I’ve managed to find a solution to my own question on the symfony project forum.
I can’t call the overridden function because it doesn’t exist. Though it exists enough for me to override it.
Using
Works where
Causes the error.
Note that
Works fine in my class if the method has not been overridden.