PHP实现链式操作的核心思想

(编辑:jimmy 日期: 2024/9/30 浏览:2)

PHP 链式操作的实现

 复制代码 代码如下:
 $db->where()->limit()->order();
 

在 Common 下创建 Database.php。

链式操作最核心的地方在于:在方法的最后 return $this;

Database.php:

<"htmlcode">
<"//img.jbzj.com/file_images/article/201506/2015623105241099.png" alt="" />