Db::table('**')->where('***','***')->order('***')->find('**');
想这种应该怎么实现
public function table()
{
    return new self();
}

示例:

<?php
class Db
{
    public $table;
    
    public $a;
    
    public $b;

    public static function table($table)
    {
        $db = new static;
        $db->table = $table;
        return $db;
    }
    
    public function where($a, $b)
    {
        $this->a = $a;
        $this->b = $b;
        return $this;
    }
}

Db::table('abc')->where('a', 'b');

来源:https://segmentfault.com/q/1010000019451768/

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2021-11-16
  • 2021-10-31
  • 2022-01-12
  • 2021-10-16
  • 2021-05-03
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2021-06-05
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案