Пример #1
0
 public function save()
 {
     $db = App::db();
     $query = new QueryBuilder($db);
     if ($this->primaryKey) {
         $query->update($this->_tableName, $this->primaryKey, $this->_attributes);
     } else {
         $query->insert($this->_tableName, $this->_attributes);
     }
 }
Пример #2
0
 public function insert()
 {
     $query = new QueryBuilder();
     $query->insert($this->_tableName, $this->_attributes);
 }