當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。