<?php

/**
 *--------------------------------------
 * subscribe
 *--------------------------------------
 * @project		: loga
 * @author		: cblee
 * @created		: 2016-08-26
 * @copyright	: (c)2016 AsThis
 *--------------------------------------
 */
defined('PFA_PATH') or exit('Access Denied');

class SubscribeModl extends Modl {
	public function get_subscribeList($where = array(), $order = '', $limit = 10) {
		$_SL = $this->where($where)->order($order)->limit($limit)->select();
		return $_SL;
	}

	public function add_subscribe($data) {
		$result = array('data' => '', 'error' => '');

		unset($data['subscribe_id']);
		$_t_id = $this->insert($data);
		if(false === $_t_id) {
			$result['error'] = L('ADD_FAILED');
			return $result;
		}
		$result['data'] = $_t_id;

		return $result;
	}

	public function edit_subscribe($data) {
		$result = array('data' => '', 'error' => '');

		if(false === $this->update($data)) {
			$result['error'] = L('UPDATE_FAILED');
			return $result;
		}

		return $result;
	}

	public function delete_subscribe($subscribeId) {
		$result = array('data' => '', 'error' => '');

		if(false === $this->delete($subscribeId)) {
			$result['error'] = L('DELETE_FAILED');
			return $result;
		}

		return $result;
	}

}

?>