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


PHP DataManager::getUserById方法代码示例

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


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

示例1: getAuthenticatedUser

 public static function getAuthenticatedUser()
 {
     return self::isAuthenticated() ? DataManager::getUserById($_SESSION['user']) : null;
 }
开发者ID:amigobv,项目名称:chat,代码行数:4,代码来源:AuthenticationManager.php

示例2: isset

    DataManager::getChannelByName($_SESSION['channel']);
    ?>
">
                <div class = "panel-heading">
                    <h4 class="channelName"><?php 
    echo isset($_SESSION['channel']) && $_SESSION['channel'] ? $_SESSION['channel'] : "Default";
    ?>
</h4></div>
                <div class = "panel-body panel-height">
                    <ul class = "media-list messageContainer">
                        <?php 
    $channel = DataManager::getChannelByName($_SESSION['channel']);
    $messages = DataManager::getPostsByChannel($channel->getID());
    //Util::stable_uasort($messages, 'Util::MessageCmp');
    foreach ($messages as $message) {
        $author = DataManager::getUserById($message->getAuthor());
        $status = DataManager::getPostStatus($message->getId());
        if ($status != Status::PRIOR && $status != Status::DELETED) {
            Viewtility::viewMessage($message, $status);
        }
        /*
        if ($currUser) {
            if ($status == Status::UNREAD && $author->getUsername() != $currUser->getUsername()) {
                DataManager::changePostStatus($message->getID(), Status::READ);
                $message->setRead();
            }
        }
        */
    }
    ?>
开发者ID:amigobv,项目名称:chat,代码行数:30,代码来源:welcome.php

示例3: foreach

        ?>
                <div class="row">
                    <h4 class="page-header" style="margin: 10px 20px; padding-bottom: 0;">
                        <a href="?view=channel&id=<?php 
        echo $channel->getId();
        ?>
">
                            <?php 
        echo $channel->getName();
        ?>
                        </a>
                    </h4>

                    <?php 
        foreach ($posts as $post) {
            $user = DataManager::getUserById($post->getUserId());
            ?>
                        <div class='col-lg-8'>
                            <div class='panel panel-primary'>
                                <div class='panel-heading'>
                                    <h3 class='panel-title'>
                                        <?php 
            echo $post->getTitle();
            ?>
                                        <span class='align-right'>
                                        <?php 
            echo $user->getFirstName() . " " . $user->getLastName() . ", " . $post->getDatetime();
            ?>
                                    </span>
                                    </h3>
                                </div>
开发者ID:TSchmiedlechner,项目名称:SlackLight,代码行数:31,代码来源:overview.php

示例4: jsonSerialize

 /**
  * Specify data which should be serialized to JSON
  * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
  * @return mixed data which can be serialized by <b>json_encode</b>,
  * which is a value of any type other than a resource.
  */
 function jsonSerialize()
 {
     $user = DataManager::getUserById($this->userId);
     return ['id' => $this->getId(), 'title' => $this->title, 'text' => $this->text, 'user' => $user, 'threadId' => $this->channelId, "datetime" => $this->datetime, 'isFavorite' => intval($this->favorite), 'isUnread' => intval($this->unread)];
 }
开发者ID:TSchmiedlechner,项目名称:SlackLight,代码行数:11,代码来源:Post.php

示例5: viewMessage

    public static function viewMessage($message, $status)
    {
        ?>
            <li class = 'media'>
                <div class = 'media-body <?php 
        echo $status == Status::UNREAD ? 'mark' : ' ';
        ?>
 '>
                    <p class='lead'><?php 
        echo $message->getTitle();
        ?>
<p>
                        <?php 
        echo $message->getContent();
        ?>
                        <br>
                    <div>
                        <small class = 'text-muted'>
                            <a class = 'pull-left' href = '#'>
                                            <span class = 'glyphicon glyphicon-user'>
                                                <?php 
        $author = DataManager::getUserById($message->getAuthor());
        echo $author->getUsername();
        ?>
                                            </span>
                            </a>

                            <?php 
        $id = $message->getID();
        switch ($status) {
            case Status::UNREAD:
                ?>
                                    <a href = '#' id = "<?php 
                echo $id;
                ?>
" class = 'glyphicon glyphicon-star-empty custom-star' onclick='setPrior(<?php 
                echo $id;
                ?>
)'></a>
                                    <a href = '#' id = "<?php 
                echo $id;
                ?>
" class = 'glyphicon glyphicon-remove customRemoveActive' onclick='removeMessage(<?php 
                echo $id;
                ?>
)'></a>
                                    <?php 
                break;
            case Status::READ:
                ?>
                                    <a href = '#' id = '<?php 
                echo $id;
                ?>
' class = 'glyphicon glyphicon-star-empty custom-star' onclick='setPrior(<?php 
                echo $id;
                ?>
)'></a>
                                    <a href = '#' id = "<?php 
                echo $id;
                ?>
" class = 'glyphicon glyphicon-remove customRemoveActive' onclick='removeMessage(<?php 
                echo $id;
                ?>
)'></a>
                                    <?php 
                break;
            case Status::ANSWERED:
                ?>
                                    <a href = '#' id = '<?php 
                echo $id;
                ?>
' class = 'glyphicon glyphicon-star-empty custom-star' onclick='setPrior(<?php 
                echo $id;
                ?>
)'></a>
                                    <?php 
                break;
            case Status::PRIOR:
                ?>
                                    <a href = '#' id = '<?php 
                echo $id;
                ?>
' class = 'glyphicon glyphicon-star custom-star' onclick='resetPrior(<?php 
                echo $id;
                ?>
)'></a>
                                    <?php 
                break;
            default:
            case Status::DELETED:
                break;
        }
        ?>
                        </small>
                    </div>
                </div>
                <hr>
            </li>
    <?php 
    }
开发者ID:amigobv,项目名称:chat,代码行数:100,代码来源:Viewtility.php


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