public function draw()
    {
        foreach ($this->pageParts as $part) {
            if (is_object($part)) {
                if (method_exists($part, 'drawIfNotDrawn')) {
                    $part->drawIfNotDrawn();
                } else {
                    $part->draw();
                }
            } else {
                echo $part;
            }
        }
        $this->drawStatus = true;
    }
public function draw()
    {
        foreach ($this->pageParts as $part) {
            if (is_object($part)) {
                if (method_exists($part, 'drawIfNotDrawn')) {
                    $part->drawIfNotDrawn();
                } else {
                    $part->draw();
                }
            } else {
                echo $part;
            }
        }
        $this->drawStatus = true;
    }
public function draw ( ) { foreach ( $ this -> pageParts as $ part ) { if ( is_object ( $ part ) ) { if ( method_exists ( $ part , 'drawIfNotDrawn' ) ) { $ part -> drawIfNotDrawn ( ) ; } else { $ part -> draw ( ) ; } } else { echo $ part ; } } $ this -> drawStatus = true ; }
Recursive draw object and its contents
Recursive draw object and its contents