Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZF] - zend_db_table
zeta758
post
Post #1





Grupa: Zarejestrowani
Postów: 74
Pomógł: 0
Dołączył: 18.06.2006

Ostrzeżenie: (0%)
-----


W index.php bootstrapie mam:
  1. <?php
  2. Zend_Db_Table::setDefaultAdapter($db);
  3. ?>


w indexController w akcji indexAction() mam:
  1. <?php
  2. Zend_Loader::loadClass('Category',FRONT_MODEL);
  3.  
  4. $departmentCategory = new Category();
  5. $departmentCategory->getDepartmentCategory();
  6. ?>


a z kolei w modelu Category.php mam:

  1. <?php
  2. class Category extends Zend_Db_Table_Abstract 
  3. {
  4. protected $_name = 'category';
  5. protected $_primary = 'id';
  6.  
  7. ...............
  8.  
  9. public function getDepartmentCategory()
  10. {
  11. $where = array('parent = ?' => '1');
  12. return $this->fetchAll($where);
  13. }
  14. ............
  15. ?>


i błąd:
  1. Fatal error: Call to a member function select() on a non-object in D:\edulabs\shoppe\library\Zend\Db\Table\Abstract.php on line 1074


Co robie zle ?

trzeba bylo z klasy Category.php wywalic
  1. <?php
  2. public function __construct()
  3. {
  4.  
  5. }
  6. ?>


pozdrawiam
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 11:45