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


PHP Device::getDevice方法代码示例

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


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

示例1: followPathToEndPoint

 static function followPathToEndPoint($DeviceID, $PortNumber)
 {
     $path = array();
     $n = sizeof($path);
     $dev = new Device();
     $dev->DeviceID = $DeviceID;
     $dev->getDevice();
     $path[$n] = new DevicePorts();
     $path[$n]->DeviceID = $DeviceID;
     $path[$n]->PortNumber = $dev->DeviceType == "Patch Panel" ? -$PortNumber : $PortNumber;
     $path[$n]->getPort();
     // Follow the trail until you get no more connections
     while ($path[$n]->ConnectedDeviceID > 0) {
         $path[++$n] = new DevicePorts();
         $path[$n]->DeviceID = $path[$n - 1]->ConnectedDeviceID;
         // Patch panels have +/- port numbers to designate front/rear, so as you
         // traverse the path, you have to flip
         $path[$n]->PortNumber = -$path[$n - 1]->ConnectedPort;
         $path[$n]->getPort();
     }
     // If the connected device id is null and the label is empty then the port failed to lookup
     // invert the sign and try to get the port again cause this might be a device and not a
     // patch panel
     if ($path[$n]->ConnectedDeviceID == "NULL" && $path[$n]->Label == "") {
         $path[$n]->PortNumber = $path[$n]->PortNumber * -1;
         $path[$n]->getPort();
     }
     return $path;
 }
开发者ID:ghasedak,项目名称:openDCIM,代码行数:29,代码来源:assets.inc.php

示例2:

         $insert = true;
     } else {
         if ($control == Controls::Update) {
             if (isset($_POST["chkStatus"])) {
                 $Device->setStatus($_POST["chkStatus"]);
             } else {
                 $Device->setStatus(0);
             }
             $Device->update();
             $update = true;
         }
     }
 } else {
     if (isset($_GET["DeviceID"]) && isset($_GET["control"])) {
         $control->setValue($_GET["control"]);
         $Device = Device::getDevice($_GET["DeviceID"]);
         if ($Device != null) {
             if ($control == Controls::Update) {
                 echo "<script> \$(function () { \$(window).load(function(){ \$('#modalDevice').modal( { backdrop: 'static', keyboard: false }, 'show');});  });</script>";
             } else {
                 if ($control == Controls::Delete) {
                     $Device->delete();
                     $delete = true;
                 }
             }
         } else {
             require_once '../helper/Utils.php';
             $url = "devices.php";
             Utils::Redirect($url);
         }
     }
开发者ID:luvyatyss,项目名称:nashop,代码行数:31,代码来源:devices.php

示例3: date

                 // sets install date to today when a new device is being created
                 $dev->InstallDate = date("m/d/Y");
                 break;
         }
         // Can't check the device for rights because it shouldn't exist yet
         // but the user could have rights from the cabinet and it is checked above
         // when the device object is populated.
     } elseif ($write && $_POST['action'] == 'Create') {
         // Since the cabinet isn't part of the form for a child device creation
         // it's possible to create a new child that doesn't follow the new cabinet designation
         // we're creatig a device at this point so look up the parent just in case and match
         // the cabinet designations
         if ($dev->ParentDevice) {
             $pdev = new Device();
             $pdev->DeviceID = $dev->ParentDevice;
             $pdev->getDevice();
             $dev->Cabinet = $pdev->Cabinet;
         }
         if ($dev->TemplateID > 0 && intval($dev->NominalWatts == 0)) {
             $dev->UpdateWattageFromTemplate();
         }
         $dev->CreateDevice();
         $dev->SetTags($tagarray);
         updateCustomValues($dev);
         // We've, hopefully, successfully created a new device. Force them to the new device page.
         header('Location: ' . redirect("devices.php?DeviceID={$dev->DeviceID}"));
         exit;
     }
 }
 /*
  * Prepare data for display
开发者ID:spezialist1,项目名称:openDCIM,代码行数:31,代码来源:devices.php

示例4: Product

$p = new Product();
$c = new Category();
$device = new Device();
$bra = new Brand();
$flag = 0;
if (isset($_GET["CatID"]) && !empty($_GET["CatID"])) {
    $catID = $_GET["CatID"];
    $c = Category::getCat($catID);
    $p->setCatPro($c);
    $flag = 1;
}
if (isset($_GET["DeviceID"]) && !empty($_GET["DeviceID"])) {
    $devID = $_GET["DeviceID"];
    $c->setDevice(new Device($devID));
    require_once 'entities/Device.php';
    $device = Device::getDevice($devID);
    $p->setCatPro($c);
    $flag = 2;
}
if (isset($_GET["BraID"]) && !empty($_GET["BraID"])) {
    $braID = $_GET["BraID"];
    $c->setBrand(new Brand($braID));
    require_once 'entities/Brand.php';
    $bra = Brand::getBrand($braID);
    $p->setCatPro($c);
    $flag = 3;
}
if ($flag != 0) {
    $ListPro = $p->loadLimit($rowsPerPage, $offset, "CatProID");
    $numberOfRows = $p->countRecords();
    ?>
开发者ID:luvyatyss,项目名称:nashop,代码行数:31,代码来源:productsByCat.php


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