/** * Get a single item type. * Used for ajax requests. * * @param \Model\ItemType $itemType * * @return void */ protected function getItemType($itemType) { $this->doRender = false; if (empty($itemType)) { $this->echoAjaxResponse(array('ok' => false, 'error' => 'noItemTypeFound')); } else { $itemTypeArray = $itemType->getAsArray(); $this->echoAjaxResponse(array('ok' => true, 'data' => $itemTypeArray)); } }