/** * @param GroupContainer $groupContainer * @return string */ function UpdateGroup(GroupContainer $groupContainer) { $this->_cleanBuffer(); $this->_currentContainer = $groupContainer; $groupId = $groupContainer->GetValue('GroupId', 'int'); $this->_setStringValueToBuffer('GroupStrId', 'group_str_id'); $this->_setStringValueToBuffer('GroupName', 'group_nm'); if (count($this->_buffer) > 0) { $sql = 'UPDATE %sawm_addr_groups SET %s WHERE id_group = %d'; $sql = sprintf($sql, $this->_dbPrefix, implode(', ', $this->_buffer), $groupId); return $sql; } return new ContactCommandCreatorException(self::ERR_MSG_SQL_UPDATE_GROUP, self::ERR_NO_SQL_UPDATE_GROUP); }
protected function _GetGroupByStrId($IdUser, $groupStrId) { $dbResult = $this->_query($this->_commandCreator->GetGroupByStrId($IdUser, $groupStrId)); $groupContainer = null; if (is_array($dbResult) && isset($dbResult[0])) { $groupContainer = new GroupContainer(); $groupContainer->MassSetValue($dbResult[0]); } return $groupContainer; }
} } else { $grp = $fac->getGroup($usr->getUid(), $groupid); if ($grp != null) { echo application_getMessage($grp); } else { echo application_getMessage(msg_failed); } } } //msg_gettree if ($action == msg_gettree) { $lst1 = null; global $gl_parsetags; $gl_parsetags = false; $gc = new GroupContainer("id", "name"); $opt = ""; $withvirtual = true; if (isset($options)) { $opt = $options; if ($opt == "withfriends") { $withvirtual = false; } } if ($opt == "onlyfriends") { $lst1 = $fac->getAllFriendGroups($usr->getUid()); } else { if ($parentgroupid == -1) { $lst1 = $fac->getRootGroups($usr->getUid(), $withvirtual); } }