PHP OOP sorun

0 Cevap php

Ben sınıfını genişletmek sınıfları Video ve Audio, var Popular

Sınıf, Video & in Ses "() public static function ayrıştırma" kendilerini farklı bir fonksiyonudur

So, as I can from the class of "Popular" address to the class that calls? That is in a class of "Popular" is a function of "getSong" which has a function call "parsing ()", but here's how to call this function from the class that turns .. Hopefully clearly explained .. Kind of like the opposite function of need "parent"

class Video extends Popular {

    public static function parsing()
    {
        return 'Videooooooooooooo';
        .....
    }

    public static fuinction tratata()
    {
    ....
    }

}

class Audio extends Popular {

    public static function parsing()
    {
       .............
        return 'Audio';
        .....
    }

    public static fuinction tratata()
    {
    ....
    }

}

class Popular {

    public static function getSong()
    {
        $class = '???????';//Video or Audio???
        $class::parsing();// ???
    }

}

Kötü İngilizce kullanılabilir .. google traslate için üzgünüm

0 Cevap