ZF-3841: Expand Zend_Dojo_Data to include custom parameters

Issue Type: Improvement Created: 2008-08-03T15:29:27.000+0000 Last Updated: 2008-09-08T09:10:21.000+0000 Status: Resolved Fix version(s): - 1.6.1 (15/Sep/08)

Reporter: Dave (dave_edelhart) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: Attachments:


The requires a "numRows" parameter of the data JSON block. While patching this particular parameter would be easy, it might be better to allow a user-expandable array for any parameters they might want to add. I have implemented such in my extension of this class.

extra\_params[$pKey] = $pValue; } public function get\_extra\_param($pKey){ if(isset($this->extra\_params[$pKey])): return $this->extra\_params[$pKey]; else: return NULL; endif; } public function toArray(){ return array\_merge($this->extra\_params, parent::toArray()); } } ?>


Posted by Matthew Weier O'Phinney (matthew) on 2008-09-08T09:10:20.000+0000

Patch committed to trunk and 1.6 release branch. API is as follows:

<pre class="highlight">
// Set the "numRows" to 100
$data->setMetadata('numRows', 100);

// Set several items at once:
    'numRows' => 100,
    'sort'    => 'name',

// Inspect a single metadata value:
$numRows = $data->getMetadata('numRows');

// Inspect all metadata:
$metadata = $data->getMetadata();

// Remove a metadata item:

// Remove all metadata:

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.