本文整理汇总了PHP中eqLogic::all方法的典型用法代码示例。如果您正苦于以下问题:PHP eqLogic::all方法的具体用法?PHP eqLogic::all怎么用?PHP eqLogic::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eqLogic
的用法示例。
在下文中一共展示了eqLogic::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dataStore
/* * ************************datastore*************************** */
if ($jsonrpc->getMethod() == 'datastore::byTypeLinkIdKey') {
$jsonrpc->makeSuccess(dataStore::byTypeLinkIdKey($params['type'], $params['linkId'], $params['key']));
}
if ($jsonrpc->getMethod() == 'datastore::save') {
$dataStore = new dataStore();
$dataStore->setType($params['type']);
$dataStore->setKey($params['key']);
$dataStore->setValue($params['value']);
$dataStore->setLink_id($params['linkId']);
$dataStore->save();
$jsonrpc->makeSuccess('ok');
}
/* * ************************Equipement*************************** */
if ($jsonrpc->getMethod() == 'eqLogic::all') {
$jsonrpc->makeSuccess(utils::o2a(eqLogic::all()));
}
if ($jsonrpc->getMethod() == 'eqLogic::byType') {
$jsonrpc->makeSuccess(utils::o2a(eqLogic::byType($params['type'])));
}
if ($jsonrpc->getMethod() == 'eqLogic::byObjectId') {
$jsonrpc->makeSuccess(utils::o2a(eqLogic::byObjectId($params['object_id'])));
}
if ($jsonrpc->getMethod() == 'eqLogic::byId') {
$eqLogic = eqLogic::byId($params['id']);
if (!is_object($eqLogic)) {
throw new Exception('EqLogic introuvable : ' . $params['id'], -32602);
}
$jsonrpc->makeSuccess(utils::o2a($eqLogic));
}
if ($jsonrpc->getMethod() == 'eqLogic::fullById') {
示例2: foreach
<option value="all">{{Tous}}</option>
<?php
foreach (object::all() as $object) {
echo '<option value="' . $object->getId() . '" >' . $object->getName() . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">{{Limiter à l'équipement}}</label>
<div class="col-sm-4">
<select class='interactAttr form-control' data-l1key='filtres' data-l2key='eqLogic_id' >
<option value="all">{{Tous}}</option>
<?php
foreach (eqLogic::all() as $eqLogic) {
echo '<option value="' . $eqLogic->getId() . '" >' . $eqLogic->getHumanName() . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">{{Limiter au plugin}}</label>
<div class="col-sm-4">
<select class='interactAttr form-control' data-l1key='filtres' data-l2key='plugin'>
<option value="all">{{Tous}}</option>
<?php
foreach (eqLogic::allType() as $type) {
echo '<option value="' . $type['type'] . '" >' . $type['type'] . '</option>';
}
示例3: changeMode
public static function changeMode($_mode)
{
switch ($_mode) {
case 'master':
if (config::byKey('jeeNetwork::mode') != 'master') {
$cron = new cron();
$cron->setClass('history');
$cron->setFunction('historize');
$cron->setSchedule('*/5 * * * * *');
$cron->setTimeout(5);
$cron->save();
$cron = new cron();
$cron->setClass('scenario');
$cron->setFunction('check');
$cron->setSchedule('* * * * * *');
$cron->setTimeout(5);
$cron->save();
$cron = new cron();
$cron->setClass('cmd');
$cron->setFunction('collect');
$cron->setSchedule('*/5 * * * * *');
$cron->setTimeout(5);
$cron->save();
$cron = new cron();
$cron->setClass('history');
$cron->setFunction('archive');
$cron->setSchedule('00 * * * * *');
$cron->setTimeout(20);
$cron->save();
config::save('jeeNetwork::mode', 'master');
}
break;
case 'slave':
if (config::byKey('jeeNetwork::mode') != 'slave') {
foreach (eqLogic::all() as $eqLogic) {
$eqLogic->remove();
}
foreach (object::all() as $object) {
$object->remove();
}
foreach (update::all() as $update) {
switch ($update->getType()) {
case 'core':
break;
case 'plugin':
try {
$plugin = plugin::byId($update->getLogicalId());
if (is_object($plugin) && $plugin->getAllowRemote() != 1) {
$update->deleteObjet();
}
} catch (Exception $e) {
}
break;
default:
$update->deleteObjet();
break;
}
}
foreach (view::all() as $view) {
$view->remove();
}
foreach (plan::all() as $plan) {
$plan->remove();
}
foreach (scenario::all() as $scenario) {
$scenario->remove();
}
foreach (listener::all() as $listener) {
$listener->remove();
}
$cron = cron::byClassAndFunction('history', 'historize');
if (is_object($cron)) {
$cron->remove();
}
$cron = cron::byClassAndFunction('scenario', 'check');
if (is_object($cron)) {
$cron->remove();
}
$cron = cron::byClassAndFunction('cmd', 'collect');
if (is_object($cron)) {
$cron->remove();
}
$cron = cron::byClassAndFunction('history', 'archive');
if (is_object($cron)) {
$cron->remove();
}
$user = new user();
$user->setLogin('jeedom_master');
$user->setPassword(config::genKey(255));
$user->setRights('admin', 1);
$user->save();
config::save('jeeNetwork::mode', 'slave');
}
break;
}
}