I have model
BaseUser.class.php
User.class.php
UserTable.class.php
In user Class I have been override the delete function
Why do you need to extend delete
if you need to call the parent one time?
Why not create a custom delete?
Like:
public function customDelete()
{
parent::delete();
// do extends delete here
}
Then you can delete an object using ->customDelete()
and you also can call the delete method from the parent since you didn't override the delete()
method:
$user = new User();
$user->customDelete(); // will call the overridden delete
$user->delete(); // will call the parent (since you didn't override it)
And if you really need to override the delete()
function, you still can create a kind of parent delete:
public function parentDelete()
{
return parent::delete();
}
Then:
$user = new User();
$user->delete(); // will call the overridden delete
$user->parentDelete(); // will call the method that only call the parent