本文整理汇总了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";
}
}
示例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);
}
}
}
示例3: __construct
public function __construct($href, $text = null)
{
parent::__construct("link");
$this->dict['href'] = (string) $href;
if (!empty($text)) {
$this->dict['text'] = (string) $text;
}
}
示例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));
}
}
}
示例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;
}
}
示例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));
}
}
示例7: __construct
/**
* Creates new instance of context.
*
* @param HttpApplication $application
*/
public function __construct(HttpApplication $application)
{
parent::__construct($application);
}
示例8:
/**
* Constructor
*/
function __construct()
{
parent::__construct();
}