$this->getDBTable()->fetchAll() gives Application error

For programming and general questions on Zend Framework

$this->getDBTable()->fetchAll() gives Application error

Postby ashinaidu on Thu Jul 01, 2010 7:14 am

Hello All,

I am new to zend Framework. I was trying very simple example i.e. fetching records from DB. I was referring to "http://framework.zend.com/manual/en/learning.quickstart.create-model.html". I followed as per the documentation and when i run the application it showed me message "An error occurred
Application error".

When i investigated it i found when it execute $this->getDBTable()->fetchAll() line of fetchAll() method (of mapper class), its throwing the above example. When i Printed $this->getDBTable() it was having all DB connection information but it was not containing fetchAll method because of which its giving error.

I would also like to ask one more question. In the above pasted link it showed that in the application->model->guestbook file we need to put

class Application_Model_Guestbook
{
protected $_comment;
protected $_created;
protected $_email;
protected $_id;

public function __set($name, $value);
public function __get($name);

public function setComment($text);
public function getComment();

public function setEmail($email);
public function getEmail();

public function setCreated($ts);
public function getCreated();

public function setId($id);
public function getId();
}

class Application_Model_GuestbookMapper
{
public function save(Application_Model_Guestbook $guestbook);
public function find($id);
public function fetchAll();
}


if you notice it also has mapper class code in model guestbook file. I have not added mapper class in the model guestbook class




Please let me know where i missed and what could be the problem.




Regards
Ashinaidu
ashinaidu
 
Posts: 9
Joined: Thu Jul 01, 2010 7:04 am

Re: $this->getDBTable()->fetchAll() gives Application error

Postby reshmamohan123 on Mon Jul 02, 2012 12:19 pm

I too have the same problem...i am new to zend framework...somebody help me...............
reshmamohan123
 
Posts: 1
Joined: Mon Jul 02, 2012 12:18 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 4 guests