当前位置: 首页>>代码示例>>PHP>>正文


PHP anyC::addJoinV3方法代码示例

本文整理汇总了PHP中anyC::addJoinV3方法的典型用法代码示例。如果您正苦于以下问题:PHP anyC::addJoinV3方法的具体用法?PHP anyC::addJoinV3怎么用?PHP anyC::addJoinV3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在anyC的用法示例。


在下文中一共展示了anyC::addJoinV3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerSettings

 public function registerSettings()
 {
     $tab = new HTMLTable(2, "Telnet-Commands");
     $tab->maxHeight(500);
     $this->registerType($tab, "FHZ");
     $this->registerType($tab, "FS20");
     $this->registerType($tab, "FHT");
     $this->registerType($tab, "IT");
     $this->registerType($tab, "CUL_HM");
     $this->registerType($tab, "CUL_EM");
     $this->registerType($tab, "dummy");
     $oldServer = "";
     $T = null;
     $ac = new anyC();
     $ac->setCollectionOf("Fhem");
     $ac->addJoinV3("FhemServer", "FhemServerID", "=", "FhemServerID");
     $ac->addOrderV3("t1.FhemServerID");
     $ac->addAssocV3("FhemType", "=", "notify");
     $ac->addAssocV3("FhemServerType", "=", "0");
     $oldServer = "";
     while ($t = $ac->getNextEntry()) {
         try {
             if ($oldServer != $t->A("FhemServerID")) {
                 $T = new Telnet($t->A("FhemServerIP"), $t->A("FhemServerPort"));
             }
         } catch (NoServerConnectionException $e) {
             die("error:'The connection to the server with IP-address " . $t->A("FhemServerIP") . " could not be established!'");
         }
         #$tel = "define ".$t->getA()->FhemName." notify ".$t->getA()->FhemRunOn." ".str_replace("\n"," ",$t->getA()->FhemCommand);
         #$T->fireAndForget($tel);
         $tel = $t->getDefineCommand();
         foreach ($tel as $c) {
             $T->fireAndForget($c);
         }
         $tab->addRow(array($t->A("FhemServerName"), implode("<br />", $tel)));
         $oldServer = $t->A("FhemServerID");
     }
     $ac = new mFhemPresetGUI();
     $ac->addJoinV3("FhemServer", "FhemPresetServerID", "=", "FhemServerID");
     $ac->addJoinV3("FhemEvent", "FhemPresetID", "=", "FhemEventPresetID");
     $ac->addJoinV3("Fhem", "t3.FhemEventFhemID", "=", "FhemID");
     #sleep 0.5;;
     $ac->setFieldsV3(array("FhemEventAction", "FhemPresetRunOn", "FhemPresetName", "FhemServerIP", "FhemPresetNightOnly", "FhemServerName", "FhemServerPort", "t2.FhemServerID", "FhemName", "FhemEventFhemID"));
     $ac->addOrderV3("FhemPresetID");
     $ac->addOrderV3("FhemEventID");
     $ac->addAssocV3("FhemServerType", "=", "0");
     $tab->addRow(array("", ""));
     $tab->addRowColspan(1, 2);
     $command = "";
     $oldServer = "";
     while ($b = $ac->getNextEntry()) {
         try {
             if ($oldServer != $b->A("FhemServerID")) {
                 $T = new Telnet($b->A("FhemServerIP"), $b->A("FhemServerPort"));
             }
         } catch (NoServerConnectionException $e) {
             die("error:'The connection to the server with IP-address " . $t->A("FhemServerIP") . " could not be established!'");
         }
         if ($b->A("FhemEventFhemID") != "-1") {
             $command .= "set " . $b->A("FhemName") . " " . $b->A("FhemEventAction") . ";;";
         } else {
             $command .= $b->A("FhemEventAction") . ";;";
         }
         $next = $ac->getNextEntry();
         if ($next == null or $next->A("FhemPresetID") != $b->A("FhemPresetID")) {
             $runOn = null;
             if ($b->A("FhemPresetRunOn") != "") {
                 $runOn = $b->A("FhemPresetRunOn");
             }
             $d = "";
             if ($runOn == null) {
                 $d = "define " . $b->A("FhemPresetName") . " dummy";
             }
             $c = "define n" . $b->A("FhemPresetID") . " notify " . ($runOn == null ? $b->A("FhemPresetName") : $runOn) . " {fhem(\"" . str_replace("%", "%%", $command) . "\") " . ($b->A("FhemPresetNightOnly") == "1" ? "if(!isday())" : "") . "}";
             $tab->addRow(array($b->A("FhemPresetName") . "<br />" . $b->A("FhemServerName"), $d . "<br />" . $c));
             if ($runOn == null) {
                 $T->fireAndForget($d);
             }
             $T->fireAndForget($c);
             $command = "";
         }
         if ($next != null) {
             $ac->subPointer();
         }
     }
     /*$oldServer = "";
     		while($b = $ac->getNextEntry()){
     			try {
     				if($oldServer != $b->getA()->FhemServerID) $T = new Telnet($b->getA()->FhemServerIP, $b->getA()->FhemServerPort);
     			} catch(NoFhemServerConnectionException $e){
     				die("error:'The connection to the server with IP-address ".$t->getA()->FhemServerIP." could not be established!'");
     			}
     
     			$c = "define n".$b->getA()->FhemPresetID." notify ".$b->getA()->FhemPresetName." {fhem(\"".str_replace("%","%%",$b->getA()->action)."\") ".($b->getA()->FhemPresetNightOnly == "1" ? "if(!isday())" : "")."}";
     			$d = "define ".$b->getA()->FhemPresetName." dummy";
     			$tab->addRow(array($b->getA()->FhemPresetName."<br />".$b->getA()->FhemServerName,$d."<br />".$c));
     
     			$T->fireAndForget($d);
     			$T->fireAndForget($c);
     
//.........这里部分代码省略.........
开发者ID:nemiah,项目名称:fheME,代码行数:101,代码来源:FhemControlGUI.class.php


注:本文中的anyC::addJoinV3方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。