本文整理汇总了PHP中S::isArray方法的典型用法代码示例。如果您正苦于以下问题:PHP S::isArray方法的具体用法?PHP S::isArray怎么用?PHP S::isArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S
的用法示例。
在下文中一共展示了S::isArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserappsCacheByUids
function getUserappsCacheByUids($uids)
{
is_numeric($uids) && ($uids = array(intval($uids)));
if (!S::isArray($uids)) {
return false;
}
$uids = array_unique($uids);
$result = $_tmpResult = $keys = $_tmpUids = array();
foreach ($uids as $uid) {
$keys[$this->_getUserappsCacheDataKey($uid)] = $uid;
}
if ($userApps = $this->_cacheService->get(array_keys($keys))) {
$_unique = $this->getUnique();
foreach ($keys as $key => $uid) {
$_key = $_unique . $key;
if (isset($userApps[$_key]) && is_array($userApps[$_key])) {
$_tmpUids[] = $uid;
$result[$uid] = $userApps[$_key];
}
}
}
$uids = array_diff($uids, $_tmpUids);
if ($uids) {
$_tmpResult = $this->_getUserappsCacheDataByUidsNoCache($uids);
foreach ($uids as $uid) {
$this->_cacheService->set($this->_getUserappsCacheDataKey($uid), isset($_tmpResult[$uid]) ? $_tmpResult[$uid] : array());
}
}
return (array) $result + (array) $_tmpResult;
}
示例2: getTucoolForums
/**
* »ñÈ¡¿ªÆôͼ¿áµÄ°æ¿é
* @return array
*/
function getTucoolForums()
{
$tucoolForums = array();
$fids = $this->getAllForumIds();
$forumsDao = $this->getForumsDao();
$forumSets = $forumsDao->getForumSetsByFids($fids);
if ($forumSets) {
foreach ($forumSets as $k => $v) {
$forumset = array();
$v = @unserialize($v['forumset']);
if (!$v['iftucool']) {
continue;
}
$forumset['tucoolpic'] = intval($v['tucoolpic']);
S::isArray($forumset) && ($tucoolForums[$k] = $forumset);
}
}
if ($tucoolForums) {
$forums = $forumsDao->getFormusByFids(array_keys($tucoolForums), 'fid,name');
foreach ($forums as $k => $v) {
$tucoolForums[$k] = array_merge($tucoolForums[$k], $v);
}
}
return $tucoolForums;
}
示例3: insert
/**
* 添加
*
* @param array $fieldsData 数据数组,以数据库字段为key
* @return int 新增id
*/
function insert($fieldsData)
{
if (S::isArray($fieldsData)) {
pwQuery::insert($this->_tableName, $fieldsData);
return $this->_db->insert_id();
}
}
示例4: _checkIfDelete
/**
* ÅжϸÃÌû×ÓÊÇ·ñÒѱ»É¾³ý
* @param unknown_type $thread
*/
function _checkIfDelete($thread)
{
if (!S::isArray($thread)) {
return true;
}
return $thread['fid'] == 0 && $thread['ifcheck'] == 1;
}
示例5: saveModesData
function saveModesData($uid, $data, $conf)
{
$array = array();
foreach ($data as $key => $value) {
$this->_cacheService->set($this->_getKeyForUserMode($uid, $key), array('num' => S::isArray($conf[$key]) ? S::int($conf[$key]['num']) : $conf[$key], 'value' => $value), S::isArray($conf[$key]) && isset($conf[$key]['expire']) ? S::int($conf[$key]['expire']) : 608400);
}
}
示例6: deleteByTids
function deleteByTids($tids)
{
if (!S::isArray($tids)) {
return false;
}
return pwQuery::delete($this->_tableName, "{$this->_primaryKey} IN (:{$this->_primaryKey})", array($tids));
}
示例7: addCareers
/**
* 添加工作经历
* @param array $data
* @return bool
*/
function addCareers($data)
{
if (!S::isArray($data)) {
return false;
}
return $this->_db->update("INSERT INTO {$this->_tableName} (uid,companyid,starttime) VALUES " . S::sqlMulti($data) . "");
}
示例8: insert
/**
* 添加
*
* @param array $fieldsData 数据数组,以数据库字段为key
* @return int 新增id
*/
function insert($fieldsData)
{
if (S::isArray($fieldsData)) {
$typeDb = $this->_getTypeDB();
return $typeDb->insert($fieldsData);
}
}
示例9: getThreadsByThreadIds
/**
* 获取一组帖子的基本信息
*
* @param array $threadIds 帖子id数组
* @return array
*/
function getThreadsByThreadIds($threadIds)
{
if (!S::isArray($threadIds)) {
return array();
}
if (!$this->checkMemcache()) {
return $this->_getThreadsNoCache($threadIds);
}
$result = $resultInCache = $resultInDb = $keys = $_cachedThreadIds = array();
foreach ($threadIds as $threadId) {
$keys[] = $this->_getKeyForThread($threadId);
}
if ($threads = $this->_cacheService->get($keys)) {
foreach ($threads as $value) {
$_cachedThreadIds[] = $value['tid'];
$resultInCache[$value['tid']] = $value;
}
}
$_noCachedThreadIds = array_diff($threadIds, $_cachedThreadIds);
if ($_noCachedThreadIds && ($resultInDb = $this->_getThreadsNoCache($_noCachedThreadIds))) {
foreach ($resultInDb as $value) {
$this->_cacheService->set($this->_getKeyForThread($value['tid']), $value);
}
}
$tmpResult = (array) $resultInCache + (array) $resultInDb;
foreach ($threadIds as $threadId) {
$result[$threadId] = isset($tmpResult[$threadId]) ? $tmpResult[$threadId] : false;
}
return $result;
}
示例10: deleteByTids
/**
* 根据tids批量删除数据
*
* @param int $tid
* @return array
*/
function deleteByTids($tids)
{
if (!S::isArray($tids)) {
return false;
}
return $this->_db->update("DELETE FROM " . $this->_tableName . " WHERE tid IN (" . S::sqlImplode($tids) . ")");
}
示例11: getAtFeedByUserNames
function getAtFeedByUserNames($usernames)
{
$data = array();
if (!S::isArray($usernames)) {
return $data;
}
$userService = L::loadClass('userservice', 'user');
$users = $userService->getByUserNames($usernames);
if (S::isArray($users)) {
$userIds = array();
foreach ($users as $k => $v) {
$userIds[$v['uid']] = $v['username'];
}
$ouserdataDb = $this->_getOuserdataDB();
$atFeeds = (array) $ouserdataDb->findUserAtPrivacy(array_keys($userIds));
if (S::isArray($atFeeds)) {
foreach ($atFeeds as $v) {
$data[$v['uid']] = array('at_isfeed' => $v['at_isfeed'], 'username' => $userIds[$v['uid']]);
}
}
foreach ($userIds as $uid => $username) {
$data[$uid] or $data[$uid] = array('at_isfeed' => 0, 'username' => $username);
}
}
return $data;
}
示例12: getCardData
/**
* 组装小名片数据
*
* @param int $uid 用户ID
* @param int $winduid 当前用户id
* @param bool $username 用户名
* @return array
*/
function getCardData($uid, $winduid, $username)
{
extract(pwCache::getData(R_P . "data/bbscache/level.php", false));
if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') {
return array('username' => '游客', 'memtitle' => $ltitle[2]);
}
$userService = L::loadClass('UserService', 'user');
if ($uid) {
$userInfo = $userService->get($uid, true, true);
} elseif ($username) {
$userInfo = $userService->getByUserName($username, true, true);
}
if (!S::isArray($userInfo)) {
return array();
}
require_once R_P . 'require/showimg.php';
list($faceimage) = showfacedesign($userInfo['icon'], 1, 's');
$userInfo['groupid'] == '-1' && ($userInfo['groupid'] = $userInfo['memberid']);
!array_key_exists($userInfo['groupid'], (array) $lpic) && ($userInfo['groupid'] = 8);
$online = checkOnline($userInfo['thisvisit']);
$onlineRead = $online ? getOnlineViewing($userInfo['uid'], $userInfo['username']) : array();
$user = array('mine' => $userInfo['uid'] == $winduid || !$winduid ? 0 : 1, 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'icon' => $faceimage, 'memtitle' => $ltitle[$userInfo['groupid']], 'genderClass' => $userInfo['gender'], 'viewTid' => isset($onlineRead['tid']) && $onlineRead['tid'] ? $onlineRead['tid'] : '', 'viewFid' => isset($onlineRead['fid']) && $onlineRead['fid'] ? $onlineRead['fid'] : '', 'online' => $online ? 1 : 0);
$user['medals'] = getMedalsByUid($userInfo['uid']);
// 勋章
$memberTagsService = L::loadClass('memberTagsService', 'user');
$user['memberTags'] = $memberTagsService->makeClassTags($memberTagsService->getMemberTagsByUid($userInfo['uid']));
//标签
$attentionSerivce = L::loadClass('Attention', 'friend');
/* @var $attentionSerivce PW_Attention */
$user['attention'] = $attentionSerivce->isFollow($winduid, $userInfo['uid']) ? 1 : 0;
//关注
return $user;
}
示例13: _cookData
/**
*
* 数据处理
* @param int $fid
* @return
*/
function _cookData($data)
{
if (!S::isArray($data)) {
return array();
}
require_once R_P . 'require/showimg.php';
foreach ($data as $k => $v) {
$tem = array();
$tem['url'] = USER_URL . $v['uid'];
$tem['title'] = $v['username'];
$tem['value'] = $v['uid'];
if (array_key_exists('icon', $v)) {
$pic = showfacedesign($v['icon'], true, 's');
if (is_array($pic)) {
$tem['image'] = $pic[0];
} else {
$tem['image'] = '';
}
} else {
$tem['image'] = '';
}
$tem['addition'] = $v;
$userInfo[] = $tem;
}
return $userInfo;
}
示例14: insert
/**
* 添加
*
* @param array $fieldsData
* @return int
*/
function insert($fieldsData)
{
if (!S::isArray($fieldsData)) {
return false;
}
return $this->_insert($fieldsData);
}
示例15: insert
function insert($fieldsData)
{
if (!S::isArray($fieldsData)) {
return false;
}
$this->_db->update("INSERT INTO " . $this->_tableName . " (uid,name,type,size,attachurl,uploadtime,descrip,ifthumb) VALUES " . S::sqlMulti($fieldsData));
return true;
}