本文整理汇总了PHP中Model::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::all方法的具体用法?PHP Model::all怎么用?PHP Model::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preload
/**
* Preload all metadata from storage.
*
* @return void
*/
public function preload()
{
$all = Model::all();
foreach ($all as $data) {
$this->cache[$data[Model::KEY_NAME]] = $data[Model::VALUE_NAME];
}
}
示例2: all
public function all()
{
if ($instance = parent::all()) {
$data = $this->relationSelect($instance);
return $data;
} else {
return $instance;
}
}
示例3: all
/**
* Get all projects
* @param boolean $full Project with all data (buttons, tags...)
* @return array
*/
public function all($full = false)
{
$projects = parent::all();
if ($full) {
$this->addTags($projects, false);
$this->addButtons($projects);
}
return $projects;
}
示例4: selectModel
function selectModel(Model $model)
{
$foreignKey = $this->foreignKey;
if (isset($model->{$foreignKey})) {
$select = $this->augmentSelect($model->all());
$select = $select->equal(Model::tableFor($this->localClass) . '.' . $this->foreignKey, $model->{$foreignKey});
} else {
$select = $this->augmentSelect($model->select());
}
if (isset($select[0])) {
return $select[0];
} else {
return null;
}
}
示例5: Get_New_Three
public function Get_New_Three()
{
$sql = "select \r\n\t\t\t\t\t\t\t\t\tc.username as c_username,\r\n\t\t\t\t\t\t\t\t\tc.content,\r\n\t\t\t\t\t\t\t\t\tc.date,\r\n\t\t\t\t\t\t\t\t\tc.state,\r\n\t\t\t\t\t\t\t\t\tc.manner,\r\n\t\t\t\t\t\t\t\t\tc.id,\r\n\t\t\t\t\t\t\t\t\tc.cid,\r\n\t\t\t\t\t\t\t\t\tc.sustain,\r\n\t\t\t\t\t\t\t\t\tc.oppose,\r\n\t\t\t\t\t\t\t\t\tu.username as u_username,\r\n\t\t\t\t\t\t\t\t\tu.face as face\r\n\t\t\t\t\t\t\tfrom \r\n\t\t\t\t\t\t\t\t\tcomment as c\r\n\t\t\t\t\t\tleft join\r\n\t\t\t\t\t\t\t\t\tuser as u \r\n\t\t\t\t\t\t\ton\r\n\t\t\t\t\t\t\t\t\tu.username=c.username\r\n\t\t\t\t\t\t\twhere \r\n\t\t\t\t\t\t\t\t\tc.cid='{$this->cid}' \r\n\t\t\t\t\t\t\torder by \r\n\t\t\t\t\t\t\t\t\tdate \r\n\t\t\t\t\t\t\tDESC \r\n\t\t\t\t\t\t\tlimit 0,3";
return parent::all($sql);
}
示例6: getFiveTag
public function getFiveTag()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\ttagname,count \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_tag \n\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\tcount DESC \n\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t\t\t0,5";
return parent::all($_sql);
}
示例7: getAllLimitLevel
public function getAllLimitLevel()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\tlevel_name,\n\t\t\t\t\t\t\t\t\t\tlevel_info,\n\t\t\t\t\t\t\t\t\t\tpremission \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\tcms_level\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\tid DESC\n\t\t\t\t\t\t\t\t{$this->limit}";
return parent::all($_sql);
}
示例8: getLaterUser
public function getLaterUser()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\tuser,\n\t\t\t\t\t\t\t\t\t\t\tface \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_user \n\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\t\t\ttime DESC \n\t\t\t\t\t\t\t\tLIMIT \n\t\t\t\t\t\t\t\t\t\t\t0,6";
return parent::all($_sql);
}
示例9: getAllNav
public function getAllNav()
{
$_sql = "SELECT mid,module_name FROM tg_module ORDER BY mid ASC";
return parent::all($_sql);
}
示例10: Get_All_Childid
public function Get_All_Childid()
{
$sql = "select id from nav where parid <> 0";
return parent::all($sql);
}
示例11: getAllRotatain
public function getAllRotatain()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\t\t\t\t\tlink,\n\t\t\t\t\t\t\t\t\t\t\t\tlink full,\n\t\t\t\t\t\t\t\t\t\t\t\tstate \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\tcms_rotatain\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\t\t\tstate DESC,date DESC\n\t\t\t\t\t\t\t\t\t{$this->limit}";
return parent::all($_sql);
}
示例12: delMenu
public function delMenu()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\tDISTINCT l.pid\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\ttg_menu r,\n\t\t\t\t\t\t\t\t\t\ttg_menu l\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\tl.mid = '{$this->mid}'\n\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t \t\tl.pid = r.cid";
return parent::all($_sql);
}
示例13: getAllComment
public function getAllComment()
{
$_sql = "SELECT \t\n\t\t\t\t\t\t\t\t\t\t\tc.id,\n\t\t\t\t\t\t\t\t\t\t\tc.cid,\n\t\t\t\t\t\t\t\t\t\t\tc.user,\n\t\t\t\t\t\t\t\t\t\t\tc.manner,\n\t\t\t\t\t\t\t\t\t\t\tc.content,\n\t\t\t\t\t\t\t\t\t\t\tc.date,\n\t\t\t\t\t\t\t\t\t\t\tc.sustain,\n\t\t\t\t\t\t\t\t\t\t\tc.oppose,\n\t\t\t\t\t\t\t\t\t\t\tu.face \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_comment c\n\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\t\t\t\tcms_user u\n\t\t\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\t\t\t\tc.user=u.user\n\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\tc.state=1\n\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t\t\tc.cid='{$this->cid}'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\t\tc.date DESC\n\t\t\t\t\t\t\t\t\t\t{$this->limit}";
return parent::all($_sql);
}
示例14: getAllLimitPremission
public function getAllLimitPremission()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\tinfo \n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\tcms_premission\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\t\tid DESC\n\t\t\t\t\t\t\t\t{$this->limit}";
return parent::all($_sql);
}
示例15: getSecMenu
public function getSecMenu()
{
$_sql = "SELECT \n\t\t\t\t\t\t\t\t\t\tl.menu_name as fir_nemu,\n\t\t\t\t\t\t\t\t\t\tr.mid,\n\t\t\t\t\t\t\t\t\t\tr.menu_name as sec_nemu,\n\t\t\t\t\t\t\t\t\t\tr.pid\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\ttg_menu r,\n\t\t\t\t\t\t\t\t\t\ttg_menu l\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\tl.mid = {$this->mid}\n\t\t\t\t\t\t\t\tAND \n \t\t\t\t\t\t\t\t l.pid = r.cid\n\t\t\t\t\t\t\t\t{$this->reg}\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\t\t\tl.menu_name desc";
return parent::all($_sql);
}