0

奇怪的问题我有以下模型,如果我从控制器调用 getSystemgoals() 一切都很好,并返回结果数组。每当我调用 getSystemactivities() 时,似乎返回的是整个模型 zend 对象(请参阅任务结束时的输出)?

class Account_Model_Systemgoals extends Zend_Db_Table_Abstracter
{
protected $_options = 'goaloptions';
protected $_systemgoals ='system_goals';
protected $_actions = 'actions';
public function getSystemgoals()
{   
$select = $this->_db->select()
->from($this->_systemgoals);

$result = $this->_db->fetchAll($select);

return $result;
}
public function getSystemactivities()
{   
$select = $this->_db->select()  
->from($this->_actions);    
$result = $this->_db->fetchAll($select);    
return $result;
}
}

从控制器调用时从 getSystemactivities() 返回的内容是:

object(Account_Model_Systemgoals)#66 (21) { ["_options":protected]=> string(11) "goaloptions" ["_systemgoals":protected]=> string(12) "system_goals" ["_actions":protected]=> string(7) "actions" ["_definition":protected]=> NULL ["_definitionConfigName":protected]=> NULL ["_db":protected]=> object(Zend_Db_Adapter_Pdo_Mysql)#8 (12) { ["_pdoType":protected]=> string(5) "mysql" ["_numericDataTypes":protected]=> array(16) { [0]=> int(0) [1]=> int(1) [2]=> int(2) ["INT"]=> int(0) ["INTEGER"]=> int(0) ["MEDIUMINT"]=> int(0) ["SMALLINT"]=> int(0) ["TINYINT"]=> int(0) ["BIGINT"]=> int(1) ["SERIAL"]=> int(1) ["DEC"]=> int(2) ["DECIMAL"]=> int(2) ["DOUBLE"]=> int(2) ["DOUBLE PRECISION"]=> int(2) ["FIXED"]=> int(2) ["FLOAT"]=> int(2) } ["_defaultStmtClass":protected]=> string(21) "Zend_Db_Statement_Pdo" ["_config":protected]=> array(8) { ["host"]=> string(9) "localhost" ["username"]=> string(4) "root" ["password"]=> string(0) "" ["dbname"]=> string(15) "lawcountability" ["charset"]=> NULL ["persistent"]=> bool(false) ["options"]=> array(3) { ["caseFolding"]=> int(0) ["autoQuoteIdentifiers"]=> bool(true) ["fetchMode"]=> int(2) } ["driver_options"]=> array(0) { } } ["_fetchMode":protected]=> int(2) ["_profiler":protected]=> object(Zend_Db_Profiler)#9 (4) { ["_queryProfiles":protected]=> array(0) { } ["_enabled":protected]=> bool(false) ["_filterElapsedSecs":protected]=> NULL ["_filterTypes":protected]=> NULL } ["_defaultProfilerClass":protected]=> string(16) "Zend_Db_Profiler" ["_connection":protected]=> object(PDO)#53 (0) { } ["_caseFolding":protected]=> int(0) ["_autoQuoteIdentifiers":protected]=> bool(true) ["_allowSerialization":protected]=> bool(true) ["_autoReconnectOnUnserialize":protected]=> bool(false) } ["_schema":protected]=> NULL ["_name":protected]=> string(25) "Account_Model_Systemgoals" ["_cols":protected]=> NULL ["_primary":protected]=> NULL ["_identity":protected]=> int(1) ["_sequence":protected]=> bool(true) ["_metadata":protected]=> array(0) { } ["_metadataCache":protected]=> NULL ["_metadataCacheInClass":protected]=> bool(true) ["_rowClass":protected]=> string(17) "Zend_Db_Table_Row" ["_rowsetClass":protected]=> string(20) "Zend_Db_Table_Rowset" ["_referenceMap":protected]=> array(0) { } ["_dependentTables":protected]=> array(0) { } ["_defaultSource":protected]=> string(11) "defaultNone" ["_defaultValues":protected]=> array(0) { } } 

希望有人能指出我正确的方向,奇怪的是,当我从模型中转储结果时,它具有正确的结果集。非常感谢任何帮助。

4

0 回答 0