/**
* 函數名稱
* 函數描述(有些會含HTML代碼)
*
* @access 變數可存取的權限 (Example: Public or Private)
* @api 爲第三方來源的變數
* @author 函數建立者名稱 (Example: @author Barry <riceooks[at]gmail.com>)
* @category 函數的分類別名,可能某些工具會利用這個來分類你的方法,使好幾個方法歸為某一類,方便做辨識使用
* @copyright 函數的版權宣告 (Example: @copyright 隨手寫有限公司 www.barryblogs.com)
* @deprecated 代表不建議使用的函數,未來可能會移除這個方法使用到的某個變數,或整個方法都被刪除
* @example 代表這個函數使用方式可以參考某個資料,可以使用檔案位置或網址 (Example: @example https://www.barryblogs.com/)
* @filesource 這個函數所需的來源
* @global 函數內有使用的全域變數註解 (Example: @global Number $user_id)
* @ignore 代表這個函數或區域可以被忽略,通常會加上說明
* @internal 代表這個函數或區域可能只給予內部使用
* @license 此函數可能是含有某個版權或許可 (Example: @license http://opensource.org/licenses/gpl-license.php GNU Public License)
* @link 可能與某個網站有關係 (Example: @link https://www.barryblogs.com/)
* @method 函數有使用的方法 (Example: @method Array @this->getCategories() or @method String getUserName())
* @package 利用這個註解來達到細部分層結構 (Example: @package PSR\Documentation\API or @package PSR\Documentation\Doc)
* @param 函數要帶入的參數 (Example: @param String|Number $username)
* @property 如果這是一個類別的函數,在類別建構時通常會指定初始化參數,而這個函數可能會使用到某些初始化後的參數,稱之為屬性 (Example: @property Resource|Boolean $mysql_connect)
* @return 函數最後的回傳值或形態 (Example: @return Array|Object|Boolean)
* @see 函數參照或關聯的方法 (Example: @see Class User or @see <a href="https://www.barryblogs.com/">BarryBlogs</a>)
* @since 函數內某個使用的變數由哪個版本變動 (Example: @since v1.3376a $user_nickname )
* @source 這個比較特別,在函數中可以標示從 m 至 n 行 是做什麼事情 (Example: @source 14 21 Get user data)
* @static 靜態變數的註解 (Example: @static String $lang = 'zh_TW')
* @subpackage 利用這個註解來達到細部分層子結構,通常會同時使用 @package,可以參考上面的@package (Example: @package PSR
* @subpackage Documentation\API)
* @throws 例外處理的註解,有多種例外處理的方式,每種方式都不同 (Example: @throws InvalidArgumentException if the provided argument is not of type 'array'
* @throws Exception other...)
* @todo 計劃要進行的項目描述,一般應該會使用文字描述
* @uses 代表某個元素可能與其它結構有利用關係 (Example: @uses MyClass::$items to retrieve the count from)
* @var 變數(物件成員變數)的形態或描述 (Example: @var Boolean)
* @version 函數的版本 (Example: v1.3258c)
*/

/**
* 使用者類別
* 使用者相關的方法
*/
class User{
/**
* 使用者編號
*
* @access public
* @var Number
*
* @version 1.0
* @author Barry
*/
var $user_id; /**
* 建構子
*
* @param Number $user_id 使用者編號
* @property Number $user_id 使用者編號
*
* @version 1.0
* @author Barry
*/
function __construct($user_id){
$this->user_id = intval($user_id);
} /**
* 取得使用者編號
*
* @return Number|Boolean
*
* @version 1.0
* @author Barry
*/
function getUserID(){
if( !empty($this->user_id) ){
return $this->user_id;
}
return false;
} /**
* 取得分類資料
*
* @ignore Number $parent_id 上層分類編號
* @global Class $model 模型變數
* @see Class Model getCategories() 取得分類資料模型
* @return Array|Boolean
*
* @version 1.0
* @author Barry
*/
function getCategories($parent_id=0){
global $model; $rows = $model->getCategories($parent_id);
if( !empty($rows) ){
return $rows;
} return false;
}
}

 

最新文章

  1. SQL Server获取下一个编码字符串的实现方案分割和进位
  2. selenium 基本的键盘方法
  3. VS2010运行正常的控制台程序在VS2015中出现乱码的解决方法
  4. C语言基础学习
  5. CentOS搭建VSFTP
  6. java中获取系统属性以及环境变量
  7. 前端开发者使用JS框架的三个等级
  8. Openjudge-计算概论(A)-奇数单增序列
  9. RabbitMQ入门与使用篇
  10. Win10系列:C#应用控件进阶7
  11. JDBCUtils——原生
  12. java中数组实现的错误
  13. spring-cloud-starter-gateway
  14. Linux16.04 LTS 环境下将cmake的项目转换成eclipse可导入可调试的工程项目
  15. 【原创】纯干货,Spring-data-jpa详解,全方位介绍。(转)
  16. git内部原理
  17. linux系统用户下的crontab任务不执行问题处理
  18. xshell连接kali
  19. django数据模型中关于on_delete的使用
  20. BZOJ1101 &amp; 洛谷3455:[POI2007]ZAP——题解

热门文章

  1. JS 对浏览器相关的操作
  2. 给定一个矩阵 A, 返回 A 的转置矩阵。
  3. java WebSocket HTML页面
  4. IIFE 立即执行函数表达式-模块化
  5. php类知识---命名空间
  6. Acwing-198-反素数(约数, 数学)
  7. react-native 各种插件
  8. Subarray Sorting (线段树)
  9. 交换机配置—— 结合以太通道的VLAN配置
  10. python socket.io 坑。