Files
study/Swoft_BackEndApi/app/Model/Dao/BmobDao.php
2024-09-27 01:06:04 +08:00

26 lines
476 B
PHP

<?php
namespace App\Model\Dao;
use BmobObject;
class BmobDao {
protected $bmobObj;
/**
* 向数据库添加一条数据
* @param array $params
* @return mixed
*/
protected function addNewObject (array $params) {
$this->newBmob($params['tableName']);
return $this->bmobObj->create($params['data']);
}
protected function newBmob($tableName = ""): void {
$this->bmobObj = new BmobObject($tableName);
}
}