/** * @param array $application_properties An associative array of string keys pointing to simple Value instances */ public function __construct(array $application_properties) { parent::__construct(); $this->value = new map(); foreach ($application_properties as $key => $value) { if (!is_string($key)) { throw new InvalidArgumentException('Only string keys are permitted'); } if (!$value instanceof Value) { throw new InvalidArgumentException('Only Value object values are permitted'); } if ($value instanceof map || $value instanceof _array || $value instanceof _list) { throw new InvalidArgumentException('Only simple Value object values are permitted (ie not map, list or _array)'); } $amqpKey = new string($key); $this->value->set($amqpKey, $value); } }
/** * @param array $annotations */ public function __construct(array $annotations = array()) { parent::__construct(); $this->value = new map(); foreach ($annotations as $key => $value) { if (is_int($key)) { $amqpKey = new ulong($key); } else { if (is_string($key)) { $amqpKey = new symbol($key); } else { throw new InvalidArgumentException('Only ulong (int) or symbolic (string) annotation keys are permitted'); } } if (!$value instanceof Value) { throw new InvalidArgumentException('Only Value object annotation values are permitted'); } $this->value->set($amqpKey, $value); } }
/** * */ protected function __construct() { parent::__construct(); $this->value = new _list(); }
/** * */ public function __construct() { parent::__construct(); $this->value = new _list(); }