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


PHP Subject::getSubject方法代码示例

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


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

示例1: match

 public function match(Subject $subject)
 {
     $em = $this->getEntityManager();
     $query = $em->createQuery('Select IDENTITY(s.user)
         From SubwayBuddyUserBundle:Subject s
         WHERE s.subject = ?1
         AND s.user != ?2');
     $query->setParameter(1, $subject->getSubject());
     $query->setParameter(2, $subject->getUser());
     return $query->getResult();
 }
开发者ID:ChristianHiroz,项目名称:SubwayBuddy,代码行数:11,代码来源:SubjectRepository.php

示例2: Subject

$bool_str2 = $isBlocked2 ? "true" : "false";
printf("User is blocked: %s\n", $bool_str2);
unset($user);
unset($user2);
////////////////////////////
//Subject UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING Subject UNIT TESTS\n");
printf("/////////////////////////////////\n");
//construct subject
$subject = new Subject();
//add subject
$subject->addSubject("Math");
//get subject
$subject_string = $subject->getSubject();
printf("Got Subject: %s\n", $subject_string);
//get AZSubjectArray
$orderedArray = $subject->getAZSubjects();
printf("Ordered Subjects: \n");
foreach ($orderedArray as $subject_val) {
    printf("%s\n", $subject_val);
}
////////////////////////////
//Classes UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING Classes UNIT TESTS\n");
printf("/////////////////////////////////\n");
//construct empty class
$class = new Classes();
开发者ID:anokbakn,项目名称:StudyHall,代码行数:31,代码来源:index.php

示例3: getSubjectById

 static function getSubjectById($subject_id)
 {
     //clear the result
     $subject = '';
     $connection = Database::getConnection();
     $query = 'SELECT subject FROM subject WHERE id=' . $subject_id;
     //echo  $query;
     //Run the query
     $result_obj = $connection->query($query);
     try {
         //I COULD USE A FOR AND IT WOULD BE BETTER
         //BUT IT DOESN'T WORK AND I HAVE NO TIME TO
         //FIND THE PROBLEM :)
         //SHOULD BE ONLY ONE RESULT
         $i = 0;
         while ($result = $result_obj->fetch_array(MYSQLI_ASSOC)) {
             $subject = new Subject($result);
             $i++;
         }
         //pass back the result
         return $subject->getSubject();
     } catch (Exception $e) {
         $_SESSION['message'] = $e->getMessage();
         //Not properly good for safety
     }
 }
开发者ID:pinair,项目名称:ClassCrowd,代码行数:26,代码来源:subject.php


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