示例#1
0
 private static function insert(Tag $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO tags (nameBG,name) VALUES (:nameBG, :name);";
     $result = $db->prepare($query);
     $result->execute([':nameBG' => $model->getNameBG(), ':name' => $model->getName()]);
     $model->setId($db->lastId());
 }