public function createItemModel(Category $category = null) { $category = $category ?: $this->createModel(); $class = $category->getItemModel(); return new $class(); }