Next4Me
 All Classes Files Functions Variables
CmplxChannelAndDetail.php
Go to the documentation of this file.
1 <?php
26 class Application_Model_CmplxChannelAndDetail extends Zend_Db_Table
27 {
28  //============ Start getChannelAndDetail =================================================
35  function getChannelAndDetail($entity){
36  $this->Channel = new Application_Model_Channel();
37  $this->ChannelType= new Application_Model_ChannelType();
38  $channelType=array();
39 
40  $channelTypeRowset=$this->ChannelType->getChannelType($entity);
41  if($channelTypeRowset['resultId']=="0"){
42  //echo "<pre>"; print_r($channelTypeRowset); echo "</pre>";
43  foreach ($channelTypeRowset['resultCode']['entity'] as $channelTypeRow){
44  $channel=array();
45  $data=array("IdChannelType"=>$channelTypeRow['IdChannelType'], "IdChannel"=>'0', "IdUserAccount"=>$entity['IdUserAccount'], "UserAccountType"=>$entity['UserAccountType']);
46  $channelRowset=$this->Channel->getChannel($data);
47  if($channelRowset['resultId']=="0"){
48  foreach ($channelRowset['resultCode']['entity'] as $channelRow){
49  $channel[]=array("IdChannel"=>$channelRow['IdChannel'],
50  "IdChannelType"=>$channelRow['IdChannelType'],
51  "ChannelName"=>$channelRow['ChannelName'],
52  "Target"=>$channelRow['Target'],
53  "Activ"=>$channelRow['Activ'],
54  "IdUserAccount"=>$channelRow['IdUserAccount']);
55  }
56  }
57  $channelType=array("IdChannelType"=>$channelTypeRow['IdChannelType'],
58  "NameChannelType"=>$channelTypeRow['NameChannelType'],
59  "Channel"=>$channel);
60  }
61  $result=array("resultId"=>$channelTypeRowset['resultId'], "resultCode"=>$channelType);
62  }else{
63  $result=array("resultId"=>$channelTypeRowset['resultId'], "resultCode"=>$channelTypeRowset['resultCode']);
64  }
65  return array("commit"=>"1","entity"=>$result);
66  }
67 }