0

I'm currently developing a website in Zend Framework wich uses Zend_Auth. The current design of the database is the following:

  • users - id / email
  • users_props - id - user_id - prop_name - prop_value

However, the current Zend_Auth_Adapter_DbTable uses only one table, as where I have to tables and need to join them.

How on earth can I do this? As far as i'm concerned, there are three options:

  1. I somehow create a (mysql) view
  2. I change the design so the users table contains both username/password
  3. I rewrite the Zend_Auth_Adapter_DbTable to a Custom_Auth_Adapter_DbTabe

Can anyone point me out what the best practise is?

Thanks in advance :)

4

1 回答 1

4

Zend_Auth_Adapter正确的做法是为您的特定数据库模式创建一个自定义的身份验证。

它实际上很简单,接口中只有一个方法可以实现。您也可以Zend_Auth_Db_Adapter根据需要扩展和覆盖方法。可能只有构建执行并返回查询结果。但老实说,如果是我,我只会从头开始实施接口。这样IMO容易多了:-)

于 2012-04-12T01:52:24.643 回答