bir sınıf çalışma birçok sınıfında, PHP OOP

0 Cevap php

i class "User_registration" var ve bu sınıfta i kullandığımız birçok sınıf gerekir: "Location", "Bağlantılar", "Posta", "Modül".

i create include all class in file: include 'class/location.php'; include 'class/links.php'; include 'class/mail.php'; include 'class/modules.php';

Şimdi "User_registration" sınıf oluşturmak.

<?php
class User_registration{

    public function insert_to_db($name, $country_code, $home_page)
    {
        //work with data

        return id;
    }

    public function show_info($id)
    {
        //work with data
    }

}

$reg_u = new User_registration;
$res = $reg_u->insert_to_db($name, $country_code, $home_page);

if($res){
    $reg_u->show_info($res);
}
?>

I need in method "insert_to_db" run class: "Location", "Links", "Mail" methods and in "show_info" run some methods of "Location", "Links", "Module" class.

Nasıl? Bir sınıftan başka bir sınıfa nasıl koşmak (bir no't)

Yardımın için teşekkürler ;)

0 Cevap