Example #1
0
    public function getIsWealthy()
    {
        return $this->isWealthy;
    }
    /**
     * @param mixed $isWealthy
     */
    public function setIsWealthy($isWealthy)
    {
        $this->isWealthy = $isWealthy;
    }
}
$dog = new Animal();
$dog->name = 'Maximus';
$dog->hasHair = true;
$dog->setIsWealthy(false);
class Human extends Animal
{
    public function __construct($isWealthy)
    {
        $this->isWealthy = $isWealthy;
    }
    /**
     * If the person is wealthy, say they are, otherwise, say they are not
     * @return string
     */
    public function checkWealth()
    {
        if ($this->isWealthy) {
            return 'Yeah you\'re doing good';
        } else {