first commit
This commit is contained in:
26
Swoft_BackEndApi/app/Model/Dao/BmobDao.php
Normal file
26
Swoft_BackEndApi/app/Model/Dao/BmobDao.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user