220 $entity = $this->getModel()->fetch();
221
222 if(!count($entity))
223 {
224 $name = ucfirst($this->getView()->getName());
225 throw new KControllerExceptionResourceNotFound($name.' Not Found');
226 }
227 }
228 else $entity = $this->getModel()->create();
229 }
230 else $entity = $context->result;