I'm trying to get the category_id so i was thinking this would be $topics->category_id however that results in a error.
$this->view->title = "Forum";
$this->view->headTitle($this->view->title);
/*
* Calls the Database table for the Categories, well this is just our example table.
*/
$topics = new Forum_Model_DbTable_Topics();
$category = new Forum_Model_DbTable_Categories();
$id = $this->_getParam('id', 0);
$this->view->topics = $topics->find($id);
// Get Category ID from topic
$categoryID = // Topic category_id
$this->view->category = $category->find($categoryID);
i've included a dump of $topics, i can't seem to make much seance of it.
object(Forum_Model_DbTable_Topics)#46 (18) {
["_name":protected]=>
string(12) "Forum_Topics"
["_definition":protected]=>
NULL
["_definitionConfigName":protected]=>
NULL
["_db":protected]=>
object(Zend_Db_Adapter_Pdo_Mysql)#34 (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(4) "root"
["dbname"]=>
string(23) "AB Comforts Development"
["charset"]=>
NULL
["persistent"]=>
bool(false)
["options"]=>
array(2) {
["caseFolding"]=>
int(0)
["autoQuoteIdentifiers"]=>
bool(true)
}
["driver_options"]=>
array(0) {
}
}
["_fetchMode":protected]=>
int(2)
["_profiler":protected]=>
object(Zend_Db_Profiler)#35 (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)#62 (0) {
}
["_caseFolding":protected]=>
int(0)
["_autoQuoteIdentifiers":protected]=>
bool(true)
["_allowSerialization":protected]=>
bool(true)
["_autoReconnectOnUnserialize":protected]=>
bool(false)
}
["_schema":protected]=>
NULL
["_cols":protected]=>
array(8) {
[0]=>
string(2) "id"
[1]=>
string(11) "category_id"
[2]=>
string(5) "title"
[3]=>
string(4) "desc"
[4]=>
string(5) "order"
[5]=>
string(16) "lastpost_user_id"
[6]=>
string(18) "lastpost_thread_id"
[7]=>
string(13) "lastpost_date"
}
["_primary":protected]=>
array(1) {
[1]=>
string(2) "id"
}
["_identity":protected]=>
int(1)
["_sequence":protected]=>
bool(true)
["_metadata":protected]=>
array(8) {
["id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(2) "id"
["COLUMN_POSITION"]=>
int(1)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(false)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(true)
["PRIMARY_POSITION"]=>
int(1)
["IDENTITY"]=>
bool(true)
}
["category_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(11) "category_id"
["COLUMN_POSITION"]=>
int(2)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["title"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(5) "title"
["COLUMN_POSITION"]=>
int(3)
["DATA_TYPE"]=>
string(7) "varchar"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
string(3) "128"
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["desc"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(4) "desc"
["COLUMN_POSITION"]=>
int(4)
["DATA_TYPE"]=>
string(4) "text"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["order"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(5) "order"
["COLUMN_POSITION"]=>
int(5)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["lastpost_user_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(16) "lastpost_user_id"
["COLUMN_POSITION"]=>
int(6)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
string(1) "1"
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["lastpost_thread_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(18) "lastpost_thread_id"
["COLUMN_POSITION"]=>
int(7)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
string(1) "1"
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["lastpost_date"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(12) "Forum_Topics"
["COLUMN_NAME"]=>
string(13) "lastpost_date"
["COLUMN_POSITION"]=>
int(8)
["DATA_TYPE"]=>
string(8) "datetime"
["DEFAULT"]=>
string(19) "0000-00-00 00:00:00"
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
}
["_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) {
}
}