0

Because I am working with legacy tables, I wrote my own Auth_Adapter, named User_Auth_Adapter_DbTable. I have a module user and I want to have this class there.

However, I have no idea where to actually put the file and how to name it so the Zend autoloader can find it. I have googled for more than an hour and did not find a hint, so I put it under /application/modules/user/controller/Auth/Adapter/DbTable.php, because it is used by the controller there. But it is not found.

Lanbo
  • 15,118
  • 16
  • 70
  • 147

2 Answers2

1

Can you share some code from adapter? I think logically it must be in models folder. And the name of this class should follow Zend Framework naming conventions. So if you will put it to models/user/auth/adapter/DbTable.php class should be named as Model_User_Auth_Adapter_DbTable

Dmitriy Sushko
  • 242
  • 1
  • 6
  • If I put it under `application/modules/user/models/Auth/Adapter/DbTable.php`, it works with the class name `User_Model_Auth_Adapter_DbTable`. Thanks! – Lanbo Dec 05 '12 at 15:25
1

I think you need to define service folder. Define folder named service path /application/modules/user/service/ (Recomended Zend-project structure), put there your adapter DbTable.php (class name must bee Application_Modules_User_Service_DbTable). You can call this class:

$adapter = new Application_Modules_User_Service_DbTable();
RDK
  • 4,540
  • 2
  • 20
  • 29