ZfcUser中的用户状态到底是什么? [英] What exactly is the user state in ZfcUser?

查看:102
本文介绍了ZfcUser中的用户状态到底是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我, ZfcUser 中的用户状态"是做什么的,并且为什么我们可能需要它?该用户状态是什么意思(我认为这不是它的作用)?

解决方案

基本上,它是指示用户状态的标志.有时,您需要能够禁用用户,或者以其他方式影响用户的状态",而无需实际将其从表中删除.如果您使用这样的系统,那么这就是state列的目的.

举一个简单的例子,考虑一个论坛上暂时被禁止的用户,您不想删除他们,因此将其状态设置为禁止",只允许那些未被禁止的用户登录.

当然,还有更多状态可以指示其他内容,例如尚未通过确认电子邮件进行验证的帐户,或者需要管理员批准的帐户,这在您的用户生态系统中确实有意义.可能是您根本不需要任何东西,在这种情况下,您可以放心地忽略它.

Can anybody tell me, what the "user state" in the ZfcUser is doing exactly and why we may need it? What does this user state mean (I assume it's not the role meant by it)?

解决方案

Basically it's a flag to indicate the state of a user. Sometimes you need to be able to disable users, or otherwise affect their 'state' without actually deleting them from the table. That's what the state column is intended for if you use such a system.

As a simple example, think of a temporarily banned user on a forum, you don't want to delete them, so you set their state to banned, and only allow users who aren't banned to log in.

Of course there could be more states to indicate other things, such as an account that hasn't yet been validated by way of confirmation email, or requires administrator approval, whatever makes sense in your user ecosystem really. It could be you don't need any at all, in which case you can safely ignore it.

这篇关于ZfcUser中的用户状态到底是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆