Php multi-interface implementation method. Php multi-interface implementation method this article describes how to implement multiple php interfaces. Share it with you for your reference. The details are as follows :? 123456789101112131415161718 implementation of multiple php interfaces
This example describes how to implement multiple php interfaces. Share it with you for your reference. The details are as follows:
?
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 |
Interface staff_i1 // interface 1
{
Function setID ($ id );
Function getID ();
}
Interface staff_i2 // interface 2
{
Function setName ($ name );
Function getName ();
}
Class staff implements staff_i1, staff_i2 // interface implementation
{
Private $ id;
Private $ name;
Function setID ($ id)
{
$ This-> id = $ id;
}
Function getID ()
{
Return $ this-> id;
}
Function setName ($ name)
{
$ This-> name = $ name;
}
Function getName ()
{
Return $ this-> name;
}
Function otherFunc ()
{
Echo "Test ";
}
}
?>
|
I hope this article will help you with php programming.
Examples in this article describes how to implement multiple php interfaces. Share it with you for your reference. The details are as follows :? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18...