当前位置: 首页>>代码示例>>PHP>>正文


PHP Streams::get方法代码示例

本文整理汇总了PHP中Streams::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Streams::get方法的具体用法?PHP Streams::get怎么用?PHP Streams::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Streams的用法示例。


在下文中一共展示了Streams::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Streams_publisher_get

/**
 * Used to get list of streams
 *
 * @param string $params 
 *   publisher id and stream name of existing stream shall be supplied
 * @return {void}
 *   array of streams indexed by names
 */
function Streams_publisher_get($params)
{
    // only logged in user can get stream
    $user = Users::loggedInUser(true);
    $publisherId = Streams::requestedPublisherId(true);
    $name = Streams::requestedName(true);
    $options = array_merge($_REQUEST, $params);
    return Streams::get($user->id, $publisherId, $name, $options);
}
开发者ID:dmitriz,项目名称:Platform,代码行数:17,代码来源:get.php

示例2: Streams_category_tool

/**
 * This tool generates a category selector.
 *
 * @param array $options
 *  An associative array of parameters, containing:
 *  "publisherId" => Optional. publisherId of the stream to present. If "stream" parameter is empty
 *    defaults to Streams::requestedPublisherId()
 *  "name" => Optional. the name of the stream to present. If "stream" parameter is empty
 *    defaults to Streams::requestedName()
 *  "stream" => Optional. Object. The stream objects to show categories.
 */
function Streams_category_tool($options)
{
    extract($options);
    $user = Users::loggedInUser(true);
    $userId = $user->id;
    // PK of stream to manage categories
    $publisherId = Streams::requestedPublisherId(true);
    $name = Streams::requestedName(true);
    $stream = Streams::get($userId, $publisherId, $name, null, true);
    if (!$stream) {
        throw new Q_Exception_MissingRow(array('table' => 'stream', 'criteria' => "{publisherId: {$publisherId}, name: {$name}}"));
    }
    // activate tool frontend
    $default = array('publisherId' => $stream->publisherId, 'name' => $stream->name);
    $options = array_merge($default, $options);
    Q_Response::setToolOptions($options);
    // get the list of categories
    list($relations, $categories) = Streams::related($userId, $publisherId, $name, true);
    return Q::view("Streams/tool/category.php", compact('relations', 'categories', 'stream'));
}
开发者ID:dmitriz,项目名称:Platform,代码行数:31,代码来源:tool.php

示例3: Streams_get_response_player

/**
 * Provide player content to view the stream content
 * Uses Streams/$type/get.php view and Streams::get to retrieve stream data
 *
 **/
function Streams_get_response_player()
{
    $user = Users::loggedInUser();
    $userId = $user ? $user->id : 0;
    $publisherId = Streams::requestedPublisherId(true);
    $name = Streams::requestedName(true);
    if (substr($name, -1) === '/') {
        throw new Q_Exception("Player cannot show multiple streams", compact('publisherId', 'name'));
    }
    /*
     * Get shall return only streams which user is authorized to see.
     */
    if (!($stream = Streams::get($userId, $publisherId, $name, null, true))) {
        throw new Q_Exception_MissingRow(array('table' => 'stream', 'criteria' => compact('publisherId', 'name')));
    }
    // join the stream
    if ($userId !== 0 && $stream->testWriteLevel('join')) {
        Streams_Stream::join($userId, $stream->publisherId, $stream->name);
    }
    // Let's be nice to poor Windows users
    $type = join(DS, explode('/', $stream->type));
    return Q::view("Streams/{$type}/get.php", compact('stream', 'userId'));
}
开发者ID:dmitriz,项目名称:Platform,代码行数:28,代码来源:player.php


注:本文中的Streams::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。