<?php
/**
 * 系统流水记录表
 * $Id: PointActionType.inc 81583 2015-04-02 08:59:46Z wanggb $
 * @author wanggb
 * @access public
 * @package jp.fishow.entity.definition
 */


class PointActionType {

	var $id;

	/**
	 * 名称
	 */
	var $title;

	/**
	 * 零售商端名称
	 */
	var $title_for_retailer;

	function __construct($record) {
		$this->id = $record["id"];
		$this->title = $record["title"];

	}


	/**
	 * 列表返回
	 * @return array PointActionType
	 */
	public static function getList() {
		static $result;

		if ((!is_array($result)) || (count($result) < 1)) {

			$data = array();
			$tmp = array("id"=>1, "title"=>"用户注册");
			array_push($data, $tmp);
			$tmp = array("id"=>2, "title"=>"签到奖励");
			array_push($data, $tmp);
			$tmp = array("id"=>3, "title"=>"邀请好友奖励");
			array_push($data, $tmp);
			$tmp = array("id"=>4, "title"=>"购买课程奖励");
			array_push($data, $tmp);
			$tmp = array("id"=>5, "title"=>"兑换代金券");
			array_push($data, $tmp);
			$tmp = array("id"=>6, "title"=>"兑换商品");
			array_push($data, $tmp);
			$tmp = array("id"=>7, "title"=>"系统赠送[抽奖等]");
			array_push($data, $tmp);			

			$result = array();
			foreach ($data as $row) {
				$tmp2 = new PointActionType($row);
				array_push($result, $tmp2);
			}
		}
		return $result;
	}

	/**
	 * 通过定义名取名称
	 */
	public static function getTitleById($id) {
		$list = PointActionType::getList();
		foreach ($list as $tmp) {
			if ($tmp->id == $id) {
				return $tmp->title;
			}
		}
		return null;
	}
}


?>