本文整理汇总了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);
}
示例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);
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
}