public function createItem() { if (!$this->isLoggedIn()) { return $this->getUserView(); } else { $itemVals = $_REQUEST['item']; $newItem = new ProdCat(); foreach ($itemVals as $k => $v) { $newItem->{$k}($v); } $newItem->ord($this->highestItemOrder + 1); $newItem->active(1); $newItem->save(); return $this->getUserView(); } }