Ejemplo n.º 1
0
 public function getAction()
 {
     $regex = $this->getInvokeArg('bootstrap')->getOption('paramregex');
     //if (preg_match($regex['contentid'], $this->_getParam('id')) === 0)
     //	throw new Exception('Illegal Content Id.');
     if (preg_match("^(latest|[0-9]+)\$", $this->_getParam('id')) === 0) {
         throw new Exception('Illegal Content Id.');
     }
     $version = $this->_getParam('id');
     $data = $this->getEmptyResult();
     $data['results'] = Application_Model_ContentPeer::getContentForVersion($version);
     $this->getResponse()->setBody(json_encode($data));
     $this->getResponse()->setHttpResponseCode(200);
 }