コード例 #1
0
 public function add($userId)
 {
     $db = cl_mysql();
     $db->insert('study', ['title' => $this->title, 'description' => $this->description]);
     $this->setId($db->getInsertId());
     $db->insert('study_to_user', ['studyId' => $this->getId(), 'userId' => $userId]);
 }
コード例 #2
0
 public static function exists($id, $studyId)
 {
     $db = cl_mysql();
     return $db->exists('model', ['AND' => ['studyId' => $studyId, 'id' => $id]]);
 }
コード例 #3
0
 public static function delete($id)
 {
     $db = cl_mysql();
     $db->query("DELETE FROM `query` WHERE `id` = {$id}");
 }
コード例 #4
0
 private function update()
 {
     $db = cl_mysql();
     $db->update('user', ['email' => $this->email, 'password' => $this->password, 'name' => $this->name, 'surname' => $this->surname, 'organisation' => $this->organisation], ['id' => $this->id]);
 }
コード例 #5
0
ファイル: POI2Model.php プロジェクト: stefda/pocketsail
 /**
  * @throws ActiveRecordException
  */
 public function saveToTemp()
 {
     $db = cl_mysql();
     $db->insert('poi_temp', ['id' => $this->id, 'url' => $this->url, 'name' => $this->name, 'attrs' => json_encode($this->attrs)]);
 }