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


PHP AbstractObject::__get方法代码示例

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


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

示例1: __get

 public function __get($name)
 {
     switch ($name) {
         case 'name':
             return $this->description;
     }
     return parent::__get($name);
 }
开发者ID:yamdrok,项目名称:virtualbox-php,代码行数:8,代码来源:os.inc.php

示例2: __get

 public function __get($name)
 {
     switch ($name) {
         case 'shortname':
             $value = $this->get('name');
             foreach (array('.vdi', '.vmdk') as $suffix) {
                 if (strrpos($value, $suffix) === strlen($value) - strlen($suffix)) {
                     return substr($value, 0, strrpos($value, $suffix));
                 }
             }
             return $value;
         case 'time':
             if ($this->has('path')) {
                 return filemtime($this->get('path'));
             }
             return 0;
         case 'autoreset':
             return $this->get('autoreset', 'off');
     }
     return parent::__get($name);
 }
开发者ID:yamdrok,项目名称:virtualbox-php,代码行数:21,代码来源:objects.inc.php

示例3: __get

 public function __get($name)
 {
     switch ($name) {
         // booleans
         case 'bioslogofadein':
         case 'bioslogofadeout':
         case 'acpi':
         case 'ioapic':
         case 'pae':
         case 'hpet':
         case 'rtcuseutc':
         case 'hwvirtex':
             //		case 'hwvirtexexcl':
         //		case 'hwvirtexexcl':
         case 'nestedpaging':
         case 'largepages':
         case 'pagefusion':
         case 'vtxvpid':
         case 'synthcpu':
         case 'accelerate2dvideo':
         case 'accelerate3d':
         case 'usb':
         case 'usbehci':
         case 'vrde':
             return $this->get($name, 'off') == 'on';
             // integers
         // integers
         case 'cpus':
         case 'memory':
         case 'vram':
         case 'bioslogodisplaytime':
         case 'biossystemtimeoffset':
             return intval($this->get($name, '0'));
             // storage controllers
         // storage controllers
         case 'storage0':
         case 'storage1':
         case 'storage2':
         case 'storage3':
         case 'storage4':
         case 'storage5':
         case 'storage6':
         case 'storage7':
             $i = substr($name, 7);
             if (!$this->has('storagecontrollername' . $i)) {
                 break;
             }
             $name = $this->get('storagecontrollername' . $i, '');
             $ports = intval($this->get('storagecontrollerportcount' . $i, '0'));
             $maxdevices = intval($this->get('storagecontrollermaxdeviceperport' . $i, '0'));
             $devices = array();
             for ($j = 0; $j < $ports; $j++) {
                 for ($k = 0; $k < $maxdevices; $k++) {
                     $slot = $name . '-' . $j . '-' . $k;
                     if (!$this->has($slot)) {
                         continue;
                     }
                     if ($this->endsWith($slot, '.vdi') || $this->endsWith($slot, '.vmdk')) {
                         $devices[$j][$k] = Repository::getHdd($this->get($slot));
                     } else {
                         if ($this->get($slot) == 'emptydrive') {
                             $devices[$j][$k] = new DVD();
                         } else {
                             $devices[$j][$k] = Repository::getDvd($this->get($slot));
                         }
                     }
                 }
             }
             return array('name' => $name, 'type' => $this->get('storagecontrollertype' . $i, 'none'), 'instance' => intval($this->get('storagecontrollerinstance' . $i, '0')), 'ports' => array('count' => $ports, 'min' => intval($this->get('storagecontrollerminportcount' . $i, '0')), 'max' => intval($this->get('storagecontrollermaxportcount' . $i, '0')), 'maxdevices' => $maxdevices), 'devices' => $devices);
             // fdd controllers
         // fdd controllers
         case 'fd0':
         case 'fd1':
             $slot = 'FLOPPY-0-0';
             switch ($name) {
                 case 'fd0':
                     $slot = 'FLOPPY-0-0';
                     break;
                 case 'fd1':
                     $slot = 'FLOPPY-0-1';
                     break;
             }
             if (!$this->has($slot)) {
                 break;
             }
             if ($this->get($slot) == 'emptydrive') {
                 return new FDD();
             }
             return Repository::getFdd($this->get($slot));
             // ide controllers
         // ide controllers
         case 'ide0':
         case 'ide1':
         case 'ide2':
         case 'ide3':
             $slot = 'IDE-0-0';
             switch ($name) {
                 case 'ide0':
                     $slot = 'IDE-0-0';
                     break;
//.........这里部分代码省略.........
开发者ID:yamdrok,项目名称:virtualbox-php,代码行数:101,代码来源:machine.inc.php


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