PHP:检查子方法或直接调用方法

Maybe my class structure is wrong, so hopefully I can get some advice.

I have a class called 'Character'; it is an abstract class. From it extends a class called 'savageworldsCharacter'. They both contain a method called save; the 'Character' save method does general save stuff, while the 'savageworldsCharacter' save method processes data and then calls parent::save().

I now have a class called 'hellfrostCharacter', which extends from 'savageworldsCharacter'. It does some stuff differently, but also has a save method, which works largely the same. The difference is that when I call save in hellfrostCharacter, I DON'T want it to process the data in savageworldsCharacter::save, and instead skip straight to Character::save.

Is there a way I can tell if a method is called from an instantiated object or from a child class? Am I building my classes wrong?

Independently from whether your design is good or bad, you can achieve it by comparing get_class() with get_called_class():

<?php
    class Character {
        public function save() {
            if(get_class() == get_called_class()) {
                echo "called directly";
            } else {
                echo "called from child class";
            }
        }
    }

    class savageworldsCharacter extends Character {
    }

    $character1 = new Character();
    $character2 = new savageworldsCharacter();

    $character1->save(); //outputs "called directly"
    $character2->save(); //outputs "called from child class"
?>

However, as said, that's merely the technical perspective. If the behavior of the method is different depending on which child class called it, then maybe it's better to also write a separate method in the child class. If you have some similarities, you may create helper methods in the parent class, which is called by both the child save() method and the parent save() method.

These are just some basic thougs. Without further context it's difficult to give more specific tips.