在每个函数实现业务逻辑后,使用return $this;
<?php
namespace IMooc;

class Database
{
function where($where)
{
return $this;
}

function order($order)
{
return $this;
}

function limit($limit)
{
return $this;
}
}

$db = new IMooc\Database();
$db->where("id=1")->where("name=2")->order("id desc")->limit(10);
//$db->where("id=1");
//$db->where("name=2");
//$db->order("id desc");
//$db->limit(10);




相关文章:

  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-12-28
  • 2022-01-19
猜你喜欢
  • 2022-02-15
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-10-23
相关资源
相似解决方案