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


PHP AbstractEntity::build方法代码示例

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


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

示例1: build

 /**
  * Build a new backup window instance
  *
  * @param \stdClass|array|null $parameters
  */
 public function build($parameters)
 {
     if (is_null($parameters)) {
         return;
     }
     parent::build($parameters);
 }
开发者ID:fideloper,项目名称:DigitalOceanV2,代码行数:12,代码来源:NextBackupWindow.php

示例2: build

 /**
  * @param array $parameters
  */
 public function build(array $parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         if ('region' === $property && is_object($value)) {
             $this->region = new Region($value);
         }
     }
 }
开发者ID:mix376,项目名称:DigitalOceanV2,代码行数:12,代码来源:Action.php

示例3: build

 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         if ('region' === $property) {
             $this->region = new Region($value);
             continue;
         }
     }
 }
开发者ID:BAY-A,项目名称:Gravity-Forms-DigitalOcean,代码行数:13,代码来源:Action.php

示例4: build

 /**
  * @param array $parameters
  */
 public function build(array $parameters)
 {
     parent::build($parameters);
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'region':
                 if (is_object($value)) {
                     $this->region = new Region($value);
                 }
                 unset($parameters[$property]);
                 break;
         }
     }
 }
开发者ID:robertol,项目名称:DigitalOceanV2,代码行数:17,代码来源:Volume.php

示例5: build

 /**
  * @param array $parameters
  */
 public function build(array $parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'networks':
                 if (is_object($value)) {
                     if (property_exists($value, 'v4')) {
                         foreach ($value->v4 as $subProperty => $subValue) {
                             $subValue->version = 4;
                             $this->networks[] = new Network($subValue);
                         }
                     }
                     if (property_exists($value, 'v6')) {
                         foreach ($value->v6 as $subProperty => $subValue) {
                             $subValue->version = 6;
                             $subValue->cidr = $subValue->netmask;
                             $subValue->netmask = null;
                             $this->networks[] = new Network($subValue);
                         }
                     }
                 }
                 unset($parameters[$property]);
                 break;
             case 'kernel':
                 if (is_object($value)) {
                     $this->kernel = new Kernel($value);
                 }
                 unset($parameters[$property]);
                 break;
             case 'size':
                 if (is_object($value)) {
                     $this->size = new Size($value);
                 }
                 unset($parameters[$property]);
                 break;
             case 'region':
                 if (is_object($value)) {
                     $this->region = new Region($value);
                 }
                 unset($parameters[$property]);
                 break;
             case 'image':
                 if (is_object($value)) {
                     $this->image = new Image($value);
                 }
                 unset($parameters[$property]);
                 break;
             case 'next_backup_window':
                 $this->nextBackupWindow = new NextBackupWindow($value);
                 unset($parameters[$property]);
                 break;
         }
     }
     parent::build($parameters);
     if (is_array($this->features) && count($this->features)) {
         $this->backupsEnabled = in_array('backups', $this->features);
         $this->virtIOEnabled = in_array('virtio', $this->features);
         $this->privateNetworkingEnabled = in_array('private_networking', $this->features);
         $this->ipv6Enabled = in_array('ipv6', $this->features);
     }
 }
开发者ID:mix376,项目名称:DigitalOceanV2,代码行数:64,代码来源:Droplet.php


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