本文整理汇总了PHP中Mapper::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mapper::__construct方法的具体用法?PHP Mapper::__construct怎么用?PHP Mapper::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct($table)
{
$class = get_class($this);
print_r(strToLower($class));
echo "\n";
parent::__construct($table);
}
示例2: VALUES
function __construct()
{
parent::__construct();
$this->selectStmt = self::$db_handler->prepare('SELECT * FROM health_goal WHERE uid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE health_goal SET walk=?, upper_limb=?, lower_limb=? WHERE uid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO health_goal ( walk, upper_limb, lower_limb ) VALUES( ?, ?, ? )');
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->selectStmt = self::$db_handler->prepare('SELECT * FROM setting WHERE uid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE setting SET weight=?, heart_rate=?, slumber=?, walk=?, upper_limb=?, lower_limb=?, send_campaign=?, sync_time=? WHERE uid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO setting ( uid ) VALUES( ? )');
}
示例4: venue
function __construct()
{
parent::__construct();
$this->selectStmt = self::$PDO->prepare("SELECT * FROM venue WHERE id=?");
$this->updateStmt = self::$PDO->prepare("update venue set name=?, id=? where id=?");
$this->insertStmt = self::$PDO->prepare("insert into venue ( name ) \n values( ? )");
}
示例5: __construct
/**
* ActivityMapper constructor.
*/
public function __construct()
{
parent::__construct();
$this->selectAll = self::$db_handler->prepare('SELECT title, content FROM activity');
$this->selectStmt = self::$db_handler->prepare('SELECT * FROM activity WHERE acid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE activity SET title=?, content=?, a_img_url=?, enter_amount=?, end_time=? WHERE acid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO activity ( title, content, post_time, end_time ) VALUES( ?, ?, ?, ? )');
}
示例6: plan
function __construct()
{
parent::__construct();
$this->selectStmt = self::$db_handler->prepare('SELECT * FROM plan WHERE uid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE plan SET breakfast=?, lunch=?, dinner=?, exercise=? WHERE uid=? AND pid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO plan ( pid, uid ) VALUES( ?, ? )');
$this->countStmt = self::$db_handler->prepare('SELECT count(*) ' . self::COUNT . ' FROM plan WHERE uid=?');
}
示例7: __construct
/**
* PostMapper constructor.
*/
public function __construct()
{
parent::__construct();
$this->selectAll = self::$db_handler->prepare('SELECT * FROM post ORDER BY post_id');
$this->selectStmt = self::$db_handler->prepare('SELECT * FROM post WHERE post_id=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE post SET content=? WHERE post_id=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO post (content, post_time) VALUES(?, ? )');
}
示例8: venue
function __construct()
{
parent::__construct();
$this->selectAllStmt = self::$PDO->prepare("SELECT * FROM venue");
$this->selectStmt = self::$PDO->prepare("SELECT * FROM venue WHERE id=?");
$this->updateStmt = self::$PDO->prepare("UPDATE venue SET name=?, id=? WHERE id=?");
$this->insertStmt = self::$PDO->prepare("INSERT into venue ( name ) \n values( ? )");
}
示例9: __construct
/**
* AdviceMapper constructor.
*/
public function __construct()
{
parent::__construct();
$this->selectUser = self::$db_handler->prepare('SELECT a.vote, a.content, q.title, q.qid
FROM advice a JOIN question q ON a.qid = q.qid WHERE ans_user=?');
$this->selectStmt = self::$db_handler->prepare('SELECT a.*, u.uname FROM advice a JOIN user u on a.ans_user = u.uid WHERE qid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE advice SET content=? WHERE qid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO advice ( qid, content, ans_user, time ) VALUES( ?, ?, ?, ? )');
}
示例10: space
function __construct()
{
parent::__construct();
$this->selectAllStmt = self::$PDO->prepare("SELECT * FROM space");
$this->selectStmt = self::$PDO->prepare("SELECT * FROM space WHERE id=?");
$this->updateStmt = self::$PDO->prepare("UPDATE space SET name=?, id=? WHERE id=?");
$this->insertStmt = self::$PDO->prepare("INSERT into space ( name, venue ) \n values( ?, ?)");
$this->findByVenueStmt = self::$PDO->prepare("SELECT * FROM space where venue=?");
}
示例11: usergroups
function __construct(PDO $pdo)
{
parent::__construct($pdo);
$this->selectStmt = $this->PDO->prepare("SELECT * FROM usergroups WHERE id=?");
$this->selectAllStmt = $this->PDO->prepare("SELECT id, title FROM usergroups");
$this->insertStmt = $this->PDO->prepare("INSERT INTO usergroups (title, color) VALUES (?,?)");
$this->updateStmt = $this->PDO->prepare("UPDATE usergroups SET title=?, color=? WHERE id=?");
$this->deleteStmt = $this->PDO->prepare("DELETE FROM usergroups WHERE id=?");
}
示例12: event
function __construct()
{
parent::__construct();
$this->selectAllStmt = self::$PDO->prepare("SELECT * FROM event");
$this->selectBySpaceStmt = self::$PDO->prepare("SELECT * FROM event where space=?");
$this->selectStmt = self::$PDO->prepare("SELECT * FROM event WHERE id=?");
$this->updateStmt = self::$PDO->prepare("UPDATE event SET start=?, duration=?, name=?, id=? WHERE id=?");
$this->insertStmt = self::$PDO->prepare("INSERT into event (start, duration, space, name) \n values( ?, ?, ?, ?)");
}
示例13: __construct
/**
* QuestionMapper constructor.
*/
public function __construct()
{
parent::__construct();
$this->selectUser = self::$db_handler->prepare('SELECT title, content, vote, qid FROM question WHERE uid=?');
$this->selectStmt = self::$db_handler->prepare('SELECT u.uname, q.type, q.to_user, q.title, q.content, q.time, q.vote
FROM question q JOIN user u ON q.uid = u.uid WHERE qid=?');
$this->updateStmt = self::$db_handler->prepare('UPDATE question SET title=?, content=?, vote=? WHERE qid=?');
$this->insertStmt = self::$db_handler->prepare('INSERT INTO question ( uid, type, to_user, title, content, time) VALUES( ?, ?, ?, ?, ?, ? )');
$this->selectAll = self::$db_handler->prepare('SELECT * FROM question');
}
示例14:
function __construct()
{
parent::__construct();
global $url;
$this->id = $url->getIdFirstPart();
if (func_num_args() == 1 && is_object(func_get_arg(0))) {
$object_ = func_get_arg(0);
$this->foreignTable = $object_;
}
}
示例15: COUNT
function __construct($pdo)
{
parent::__construct($pdo);
$this->selectCount = $this->PDO->prepare("SELECT COUNT(id) AS count FROM news");
$this->selectStmt = $this->PDO->prepare("SELECT * FROM news WHERE id=?");
$this->selectCollectionStmt = $this->PDO->prepare("SELECT id, title, date, type FROM news ORDER BY date DESC LIMIT ?, ?");
$this->selectAllStmt = $this->PDO->prepare("SELECT * FROM news");
$this->insertStmt = $this->PDO->prepare("INSERT INTO news (title, text, full_text, date, author, view, type) VALUES (?,?,?,?,?,?,?)");
$this->updateStmt = $this->PDO->prepare("UPDATE news SET title=?, text=?, full_text=?, date=?, author=?, view=?, type=? WHERE id=?");
$this->deleteStmt = $this->PDO->prepare("DELETE FROM news WHERE id=?");
}