Files
juipphp/vendor/jdcloud-api/jdcloud-sdk-php/src/Api/ListShape.php
“wanyongkang” f3c7432100 京东云
2024-05-28 17:04:50 +08:00

36 lines
790 B
PHP

<?php
namespace Jdcloud\Api;
/**
* Represents a list shape.
*/
class ListShape extends Shape
{
private $member;
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'list';
parent::__construct($definition, $shapeMap);
}
/**
* @return Shape
* @throws \RuntimeException if no member is specified
*/
public function getMember()
{
if (!$this->member) {
if (!isset($this->definition['member'])) {
throw new \RuntimeException('No member attribute specified');
}
$this->member = Shape::create(
$this->definition['member'],
$this->shapeMap
);
}
return $this->member;
}
}