本文整理汇总了PHP中ArrayUtils::mergeArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtils::mergeArray方法的具体用法?PHP ArrayUtils::mergeArray怎么用?PHP ArrayUtils::mergeArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayUtils
的用法示例。
在下文中一共展示了ArrayUtils::mergeArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLists
public static function getLists($stateIds)
{
$cityLists = '';
foreach ($stateIds as $stateid) {
$cityLists = ArrayUtils::mergeArray($cityLists, self::getList($stateid));
}
return $cityLists;
}
示例2: getUser
public static function getUser($userId)
{
$userModel = UserCredentials::model()->findByPk($userId);
$result = false;
if ($userModel) {
$userProfile = UserProfiles::model()->find("user_id=:userId", array(":userId" => $userId));
if ($userProfile) {
$result = ArrayUtils::mergeArray($userModel->getAttributes(), $userProfile->getAttributes());
} else {
$result = $userModel->getAttributes();
}
}
return $result;
}
示例3: getOwner
/**
* This method returns the owner of a particular project.
* Returns model if successfully found.
* Returns the false if not found.
*
* @param string $projectId
* @return model || false
*/
public static function getOwner($projectId)
{
$criteria = new CDbCriteria();
$criteria->select = 'user_id';
$criteria->condition = 'id=:projectId';
$criteria->params = array(':projectId' => $projectId);
$project = Projects::model()->find($criteria);
if ($userId) {
$criteria = new CDbCriteria();
$criteria->condition = 'user_id=:userId';
$criteria->params = array(':userId' => $project->user_id);
$userprofile = UserProfiles::model()->find($criteria);
$usercredentials = UserApi::getUserDetails($project->user_id);
$userdetails = ArrayUtils::mergeArray($usercredentials->getAttributes(), $userprofile->getAttributes());
return $userdetails;
} else {
return false;
}
}