public function batchPublish(array $messages) { $records = aray(); foreach ($messages as $message) { $records[] = array('Data' => $message['msgBody'], 'PartitionKey' => $message['routingKey']); } $result = $this->client->putRecords(array_merge(array('StreamName' => $this->streamName, 'Records' => $records), $this->getClientParams())); }
protected function create() { $connectoin = db::factory('mysql'); $sql = "insert into {$this->table} ('"; $sql .= implode(' ', array_keys($this->values)); $sql .= "') values ('"; $clean = aray(); foreach ($this->values as $value) { $clean[] = $connectoin->clean($value); } $sql .= implode("', '", $clean); $this->id = $connectoin->insertGetID($sql); }
function ordercontent_get_node_rec($str, $prefix = 'page_') { $gCms = cmsms(); $tree = $gCms->GetHierarchyManager(); if (!is_numeric($str) && startswith($str, $prefix)) { $str = substr($str, strlen($prefix)); } $id = (int) $str; $tmp = $tree->find_by_tag('id', $id); $content = ''; if ($tmp) { $content = $tmp->getContent(false, true, true); if ($content) { $rec = aray(); $rec['id'] = (int) $str; } } }