根据私信ID批量获取私信内容

对应API：{@link http://open.weibo.com/wiki/2/direct_messages/show_batch direct_messages/show_batch}

@param string  $dmids 需要查询的私信ID，用半角逗号分隔，一次最多50个
@return array
499119
function dm_show_batch( $dmids )
	{
		$params = array();
		if (is_array($dmids) && !empty($dmids)) {
			foreach($dmids as $k => $v) {
				$this->id_format($dmids[$k]);
			}
			$params['dmids'] = join(',', $dmids);
		} else {
			$params['dmids'] = $dmids;
		}
		return $this->oauth->get( 'direct_messages/show_batch',  $params );
	}
713729
public function getIds()
    {
        $res = array();
        $array = wincache_ucache_info();
        $records = $array['ucache_entries'];
        foreach ($records as $record) {
            $res[] = $record['key_name'];
        }
        return $res;
    }
316765
public static function getUidByClientId($client_id)
    {
        $data = static::select(array('uid'), array('client_id'=>array($client_id)));
        foreach ($data as $local_ip => $buffer_array) {
            foreach ($buffer_array as $local_port => $items) {
                //$items = ['connection_id'=>['uid'=>x, 'group'=>[x,x..], 'session'=>[..]], 'client_id'=>[..], ..];
                foreach ($items as $info) {
                    return $info['uid'];
                }
            }
        }
    }
207321
public function getIds()
    {
        $res = array();
        $array = apc_cache_info('user', false);
        $records = $array['cache_list'];
        foreach ($records as $record) {
            $res[] = $record['info'];
        }
        return $res;
    }
1099330
function account_education_batch( $uids  )
	{
		$params = array();
		if (is_array($uids) && !empty($uids)) {
			foreach($uids as $k => $v) {
				$this->id_format($uids[$k]);
			}
			$params['uids'] = join(',', $uids);
		} else {
			$params['uids'] = $uids;
		}

		return $this->oauth->get( 'account/profile/education_batch', $params );
	}
1088573
public function batchReadByID(array $objectTypeIDs) {
        $requests = [];

        foreach ($objectTypeIDs as $objectTypeID) {
            $requests[] = [
                'method' => 'cmdb.object_type_categories.read',
                'params' => [
                    'type' => $objectTypeID
                ]
            ];
        }

        return $this->api->batchRequest($requests);
    }
1078966
function show_batch( $ids )
	{
		$params=array();
		if (is_array($ids) && !empty($ids)) {
			foreach($ids as $k => $v) {
				$this->id_format($ids[$k]);
			}
			$params['ids'] = join(',', $ids);
		} else {
			$params['ids'] = $ids;
		}
		return $this->oauth->get('statuses/show_batch', $params);
	}
679313
public function getUserinfo($uid = null)
	{
		$ret = array();
		if (extension_loaded('posix')) {
			if (is_null($uid)) {
				$uid = posix_geteuid();	// get effective userid
			} elseif (is_string($uid)) {
				// username passed?
				$ret = posix_getpwnam($uid);
			}
			if (empty($ret)) {
				$ret = posix_getpwuid($uid);
			}
			$ret['group'] = posix_getgrgid($uid_info['gid']);
			unset($ret['gid']);	// is inside group array
		}
		return $ret;
	}
1220677
public function getInfo($id)
    {
        // 验证有效性
        if ($this->isValid($id) === false) {
            return false;
        }
        $code = $this->_checkIdArgument($id);
        $addressInfo = $this->_getAddressInfo($code['addressCode'], $code['birthdayCode']);

        return [
            'addressCode'   => $code['addressCode'],
            'abandoned'     => isset($this->_addressCodeList[$code['addressCode']]) ? 0 : 1,
            'address'       => is_array($addressInfo) ? implode($addressInfo) : '',
            'addressTree'   => array_values($addressInfo),
            'birthdayCode'  => date('Y-m-d', strtotime($code['birthdayCode'])),
            'constellation' => $this->_getConstellation($code['birthdayCode']),
            'chineseZodiac' => $this->_getChineseZodiac($code['birthdayCode']),
            'sex'           => ($code['order'] % 2 === 0 ? 0 : 1),
            'length'        => $code['type'],
            'checkBit'      => $code['checkBit'],
        ];
    }
11144
def direct_messages_show(self, id):
        
        params = {}
        set_str_param(params, 'id', id)
        d = self._get_api('direct_messages/show.json', params)
        d.addCallback(lambda dms: dms[0])
        return d
1139554
public function getMessagesByCommand($commandUuid): array
    {
        $messagesByUuid = [];
        /** @var Message $message */
        foreach ($this->messages as $message) {
            if ($message->commandUuid === $commandUuid) {
                $messagesByUuid[] = $message;
            }
        }

        return $messagesByUuid;
    }
777285
public function getIds(): array {
        $ids  = array($this->id);
        $meta = $this->getMetadata();
        foreach ($meta->allResources(RC::idProp()) as $id) {
            $ids[] = $id->getUri();
        }
        $ids = array_unique($ids);
        return $ids;
    }
464783
public function getDirectMessagesById($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('direct_messages', 'show');

		// Set the API path
		$path = '/direct_messages/show.json';

		$data['id'] = $id;

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}
1057271
public function getMediasRawData()
    {
        if (null === ($translation = $this->getTranslation(true))) {
            return ['ids' => []];
        }

        $ids = [];
        foreach ($translation->getMedias() as $media) {
            $ids[] = $media->getId();
        }

        return ['ids' => $ids];
    }
881622
private function getChannelIdsInclusiveSubChannels($channelIds)
    {
        $subChannelIds = [];

        foreach ($channelIds as $channelId) {
            $subChannels = $this->getChannelList()->getChildren($channelId);
            $subChannelIds = array_merge($subChannelIds, $subChannels->map(function (Channel $channel) {
                return $channel->getId();
            })->toArray());
        }

        return empty($subChannelIds)
            ? $channelIds
            : array_merge($channelIds, $this->getChannelIdsInclusiveSubChannels($subChannelIds));
    }
1321924
public function prepareRequestMessage(DmmRequest $request)
    {
        $url = $this->getBaseApiUrl() . $request->getUrl();
        $requestBody = $request->getUrlEncodedBody();
        if ($request->getMethod() == "POST") {
            $request->setHeaders([
                'Content-Type' => 'application/x-www-form-urlencoded',
            ]);
        }

        return [
            $url,
            $request->getMethod(),
            $request->getHeaders(),
            $requestBody->getBody(),
        ];
    }
226520
function send_dm_by_id( $uid, $text, $id = NULL )
	{
		$params = array();
		$this->id_format( $uid );
		$params['text'] = $text;
		$params['uid'] = $uid;
		if ($id) {
			$this->id_format( $id );
			$params['id'] = $id;
		}
		return $this->oauth->post( 'direct_messages/new', $params );
	}