Yii Framework v1.1.10 绫诲弬鑰

CBaseUserIdentity

system.web.auth
缁ф壙 abstract class CBaseUserIdentity » CComponent
瀹炵幇 IUserIdentity
瀛愮被 CUserIdentity
婧愯嚜 1.0
鐗堟湰 $Id: CBaseUserIdentity.php 3515 2011-12-28 12:29:24Z mdomba $
婧愮爜 framework/web/auth/CBaseUserIdentity.php
CBaseUserIdentity鏄IUserIdentity鍩虹被鐨勫疄鐜般

CBaseUserIdentity瀹炵幇浜嗛偅浜涢渶瑕佽鎸佷箙鍖栫殑璇嗗埆 淇℃伅鐨勭粨鏋勩傚畠鍚屾椂鎻愪緵琛ㄧず 楠岃瘉閿欒鐨勬柟娉曘

娲剧敓绫诲簲璇ュ疄鐜IUserIdentity::authenticateIUserIdentity::getId锛屽洜涓鸿繖涓や釜鏄IUserIdentity 鎺ュ彛鎵瀹氫箟鐨勩

鍏叡灞炴

闅愯棌缁ф壙灞炴

灞炴绫诲瀷鎻忚堪瀹氫箟鍦
errorCode integer 楠岃瘉閿欒浠g爜銆傚鏋滄槸鏈夐敊璇彂鐢燂紝閭d箞閿欒浠g爜涓嶄細涓0銆 榛樿鏄100锛屾剰鍛崇潃鏈煡鐨勮韩浠姐傝皟鐢authenticate鍙互鏀瑰彉杩欎釜鍊笺 CBaseUserIdentity
errorMessage string 楠岃瘉閿欒淇℃伅銆傞粯璁や负绌恒 CBaseUserIdentity
id mixed 杩斿洖鍞竴鐨勮韩浣撴爣璇嗐 CBaseUserIdentity
isAuthenticated 楠岃瘉鏄惁鎴愬姛銆 杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 CBaseUserIdentity
name string 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 CBaseUserIdentity
persistentStates array 杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 CBaseUserIdentity

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
__call() 濡傛灉绫讳腑娌℃湁璋冪殑鏂规硶鍚嶏紝鍒欒皟鐢ㄨ繖涓柟娉曘 CComponent
__get() 杩斿洖涓涓睘鎬у笺佷竴涓簨浠跺鐞嗙▼搴忓垪琛ㄦ垨涓涓涓哄悕绉般 CComponent
__isset() 妫鏌ヤ竴涓睘鎬ф槸鍚︿负null銆 CComponent
__set() 璁剧疆涓涓粍浠剁殑灞炴у笺 CComponent
__unset() 璁剧疆涓涓粍浠剁殑灞炴т负null銆 CComponent
asa() 杩斿洖杩欎釜鍚嶅瓧鐨勮涓哄璞° CComponent
attachBehavior() 闄勫姞涓涓涓哄埌缁勪欢銆 CComponent
attachBehaviors() 闄勫姞涓涓涓哄垪琛ㄥ埌缁勪欢銆 CComponent
attachEventHandler() 涓轰簨浠堕檮鍔犱竴涓簨浠跺鐞嗙▼搴忋 CComponent
authenticate() 楠岃瘉鐢ㄦ埛韬唤銆 IUserIdentity
canGetProperty() 纭畾灞炴ф槸鍚﹀彲璇汇 CComponent
canSetProperty() 纭畾灞炴ф槸鍚﹀彲鍐欍 CComponent
clearState() 绉婚櫎鎸囧畾鐨勭姸鎬併 CBaseUserIdentity
detachBehavior() 浠庣粍浠朵腑鍒嗙涓涓涓恒 CComponent
detachBehaviors() 浠庣粍浠朵腑鍒嗙鎵鏈夎涓恒 CComponent
detachEventHandler() 鍒嗙涓涓瓨鍦ㄧ殑浜嬩欢澶勭悊绋嬪簭銆 CComponent
disableBehavior() 绂佺敤涓涓檮鍔犺涓恒 CComponent
disableBehaviors() 绂佺敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
enableBehavior() 鍚敤涓涓檮鍔犺涓恒 CComponent
enableBehaviors() 鍚敤缁勪欢闄勫姞鐨勬墍鏈夎涓恒 CComponent
evaluateExpression() 璁$畻涓涓狿HP琛ㄨ揪寮忥紝鎴栨牴鎹粍浠朵笂涓嬫枃鎵ц鍥炶皟銆 CComponent
getEventHandlers() 杩斿洖涓涓簨浠剁殑闄勫姞澶勭悊绋嬪簭鍒楄〃銆 CComponent
getId() 杩斿洖鍞竴鐨勮韩浣撴爣璇嗐 CBaseUserIdentity
getIsAuthenticated() 杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 CBaseUserIdentity
getName() 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 CBaseUserIdentity
getPersistentStates() 杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 CBaseUserIdentity
getState() 鑾峰彇鎸囧畾鍚嶅瓧鐨勬寔涔呭寲鐘舵併 CBaseUserIdentity
hasEvent() 纭畾涓涓簨浠舵槸鍚﹀畾涔夈 CComponent
hasEventHandler() 妫鏌ヤ簨浠舵槸鍚︽湁闄勫姞鐨勫鐞嗙▼搴忋 CComponent
hasProperty() 纭畾灞炴ф槸鍚﹁瀹氫箟銆 CComponent
raiseEvent() 鍙戣捣涓涓簨浠躲 CComponent
setPersistentStates() 璁剧疆鎸佷箙鍖栫姸鎬佹暟缁勩 CBaseUserIdentity
setState() 璁剧疆鎸囧畾鐘舵佺殑鍊笺 CBaseUserIdentity

灞炴ц缁

errorCode 灞炴
public integer $errorCode;

楠岃瘉閿欒浠g爜銆傚鏋滄槸鏈夐敊璇彂鐢燂紝閭d箞閿欒浠g爜涓嶄細涓0銆 榛樿鏄100锛屾剰鍛崇潃鏈煡鐨勮韩浠姐傝皟鐢authenticate鍙互鏀瑰彉杩欎釜鍊笺

errorMessage 灞炴
public string $errorMessage;

楠岃瘉閿欒淇℃伅銆傞粯璁や负绌恒

id 灞炴 鍙
public mixed getId()

杩斿洖鍞竴鐨勮韩浣撴爣璇嗐

isAuthenticated 灞炴 鍙
public 楠岃瘉鏄惁鎴愬姛銆 getIsAuthenticated()

杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆

name 灞炴 鍙
public string getName()

杩斿洖韬唤鐨勬樉绀哄悕瀛椼

persistentStates 灞炴
public array getPersistentStates()
public void setPersistentStates(array $states)

杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆

鏂规硶璇︾粏

clearState() 鏂规硶
public void clearState(string $name)
$name string 鐘舵佸悕瀛
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#128 (鏄剧ず)
public function clearState($name)
{
    unset(
$this->_state[$name]);
}

绉婚櫎鎸囧畾鐨勭姸鎬併

getId() 鏂规硶
public mixed getId()
{return} mixed 杩斿洖鍞竴鐨勮韩浣撴爣璇嗭紙濡傦紝涓婚敭鍊硷級銆 榛樿瀹炵幇鐨勬槸锛岃繑鍥name
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#58 (鏄剧ず)
public function getId()
{
    return 
$this->getName();
}

杩斿洖鍞竴鐨勮韩浣撴爣璇嗐

getIsAuthenticated() 鏂规硶
public 楠岃瘉鏄惁鎴愬姛銆 getIsAuthenticated()
{return} 楠岃瘉鏄惁鎴愬姛銆
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#98 (鏄剧ず)
public function getIsAuthenticated()
{
    return 
$this->errorCode==self::ERROR_NONE;
}

杩斿洖鍊艰鏄庤韩浠芥槸鍚﹂氳繃楠岃瘉銆 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆

getName() 鏂规硶
public string getName()
{return} string 杩斿洖韬唤鐨勬樉绀哄悕瀛椼 榛樿瀹炵幇鐨勬槸锛岃繑鍥炵┖瀛楃涓层
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#68 (鏄剧ず)
public function getName()
{
    return 
'';
}

杩斿洖韬唤鐨勬樉绀哄悕瀛椼

getPersistentStates() 鏂规硶
public array getPersistentStates()
{return} array 闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#78 (鏄剧ず)
public function getPersistentStates()
{
    return 
$this->_state;
}

杩斿洖闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併 姝ゆ柟娉曚负鎺ュ彛IUserIdentity寮哄埗瑕佹眰瀹炵幇銆

getState() 鏂规硶
public mixed getState(string $name, mixed $defaultValue=NULL)
$name string 鐘舵佸悕瀛
$defaultValue mixed 濡傛灉涓嶅瓨鍦ㄧ殑榛樿杩斿洖鍊
{return} mixed 鎸囧畾鍚嶅瓧鐨勭姸鎬佸笺
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#109 (鏄剧ず)
public function getState($name,$defaultValue=null)
{
    return isset(
$this->_state[$name])?$this->_state[$name]:$defaultValue;
}

鑾峰彇鎸囧畾鍚嶅瓧鐨勬寔涔呭寲鐘舵併

setPersistentStates() 鏂规硶
public void setPersistentStates(array $states)
$states array 闇瑕佹寔涔呭寲鐨勮韩浠界姸鎬併
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#88 (鏄剧ず)
public function setPersistentStates($states)
{
    
$this->_state $states;
}

璁剧疆鎸佷箙鍖栫姸鎬佹暟缁勩

setState() 鏂规硶
public void setState(string $name, mixed $value)
$name string 鐘舵佸悕瀛
$value mixed 鎸囧畾鍚嶅瓧鐨勭姸鎬佸
婧愮爜锛 framework/web/auth/CBaseUserIdentity.php#119 (鏄剧ず)
public function setState($name,$value)
{
    
$this->_state[$name]=$value;
}

璁剧疆鎸囧畾鐘舵佺殑鍊笺

Copyright © 2008-2011 by Yii Software LLC
All Rights Reserved.