PHP class and extends
| From: | BENARD Jean-philippe | Date: | Tue, 23 Sep 2003 11:59:25 +0000 |
| Subject: | PHP class and extends | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163586@lists.php.net to get a copy of this message | ||
Hi !
I've got a problem with class extends. I've a "top" class which
name is cl_app. xxx_cl_app is an extend of cl_app. Cl_app define a
function called "ExecuteQuery". xxx_cl_app define this function too but
this one is obsolete. Now, I want to use the cl_app "ExecuteQuery"
function in my app but there is a problem :
In the cl_app class, "ExecuteQuery" function return 2 object :
$return = array($nb_lines, $array_results)
and the xxx_cl_app defined this function as :
$return = array($array_results, $nb_lines)
I don't want to recode all others scripts and I don't want to put the
new function code in xxx_cl_app. So here is my question :
Is there something to do in order that when I use
xxx_cl_app->ExecuteQuery(), there's a function ExecuteQuery() in
xxx_cl_app that do something like this :
(xxx_cl_app.php)
function ExecuteQuery(x,y) {
$tmpResult = [herited_class]->ExecuteQuery(x,y);
return array($tmpResult[1], $tmpResult[0]);
}
Thanks in advance !
(o_ BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_ (o_ //\ RENAULT DTSI/ODPS/R@D * ALO * API : MLB 02C 1 14
(/)_ (\)_ V_/_ 2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10