Lines Matching defs:array
82 'Message constructor must be an array or null.'
1031 * Populates the message from a user-supplied PHP array. Array keys
1049 * @param array $array An array containing message properties and values.
1052 protected function mergeFromArray(array $array)
1055 foreach ($array as $key => $value) {
1081 * wrapper type $class. If $value is any type other than array, we do
1083 * type checking. If $value is an array, we process each element and
1086 * @param mixed $value The array of values to normalize.
1092 // In the case that $value is not an array, we do not want to
1099 // Normalize each element in the array.
1141 protected function mergeFromJsonArray($array, $ignore_unknown)
1145 $this->setTypeUrl($array["@type"]);
1148 $msg->mergeFromJsonArray($array["value"], $ignore_unknown);
1150 unset($array["@type"]);
1151 $msg->mergeFromJsonArray($array, $ignore_unknown);
1164 $this->setValue($array);
1168 $this->setValue(base64_decode($array));
1172 $this->mergeFrom(GPBUtil::parseDuration($array));
1176 $this->mergeFrom(GPBUtil::parseFieldMask($array));
1180 $this->mergeFrom(GPBUtil::parseTimestamp($array));
1185 foreach($array as $key => $value) {
1192 if (is_bool($array)) {
1193 $this->setBoolValue($array);
1194 } elseif (is_string($array)) {
1195 $this->setStringValue($array);
1196 } elseif (is_null($array)) {
1198 } elseif (is_double($array) || is_integer($array)) {
1199 $this->setNumberValue($array);
1200 } elseif (is_array($array)) {
1201 if (array_values($array) !== $array) {
1202 // Associative array
1208 foreach ($array as $key => $v) {
1221 foreach ($array as $v) {
1233 $this->mergeFromArrayJsonImpl($array, $ignore_unknown);
1236 private function mergeFromArrayJsonImpl($array, $ignore_unknown)
1238 foreach ($array as $key => $value) {
1310 $array = json_decode($input->getData(), true, 512, JSON_BIGINT_AS_STRING);
1312 $array = ["values"=>$array];
1314 if (is_null($array)) {
1324 $this->mergeFromJsonArray($array, $ignore_unknown);