<?php
class SelectQuery {
private $dbConn;
private $select;
public function __construct($dbConn) {
$this->dbConn = $dbConn;
$this->select = $dbConn->select();
}
public function addField($col, $value, $op = '=', $join = 'and') {};
public function getLazyEntities() {
return new LazyQuery($this, 'findAll');
};
public function getLazyEntity() {
return new LazyQuery($this, 'find');
};
public function findAll() {
return $this->dbConn->fetchAll($this->select);
}
public function find() {
return $this->dbConn->fetchRow($this->select);
}
}
class LazyQuery {
private $query;
private $method;
public function __construct($query, $method) {
$this->query = $query;
$this->method = $method;
}
public function execute() {
$query = $this->query;
$method = $this->method;
if ($query && method_exists($query, $method)) {
return $query->$method();
}
throw new Exception("Query failed to call method.");
}
}
分享到:
相关推荐
Windows延缓写入失败 for txt!
社保延缓缴纳申请书.pdf
windows延缓写入dd失败解决dd方法
时间延缓长度收缩.ppt
Windows延缓写入失败.docx
windows延缓写入失败怎么办.docx
window延缓写入失败怎么办.doc
每周素颜一天延缓皮肤早衰
合理用药延缓抗生素末代来临.ppt
延缓提交审计报告情况说明.docx
windows延缓写入失败怎么办?.docx
病理学延缓并发症十大攻略.pdf
2PL时间延缓和长度收缩效应.pptx
Windows延缓写入失败的原因和解决办法
白藜芦醇延缓细胞衰老的机制,周叶方,彭浩,白藜芦醇是一种从天然植物如葡萄皮、坚果或花生中提取出来的多酚衍生物,它能通过影响细胞周期的调控、衰老相关蛋白的表达、影响
主要介绍了PHP定时任务延缓执行的实现,很简单,但很实用,需要的朋友可以参考下面的示例
补益肺肾法延缓衰老的作用机制研究,殷涛,陈刚,目的:探讨补益肺肾法延缓衰老的作用机制。方法:将40只大鼠,随机分为正常组、模型组、补益肺肾组和维生素E组。随后对模型组,补�
网络游戏-发送延缓管理信息的无线局域网络.zip
如果选择茎尖作为治疗对象,则多效唑是延缓叶片生长的理想抑制剂。 所有七个处理的幼苗的鲜重均显着低于对照。 为了延缓香蕉幼苗鲜重的增长,最好的选择是氯丙草胺(200 mg / L)。 100 ml多效唑(200 mg / L)处理...
房贷断供可能会延缓房地产销售的回升步伐.pdf