public function getItemAllBatchesAction() { $wh_id = $this->_request->getParam('wh_id'); if ($wh_id) { $stock_batch = new Model_StockBatch(); $result = $stock_batch->getItemAllBatches($wh_id); } else { $result = array("error" => "Please provide whid param. e.g. (?whid=159)"); } echo Zend_Json::encode($result); }