00001 <?php
00002
00005
00025abstractclass CompoundWebServiceextendsWebService00026 {
00027 function __construct() { }
00028
00029 function __destruct() { }
00030
00031 // setSupportedSerialization() is used to set the supported serialization for the compound web service. This function00032 // find the intersection between all the supported serializations that compose the compound web service.00033
00034 // Note: one of the problem with the CompoundWebServices is that they have to be instantiated in order to have $this->supportedSerializations00035 // initialialized. This means that if a CompoundWebService include another CompundWebService, then we have to create the first one,00036 // then to run the setSupportedSerializations() function.00037public function setSupportedSerializations($supportedSerializations)
00038 {
00039 $intersection = array();
00040 $intersectionSet = array();
00041
00042 foreach($supportedSerializations as $ss)
00043 {
00044 foreach($ss as $mime)
00045 {
00046 if(isset($intersection[$mime]))
00047 {
00048 $intersection[$mime] += 1;
00049 }
00050 else00051 {
00052 $intersection[$mime] = 1;
00053 }
00054 }
00055 }
00056
00057 foreach($intersection as $mime => $nb)
00058 {
00059 if($nb == count($supportedSerializations))
00060 {
00061 array_push($intersectionSet, $mime);
00062 }
00063 }
00064
00065 return ($intersectionSet);
00066 }
00067 }
00068
00070
00071 ?>