Note that there are some explanatory texts on larger screens.

plurals
  1. POfindManyToManyRowset exclude columns
    text
    copied!<p>how to exclude columns from findManyToManyRowset() method result?</p> <pre><code>$servers = $this-&gt;findManyToManyRowset( 'Serverlog_Model_DbTable_Computer', 'Serverlog_Model_DbTable_Server'); </code></pre> <p>$servers->toArray() gives me:</p> <pre><code>object(Serverlog_Model_Rowset_Computer)#458 (10) { ["_data":protected] =&gt; array(5) { [0] =&gt; array(27) { ["id"] =&gt; int(462) ["name"] =&gt; string(10) "test" ["key"] =&gt; string(0) "" ["keyboard"] =&gt; int(1) ["mouse"] =&gt; int(0) ["serial_nr"] =&gt; string(10) "test" ["status"] =&gt; int(1) } </code></pre> <p>I tried to overload methods toArray() inherited from Zend_Db_Table_Rowset_Abstract and Zend_Db_Table_Row_Abstract, but nothing has changed.</p> <pre><code>class Serverlog_Model_DbTable_Computer extends My_DbTable_Model { protected $_name = 'computers'; protected $_dependentTables = array('Serverlog_Model_DbTable_Server'); protected $_rowClass = 'Serverlog_Model_Row_Computer'; protected $_rowsetClass = 'Serverlog_Model_Rowset_Computer'; class Serverlog_Model_Rowset_Computer extends Zend_Db_Table_Rowset_Abstract { public function toArray() { foreach ($this-&gt;_rows as $i =&gt; $row) { $this-&gt;_data[$i] = array($row-&gt;_data['id'] =&gt; $row-&gt;_data['name']); } return $this-&gt;_data; } class Serverlog_Model_Row_Computer extends Zend_Db_Table_Row_Abstract { public function toArray() { return array($this-&gt;_data['id'] =&gt; $this-&gt;_data['name']); } } </code></pre> <p>I want to get result from $servers->toArray():</p> <pre><code>object(Serverlog_Model_Rowset_Computer)#458 (10) { ["_data":protected] =&gt; array(5) { [0] =&gt; array(27) { ["id"] =&gt; int(462) ["name"] =&gt; string(10) "test" } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload