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


PHP Context::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($conn, $id)
 {
     $sql_get_assignment = "SELECT * FROM assignments a, contexts c WHERE c.context_id = a.context_id AND c.context_id = " . $id;
     $assignment = mysqli_query($conn, $sql_get_assignment);
     if ($assignment != false && mysqli_num_rows($assignment) != 0) {
         $assignment_pole = mysqli_fetch_array($assignment);
         parent::__construct($conn, $assignment_pole['context_id'], Organisator::getFromDatabaseByID($conn, $assignment_pole['user_id']));
         $this->timeOfPublishing = $assignment_pole['begin'];
         $this->deadline = $assignment_pole['end'];
         $this->text_id_name = $assignment_pole['text_id_name'];
         $this->text_id_desc = $assignment_pole['text_id_description'];
         $sql_get_text = "SELECT * FROM texts WHERE text_id = " . $this->text_id_name;
         $text = mysqli_query($conn, $sql_get_text);
         if ($text != false) {
             $text_pole = mysqli_fetch_array($text);
             $this->name_sk = $text_pole['sk'];
             $this->name_eng = $text_pole['eng'];
         }
         $sql_get_text = "SELECT * FROM texts WHERE text_id = " . $this->text_id_desc;
         $text = mysqli_query($conn, $sql_get_text);
         if ($text != false) {
             $text_pole = mysqli_fetch_array($text);
             $this->text_sk = $text_pole['sk'];
             $this->text_eng = $text_pole['eng'];
         }
         $this->setSolutions($conn);
     } else {
         $this->name_sk = "Nové zadanie";
         $this->name_eng = "New assignment";
     }
 }
开发者ID:Chaos-TIS,项目名称:letna-liga,代码行数:31,代码来源:Assignment.php

示例2: __construct

 public function __construct($conn, $id, $author, $assignment)
 {
     parent::__construct($conn, $id, $author);
     $sql_get_solution = "SELECT * FROM solutions WHERE context_id = " . $id;
     $solution = mysqli_query($conn, $sql_get_solution);
     if ($solution != false) {
         $solution_pole = mysqli_fetch_array($solution);
         $this->text = $solution_pole['text'];
         $this->best = $solution_pole['best'];
         $this->assignment = $assignment;
         $this->id = $id;
         $this->author = $author;
         if (is_null($this->assignment)) {
             $selectAssignmentId = "SELECT assignment_id FROM solutions WHERE context_id = {$this->id}";
             if ($result = mysqli_query($conn, $selectAssignmentId)) {
                 if ($row = mysqli_fetch_array($result)) {
                     $this->assignment = new Assignment($conn, $row['assignment_id']);
                 }
             }
         }
         $sql_get_comment = "SELECT * FROM comments WHERE solution_id = " . $id;
         $comment = mysqli_query($conn, $sql_get_comment);
         if ($comment != false) {
             $comments = array();
             while ($comments_pole = mysqli_fetch_array($comment)) {
                 $comments[] = new Comment($conn, $comments_pole['comment_id'], $this->id, $comments_pole['user_id'], $comments_pole['text'], $comments_pole['points']);
             }
             $this->setComments($comments);
         }
     }
 }
开发者ID:Chaos-TIS,项目名称:letna-liga,代码行数:31,代码来源:Solution.php

示例3: __construct

 public function __construct($href, $text = null)
 {
     parent::__construct("link");
     $this->dict['href'] = (string) $href;
     if (!empty($text)) {
         $this->dict['text'] = (string) $text;
     }
 }
开发者ID:adilbaig,项目名称:pagerduty,代码行数:8,代码来源:LinkContext.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     if (array_key_exists('argv', $_SERVER)) {
         foreach ($_SERVER['argv'] as $key => $value) {
             $this->setParam($key, $this->cleanString($value));
         }
     }
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:9,代码来源:ShellContext.php

示例5: __construct

 public function __construct($src, $href = null, $text = null)
 {
     parent::__construct("image");
     $this->dict['src'] = (string) $src;
     if (!empty($href)) {
         $this->dict['href'] = (string) $href;
     }
     if (!empty($text)) {
         $this->dict['text'] = (string) $text;
     }
 }
开发者ID:adilbaig,项目名称:pagerduty,代码行数:11,代码来源:ImageContext.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     foreach ($_SERVER as $key => $value) {
         $this->setParam($key, $this->cleanArray($value));
     }
     foreach ($_POST as $key => $value) {
         $this->setParam($key, $this->cleanArray($value));
     }
     foreach ($_FILES as $key => $value) {
         $this->setParam($key, $this->cleanArray($value));
     }
     foreach ($_GET as $key => $value) {
         $this->setParam($key, $this->cleanArray($value));
     }
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:16,代码来源:HttpContext.php

示例7: __construct

 /**
  * Creates new instance of context.
  *
  * @param HttpApplication $application
  */
 public function __construct(HttpApplication $application)
 {
     parent::__construct($application);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:9,代码来源:httpcontext.php

示例8:

 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct();
 }
开发者ID:NateWr,项目名称:omp,代码行数:7,代码来源:Press.inc.php


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