Commit 20b009a0 by biao

1

parent ff0da488
1. 小程序开发者账号
1. 小程序开发者账号
......@@ -3,3 +3,4 @@
3.腾讯lbs账号
4.阿里云oss key
5.小程序绑定对应公众号
6.
\ No newline at end of file
<?php
/**
* 用户角色
* $Id$
* @author huangliang
* @package cn.compass.entity.definition
*/
class CourseParentCategory
{
public $id;
public $title;
function __construct($record) {
$this->id = $record["id"];
$this->title = $record["title"];
}
/**
*
* @return array CourseParentCategory
*/
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);
$result = array();
foreach ($data as $row) {
$tmp2 = new CourseParentCategory($row);
array_push($result, $tmp2);
}
}
return $result;
}
/**
*
* @return CourseParentCategory
*/
public static function getById($id) {
$list = CourseParentCategory::getList();
foreach ($list as $tmp) {
if ($tmp->id == $id) {
return $tmp;
}
}
return null;
}
/**
*
* @return CourseParentCategory
*/
public static function getTitleById($id) {
$list = CourseParentCategory::getList();
foreach ($list as $tmp) {
if ($tmp->id == $id) {
return $tmp->title;
}
}
return null;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment