Zend findDependentRowset An error occurred
I have three two classess
class Application_Model_Accounts extends Zend_Db_Table_Abstract
{
protected $_name = 'accounts';
protected $_dependentTables = array('Application_Model_Bugs');
}
And
class Application_Model_Bugs extends Zend_Db_Table_Abstract
{
protected $_name = 'bugs';
protected $_dependentTables = array('Application_Model_BugsProducts');
protected $_referenceMap = array(
'Reporter' => array(
'columns' => 'reported_by',
'refTableClass' => 'Application_Model_Accounts',
'refColumns' => 'account_name'
),
'Engineer' => array(
'columns' => 'assigned_to',
'refTableClass' => 'Application_Model_Accounts',
开发者_如何转开发 'refColumns' => 'account_name'
),
'Verifier' => array(
'columns' => array('verified_by'),
'refTableClass' => 'Application_Model_Accounts',
'refColumns' => array('account_name')
)
);
}
in index controll i am trying to run this code.
public function indexAction()
{
$accountsTable = new Application_Model_Accounts();
$accountsRowset = $accountsTable->find(1234);
$user1234 = $accountsRowset->current();
$bugsReportedByUser = $user1234->findDependentRowset('Application_Model_Bugs');
}
and on line
$bugsReportedByUser = $user1234->findDependentRowset('Application_Model_Bugs');
I am getting this error
An error occurred
Application error
I am unable to findout the problem. How to fix this problem. and is there a way to get more developer friendly error in Zend rather then just getting this message "An error occured".
I figure out the solution for this problem. in .Htaccess file enable the development mode by adding this line on top
SetEnv APPLICATION_ENV "development"
This will show the complete error trace. Sorted
full working example of bugs code including db available here http://phphints.wordpress.com/2010/06/25/zend-framework-finddependentrowset-and-findparentrow-demo/
精彩评论