<?php

defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );

class Achievements_user_model extends MY_Model {
  
  public function __construct()
  {
    $this->table = 'achievements_user';
  }

  public function achievement( $user_id )
  {
    $data['where']['user_id'] = $user_id;
    $data['orderby_column'] = 'user_id';

    return $this->get_one($data);
  }

  public function add_data( $to_add )
  {
    return $this->add( $to_add, 'achievements_user' );
  }

  public function update_data( $user_id, $to_update )
  {
    $data['where']['user_id'] = $user_id;
    $data['data'] = $to_update;

    return $this->update( $data );
  }

}