本文整理汇总了PHP中Space::getRoomIdRoot方法的典型用法代码示例。如果您正苦于以下问题:PHP Space::getRoomIdRoot方法的具体用法?PHP Space::getRoomIdRoot怎么用?PHP Space::getRoomIdRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Space
的用法示例。
在下文中一共展示了Space::getRoomIdRoot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select
/**
* ユーザ・グループ検索機能を提供します
*
* @param string $title 項目名として表示させる文字列
* @param string $pluginModel モデル名
* @param int $roomId ルームID
* @param array $selectUsers 選択済みユーザ配列
* @return string HTML tags
*/
public function select($title = '', $pluginModel = 'GroupsUser', $roomId = null, $selectUsers = array())
{
if (!isset($roomId)) {
$roomId = Space::getRoomIdRoot(Space::COMMUNITY_SPACE_ID);
}
if ($title === '') {
$title = __d('groups', 'User select');
}
return $this->_View->element('Groups.select', array('title' => $title, 'pluginModel' => $pluginModel, 'roomId' => $roomId, 'selectUsers' => $selectUsers));
}
示例2: createRoom
/**
* PrivateSpaceルームの生成
*
* @param array $data デフォルト値
* @return array PrivateSpaceルーム配列
*/
public function createRoom($data = array())
{
$this->loadModels(['Language' => 'M17n.Language', 'Room' => 'Rooms.Room', 'RoomsLanguage' => 'Rooms.RoomsLanguage']);
$parentRoom = $this->Room->find('first', array('recursive' => -1, 'fields' => array('space_id', 'active', 'need_approval', 'page_layout_permitted'), 'conditions' => array('id' => Space::getRoomIdRoot(Space::PRIVATE_SPACE_ID))));
$result = $this->Room->create(Hash::merge(array('id' => null, 'root_id' => Space::getRoomIdRoot(Space::PRIVATE_SPACE_ID), 'parent_id' => Space::getRoomIdRoot(Space::PRIVATE_SPACE_ID), 'default_role_key' => Role::ROOM_ROLE_KEY_ROOM_ADMINISTRATOR, 'default_participation' => false), $parentRoom['Room']));
$languages = $this->Language->getLanguages();
App::uses('L10n', 'I18n');
$L10n = new L10n();
foreach ($languages as $i => $language) {
$catalog = $L10n->catalog($language['Language']['code']);
$roomsLanguage = $this->RoomsLanguage->create(array('id' => null, 'language_id' => $language['Language']['id'], 'room_id' => null, 'name' => __d('private_space', $catalog['language'])));
$result['RoomsLanguage'][$i] = $roomsLanguage['RoomsLanguage'];
}
$result['Page']['parent_id'] = null;
return $result;
}
示例3: before
/**
* Before migration callback
*
* @param string $direction Direction of migration process (up or down)
* @return bool Should process continue
*/
public function before($direction)
{
$pluginName = $this->records['Plugin'][0]['key'];
$this->records['PluginsRoom'] = array(array('room_id' => Space::getRoomIdRoot(Space::WHOLE_SITE_ID, 'Room'), 'plugin_key' => $pluginName), array('room_id' => Space::getRoomIdRoot(Space::PUBLIC_SPACE_ID, 'Room'), 'plugin_key' => $pluginName), array('room_id' => Space::getRoomIdRoot(Space::PRIVATE_SPACE_ID, 'Room'), 'plugin_key' => $pluginName), array('room_id' => Space::getRoomIdRoot(Space::COMMUNITY_SPACE_ID, 'Room'), 'plugin_key' => $pluginName));
return true;
}
示例4: getGroupUsers
/**
* It gets a string attached user information to the group
*
* @param array $userIdArr GroupsUser.user_id
* @param int $roomId Room.id
* @return array Group users array
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*/
public function getGroupUsers($userIdArr, $roomId = false)
{
if ($roomId === false) {
$roomId = Space::getRoomIdRoot(Space::COMMUNITY_SPACE_ID);
}
if (empty($userIdArr)) {
return array();
}
$this->loadModels(['User' => 'Users.User', 'UploadFile' => 'Files.UploadFile', 'RolesRoomsUser' => 'Rooms.RolesRoomsUser']);
$this->User->prepare();
$rolesRoomsUsers = $this->RolesRoomsUser->getRolesRoomsUsers(array('Room.id' => $roomId, 'RolesRoomsUser.user_id' => $userIdArr));
$roomUserIdArr = Hash::extract($rolesRoomsUsers, '{n}.RolesRoomsUser.user_id');
if (empty($roomUserIdArr)) {
return array();
}
$groupUsers = $this->User->find('all', array('recursive' => -1, 'fields' => array('User.*', 'UploadFile.*'), 'conditions' => array($this->User->alias . '.id' => $roomUserIdArr, $this->User->alias . '.is_deleted' => false), 'joins' => array(array('table' => $this->UploadFile->table, 'alias' => $this->UploadFile->alias, 'type' => 'LEFT', 'conditions' => array($this->User->alias . '.id' . ' = ' . $this->UploadFile->alias . '.content_key', $this->UploadFile->alias . '.field_name' => UserAttribute::AVATAR_FIELD)))));
return $groupUsers;
}
示例5: getGroupUser
/**
* グループ取得処理
*
* @param int|array $groupId グループID
* @param int $roomId ルームID
* @return mixed On success Model::$groupUsers
* @throws InternalErrorException
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*/
public function getGroupUser($groupId, $roomId = false)
{
if ($roomId === false) {
$roomId = Space::getRoomIdRoot(Space::COMMUNITY_SPACE_ID);
}
$groups = $this->find('all', array('fields' => array('Group.id', 'Group.name', 'Group.modified'), 'conditions' => array('Group.' . $this->primaryKey => $groupId, 'Group.created_user' => Current::read('User.id')), 'order' => array('Group.created ASC'), 'recursive' => 1));
$userIdArr = Hash::extract($groups, '{n}.GroupsUser.{n}.user_id');
$groupUsers = $this->GroupsUser->getGroupUsers($userIdArr, $roomId);
return $groupUsers;
}