Pobiera request do przekierowania
@param \Cms\Orm\CmsCategoryRecord $category
@return \Mmi\Http\Request
@throws \Mmi\App\KernelException
171482
protected function _prepareForwardRequest(\Cms\Orm\CmsCategoryRecord $category)
    {
        //tworzenie nowego requestu na podstawie obecnego
        $request = clone $this->getRequest();
        $request->setModuleName('cms')
            ->setControllerName('category')
            ->setActionName('article');
        //przekierowanie MVC
        if ($category->mvcParams) {
            //tablica z tpl
            $mvcParams = [];
            //parsowanie parametrów mvc
            parse_str($category->mvcParams, $mvcParams);
            return $request->setParams($mvcParams);
        }
        //pobranie typu (szablonu) i jego parametrów mvc
        if (!$category->getJoined('cms_category_type')->mvcParams) {
            return $request;
        }
        //tablica z tpl
        $mvcParams = [];
        //parsowanie parametrów mvc
        parse_str($category->getJoined('cms_category_type')->mvcParams, $mvcParams);
        return $request->setParams($mvcParams);
    }
868462
public function addCategoryToCrawlerQueue($category) {
        $catUrls = array();
        $origStore = Mage::app()->getStore();
        foreach (Mage::app()->getStores() as $storeId => $store) {
            Mage::app()->setCurrentStore($store);
            $catUrls[] = $category->getUrl();
        }
        Mage::app()->setCurrentStore($origStore);
        return $this->addUrlsToCrawlerQueue($catUrls);
    }
1061974
public static function getInstance($category = self::CATEGORY_DEFAULT)
    {
        if (!isset(self::$instances[$category])) {
            self::$instances[$category] = new static($category);
        }
        return self::$instances[$category];
    }
971918
public function addCategory($category)
	{
		if (!is_string($category))
		{
			// @codeCoverageIgnoreStart
			throw new \LogicException('Category must be of a type "string"');
			// @codeCoverageIgnoreEnd
		}
		$this->categories[$category] = $category;

		return $this;
	}
1197801
protected function validate_category(category_controller $category) : category_controller {
        $categories = $this->get_categories_with_fields();
        if (!array_key_exists($category->get('id'), $categories)) {
            throw new \moodle_exception('categorynotfound', 'core_customfield');
        }
        return $categories[$category->get('id')];
    }
1042057
public static function create_from_object(category_controller $category) : category_created {
        $eventparams = [
            'objectid' => $category->get('id'),
            'context'  => $category->get_handler()->get_configuration_context(),
            'other'    => ['name' => $category->get('name')]
        ];
        $event = self::create($eventparams);
        $event->add_record_snapshot($event->objecttable, $category->to_record());
        return $event;
    }
1303983
public function cgetAction($categoryId, Request $request)
    {
        /** @var RestHelperInterface $restHelper */
        $restHelper = $this->get('sulu_core.doctrine_rest_helper');

        /** @var DoctrineListBuilderFactory $factory */
        $factory = $this->get('sulu_core.doctrine_list_builder_factory');

        /** @var CategoryInterface $category */
        $category = $this->getCategoryRepository()->find($categoryId);

        $fieldDescriptor = $this->getFieldDescriptors();

        $listBuilder = $factory->create($this->getParameter('sulu.model.keyword.class'));
        $restHelper->initializeListBuilder($listBuilder, $fieldDescriptor);

        $listBuilder->where($fieldDescriptor['locale'], $request->get('locale'));
        $listBuilder->where(
            $fieldDescriptor['categoryTranslationIds'],
            $category->findTranslationByLocale($request->get('locale'))
        );

        // should eliminate duplicates
        $listBuilder->distinct(true);
        $listBuilder->addGroupBy($fieldDescriptor['id']);

        $listResponse = $listBuilder->execute();

        $list = new ListRepresentation(
            $listResponse,
            self::$entityKey,
            'get_category_keywords',
            array_merge(['categoryId' => $categoryId], $request->query->all()),
            $listBuilder->getCurrentPage(),
            $listBuilder->getLimit(),
            $listBuilder->count()
        );

        return $this->handleView($this->view($list, 200));
    }
539287
public function setCategory($category)
    {
        $properties = $this->getProperty();
        $properties['category'] = (array) $category;
        $this->getConfig()->setSection('bundle', $properties, true);

        return $this;
    }
1276308
public function setCategory($category)
    {
        $allowedValues = $this->getCategoryAllowableValues();
        if (!in_array($category, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'category', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['category'] = $category;

        return $this;
    }
1081080
public function withCategory($category)
    {
        Assertion::string($category);
        Assertion::maxLength($category, VideoInterface::CATEGORY_MAX_LENGTH);

        $instance = clone $this;

        $instance->category = $category;

        return $instance;
    }
333395
public function deleteCategoryRelation($categoryId)
    {
        //brak kategorii - nic do zrobienia
        if (null === $categoryRecord = (new CmsCategoryQuery)
            ->findPk($categoryId)) {
            return;
        }
        //wyszukiwanie relacji
        if (null === $relationRecord = (new CmsCategoryRelationQuery)
            ->whereCmsCategoryId()->equals($categoryRecord->id)
            ->andFieldObject()->equals($this->_object)
            ->andFieldObjectId()->equals($this->_objectId)
            ->findFirst()) {
            //brak relacji - nic do zrobienia
            return;
        }
        //usunięcie relacji
        $relationRecord->delete();
    }
146377
private function createDeleteForm(Category $category)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('ecommerce_category_delete', array('id' => $category->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
96874
public function update(CategoryRequest $request, Category $category)
    {
        $this->repository->update($category, $request->all());
        
        return redirect()->route('admin.category.index');
    }
915896
public function destroy(Category $category)
    {
        $this->category->destroy($category);

        return redirect()->route('admin.product.category.index')
            ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::categories.title.categories')]));
    }
1106098
public function addCategory(CategoryEntity $category)
    {
        $fileVersion = $this->getFileVersion();
        $fileVersion->addCategory($category);

        return $this;
    }
653207
public function addCategory(\Enhavo\Bundle\CategoryBundle\Entity\Category $category)
    {
        $category->setCollection($this);
        $this->categories[] = $category;

        return $this;
    }
87340
public function setCategory(\HarvestCloud\CoreBundle\Entity\Category $category)
    {
        $this->category = $category;

        return $this;
    }