本文整理匯總了PHP中ArrayHelper::bindArrayToObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayHelper::bindArrayToObject方法的具體用法?PHP ArrayHelper::bindArrayToObject怎麽用?PHP ArrayHelper::bindArrayToObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArrayHelper
的用法示例。
在下文中一共展示了ArrayHelper::bindArrayToObject方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: UserSession
function UserSession()
{
$ci =& get_instance();
$ci->load->library('session');
$ci->load->helper('object');
$ci->load->helper('array');
$session = $ci->session->userdata(MEMBER_SESSION_KEY);
if (false === empty($session)) {
ArrayHelper::bindArrayToObject($session, $this);
} else {
$this->id = 0;
$this->roles[] = 'Guest';
$this->_refreshSession();
}
}
示例2: __construct
function __construct()
{
$ci =& get_instance();
$ci->load->library('session');
$ci->load->helper('object');
$ci->load->helper('array');
$ci->load->table('gamesession');
$session = $ci->session->userdata(GAME_SESSION_KEY);
if (false === empty($session)) {
ArrayHelper::bindArrayToObject($session, $this);
} else {
$this->id = 0;
$this->completedquestions = array();
$this->_refreshSession();
}
$this->_loadDBSession();
}
示例3: bind
/**
* Binds the table delegate to an associative array or object with keys or public attributes
* that match the table delegates public attributes
*
* @access public
* @param mixed $source The source of the binding
*/
function bind($source)
{
if (true === is_array($source)) {
ArrayHelper::bindArrayToObject($source, $this, true);
} else {
if (true === is_object($source)) {
ObjectHelper::shallowCopy($source, $this, true, true);
}
}
}