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


PHP UserManager::findById方法代码示例

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


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

示例1: getUser

 public function getUser()
 {
     if (!$this->user) {
         $manager = new UserManager($this->database);
         $this->user = $manager->findById($this->id_user);
     }
     return $this->user;
 }
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:8,代码来源:Cart.class.php

示例2: getAuthor

 public function getAuthor()
 {
     if (!$this->author) {
         $manager = new UserManager($this->database);
         $this->author = $manager->findById($this->id_author);
     }
     return $this->author;
 }
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:8,代码来源:CommentManager.class.php

示例3: getAuthor

 public function getAuthor()
 {
     if (!$this->user) {
         $userManager = new UserManager($this->db);
         $this->user = $userManager->findById($this->id_author);
     }
     return $this->user;
 }
开发者ID:Hollux,项目名称:Fennec,代码行数:8,代码来源:SousRubrique.class.php

示例4: getLast

 public function getLast()
 {
     $manager = new UserManager($this->db);
     $query = "SELECT * FROM article ORDER BY date DESC LIMIT 20";
     $res = mysqli_query($this->db, $query);
     $listArticle = array();
     while ($art = mysqli_fetch_object($res, 'Article')) {
         $user = $manager->findById($art->getId_user());
         $art->setUser($user);
         $listArticle[] = $art;
     }
     return $listArticle;
 }
开发者ID:Hollux,项目名称:Fennec,代码行数:13,代码来源:ArticleManager.class.php

示例5: sortByName

 public function sortByName()
 {
     $sbn = new UserManager($this->db);
     $query = "SELECT * FROM rubrique ORDER BY name";
     $res = mysqli_query($this->db, $query);
     $listRubrique = array();
     while ($rubrique = mysqli_fetch_object($res, 'Rubrique')) {
         $user = $sbn->findById($rubrique->getIdAuthor());
         // var_dump($user);
         $rubrique->setIdAuthor($user);
         $listRubrique[] = $rubrique;
     }
     return $listRubrique;
 }
开发者ID:Hollux,项目名称:Fennec,代码行数:14,代码来源:RubriqueManager.class.php

示例6: findSharesForElement

/**
 * Created by PhpStorm.
 * User: Crocell
 * Date: 12/06/14
 * Time: 22:23
 */
function findSharesForElement($idElement, $idUser)
{
    $idElement = new MongoId($idElement);
    $idUser = new MongoId($idUser);
    //vérification de l'existence de l'élément
    $elementManager = new ElementManager();
    $element = $elementManager->findById($idElement);
    if (array_key_exists('error', $element)) {
        return $element;
    }
    if ($element['idOwner'] != $idUser) {
        return array('error' => 'You need to be the owner of the file to get sharing information on it.');
    }
    $rightManager = new RightManager();
    $rightCriteria = array('state' => (int) 1, 'idElement' => $idElement);
    $rights = $rightManager->find($rightCriteria);
    $userManager = new UserManager();
    $refRightManager = new RefRightManager();
    $userFieldsToReturn = array('email' => TRUE);
    $refRightFieldsToReturn = array('code' => TRUE);
    $user = $refRight = NULL;
    foreach ($rights as $key => $right) {
        $user = $userManager->findById($right['idUser'], $userFieldsToReturn);
        $refRight = $refRightManager->findById($right['idRefRight'], $refRightFieldsToReturn);
        if (array_key_exists('error', $user) || array_key_exists('error', $refRight)) {
            unset($rights[$key]);
        }
        unset($rights[$key]['idUser']);
        unset($rights[$key]['idRefRight']);
        $rights[$key]['user'] = $user;
        $rights[$key]['refRight'] = $refRight;
    }
    if (empty($rights)) {
        return array('error' => 'No righ found for the element');
    } else {
        return $rights;
    }
}
开发者ID:at69,项目名称:beta-eggstar,代码行数:44,代码来源:ShareManager.php

示例7: UserManager

<?php

if (isset($_GET['id'])) {
    $manager = new UserManager($db);
    $user = $manager->findById($_GET['id']);
    if (is_string($user)) {
        require 'views/home.phtml';
    } else {
        require 'views/edit_profil.phtml';
    }
} else {
    require 'views/home.phtml';
}
开发者ID:Hollux,项目名称:Fennec,代码行数:13,代码来源:edit_profil.php

示例8: TopicManager

<?php

$topicManager = new TopicManager($db);
$topic = $topicManager->findById($_GET['id']);
$userManager = new UserManager($db);
$userTopic = $userManager->findById($topic->getIdAuthor());
try {
    $test = $topicManager->addVue($topic->getId());
    $link = $userManager->deletLink($_SESSION['id'], $topic->getId());
} catch (Exception $e) {
    $errors = $e->getMessage();
    echo $errors;
}
require "views/forum/topic.phtml";
开发者ID:Hollux,项目名称:mvcBase2,代码行数:14,代码来源:topic.php

示例9: CategoryManager

<?php

$categoryManager = new CategoryManager($db);
$category = $categoryManager->findById($_GET['id']);
$userManager = new UserManager($db);
$userCategory = $userManager->findById($category->idAuthor);
require 'views/forum/category.phtml';
?>
	
开发者ID:Hollux,项目名称:mvcBase2,代码行数:8,代码来源:category.php

示例10: RubriqueManager

<?php

if (isset($_GET['id'])) {
    $manager = new RubriqueManager($db);
    $rubrique = $manager->findById($_GET['id']);
    $manager2 = new UserManager($db);
    $author = $manager2->findById($rubrique->getIdAuthor());
    /*$author = $rubrique->getAuthor();*/
    require 'views/rubrique.phtml';
}
开发者ID:Hollux,项目名称:Fennec,代码行数:10,代码来源:rubrique.php

示例11: intval

<?php

if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
    $userManager = new UserManager($db);
    $user = $userManager->findById($id);
    require 'views/profil.phtml';
} else {
    require 'views/login.phtml';
}
开发者ID:Hollux,项目名称:mvcBase2,代码行数:10,代码来源:profil.php

示例12: PostManager

<?php

$postManager = new PostManager($db);
$posts = $postManager->getList($_GET['id']);
$userManager = new UserManager($db);
$i = 0;
$c = count($posts);
while ($i < $c) {
    $post = $posts[$i];
    $postUser = $postManager->getListUser($post->getIdAuthor());
    $NpostUser = count($postUser);
    $userPost = $userManager->findById($post->getIdAuthor());
    require 'views/forum/posts.phtml';
    $i++;
}
开发者ID:Hollux,项目名称:mvcBase2,代码行数:15,代码来源:posts.php

示例13: TopicManager

<?php

$topicManager = new TopicManager($db);
$topics = $topicManager->getList($_GET['id']);
$userManager = new UserManager($db);
$postManager = new PostManager($db);
$i = 0;
$c = count($topics);
while ($i < $c) {
    $topic = $topics[$i];
    $link = $userManager->findLink($_SESSION['id'], $topic->getId());
    $userTopic = $userManager->findById($topic->getIdAuthor());
    $lastPost = $postManager->getLastByTopic($topic->getId());
    if ($lastPost == TRUE) {
        $userLastPost = $userManager->findById($lastPost->getIdAuthor());
        $posts = $postManager->getList($topic->getId());
        $Nrep = count($posts) - 1;
    }
    require 'views/forum/topics.phtml';
    $i++;
}
开发者ID:Hollux,项目名称:mvcBase2,代码行数:21,代码来源:topics.php

示例14: SCategoryManager

<?php

$sCategoryManager = new SCategoryManager($db);
$sCategory = $sCategoryManager->findById($_GET['id']);
$userManager = new UserManager($db);
$userSCategory = $userManager->findById($sCategory->getIdAuthor());
require 'views/forum/sCategory.phtml';
?>
	
开发者ID:Hollux,项目名称:mvcBase2,代码行数:8,代码来源:sCategory.php

示例15: getByIdSousRubrique

 public function getByIdSousRubrique($idSousRubrique)
 {
     $manager = new UserManager($this->db);
     $query = "SELECT * FROM topic WHERE id_sous_rubrique='" . $idSousRubrique . "' ORDER BY date DESC LIMIT 20";
     $res = mysqli_query($this->db, $query);
     $listTopic = array();
     while ($topic = mysqli_fetch_object($res, 'Topic', array($this->db))) {
         $user = $manager->findById($topic->getIdAuthor());
         $topic->setAuthor($user);
         $listTopic[] = $topic;
     }
     return $listTopic;
 }
开发者ID:Hollux,项目名称:Fennec,代码行数:13,代码来源:TopicManager.class.php


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