@param string $category

@return GoogleVideoUrlDecorator
323062
public function setCategory($category)
    {
        if (strlen($category) > 256) {
            throw new Exception\GoogleVideoUrlException(
                sprintf(
                    'The parameter %s must be a valid category. see http://support.google.com/webmasters/bin/answer.py?hl=en&answer=80472#4',
                    $category
                )
            );
        }

        $this->category = $category;

        return $this;
    }
278083
public function setCategory($category)
    {
        $allowed_values = array('alliance', 'character', 'constellation', 'corporation', 'inventory_type', 'region', 'solar_system', 'station');
        if ((!in_array($category, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'category', must be one of 'alliance', 'character', 'constellation', 'corporation', 'inventory_type', 'region', 'solar_system', 'station'");
        }
        $this->container['category'] = $category;

        return $this;
    }
460096
protected static function loggerCategory($category): string
    {
        /** @noinspection PhpUndefinedFieldInspection */
        $prefix = static::$category ?? '';

        if (empty($category)) {
            return $prefix;
        }

        return ($prefix ? $prefix . ':' : '') . $category;
    }
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')]));
    }
706588
protected function setCategory(CategoryInterface $category)
    {
        $this->category = $category;
        $this->attributeKeysAndControllers = null;
        $this->csvHeader = null;

        return $this;
    }
1017758
public function category($category)
    {
        $categoryId = NotificationCategory::getIdByCategory($category);
        $this->setNotificationData('category_id', $categoryId);

        return $this;
    }
728324
public function descendantsOf(ChildCategory $category)
    {
        return $this
            ->addUsingAlias(ChildCategory::LEFT_COL, $category->getLeftValue(), Criteria::GREATER_THAN)
            ->addUsingAlias(ChildCategory::LEFT_COL, $category->getRightValue(), Criteria::LESS_THAN);
    }
2342
public function edit(Category $category)
    {
        $categories = $this->category->all()->nest()->listsFlattened('name');

        return view('product::admin.categories.edit', compact('category', 'categories'));
    }
1305850
public static function adminCategoriesPrepareContent($category)
    {
        $actions = [];
        $actions[] = Html::button(Html::tag('span', '', ['class' => 'glyphicon glyphicon-eye-' . ($category->visible ? 'open' : 'close')]), ['class' => 'btn btn-xs text-muted', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => $category->visible ? Yii::t('podium/view', 'Category visible for guests') : Yii::t('podium/view', 'Category hidden for guests')]);
        $actions[] = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-list']) . ' ' . Yii::t('podium/view', 'List Forums'), ['admin/forums', 'cid' => $category->id], ['class' => 'btn btn-default btn-xs']);
        $actions[] = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-plus-sign']) . ' ' . Yii::t('podium/view', 'Create new forum'), ['admin/new-forum', 'cid' => $category->id], ['class' => 'btn btn-success btn-xs']);
        $actions[] = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-cog']), ['admin/edit-category', 'id' => $category->id], ['class' => 'btn btn-default btn-xs', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Edit Category')]);
        $actions[] = Html::tag('span', Html::button(Html::tag('span', '', ['class' => 'glyphicon glyphicon-trash']), ['class' => 'btn btn-danger btn-xs', 'data-url' => Url::to(['admin/delete-category', 'id' => $category->id]), 'data-toggle' => 'modal', 'data-target' => '#podiumModalDelete']), ['data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Delete Category')]);

        return Html::tag('p', implode(' ', $actions), ['class' => 'pull-right']) . Html::tag('span', Html::encode($category->name), ['class' => 'podium-forum', 'data-id' => $category->id]);
    }
86982
private function showList($category = null)
    {
        // eloquent model - VirtualTour::class
        $eloquent = $this->eloqent();

        // base builder
        $builder = $eloquent::with('category')->active();

        // if we need to filter by category
        if ($category && strlen($category) > 2) {

            $category = $this->eloqentCategory()->where('slug', $category)->first();

            if (!$category) {
                return redirect($this->URLPrefix);
            }

            // increment (dont increment on ajax pagination)
            if (!$this->request->ajax()) {

                // prefix the category in title
                $this->title = $category->title;

                // increment total views
                $category->increment('total_views');
                if ($category->getTable() == 'categories') {
                    $category->increment("views_" . $eloquent->getTable());
                }
            }

            // filter by category
            $builder->where('category_id', $category->id);
        }

        // order by date desc, paginate
        $items = $builder->orderBy('active_from', 'DESC')->paginate($this->paginate);

        // if ajax - paginate the articles
        if ($this->request->ajax()) {

            $view = "website.partials.content.pagination";
            if ($this->view == 'photographies') {
                $view = "website.partials.$this->view.pagination";
            }

            return response()->json(view()->make($view, compact('items'))->render());
        }

        $categories = $this->categoriesHTML($category);
        if ($category) {
            $this->addBreadcrumbLink($category->title, '/content/' . $category->url);
        }

        return $this->view("content.$this->view", compact('categories', 'items'));
    }
590883
public function showAction(Category $category)
    {
        $deleteForm = $this->createDeleteForm($category);

        return array(
            'entity' => $category,
            'delete_form' => $deleteForm->createView(),
        );
    }
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;
	}
799877
public function removeCategory($category)
	{
		if (!is_string($category))
		{
			// @codeCoverageIgnoreStart
			throw new \LogicException('Category must be of a type "string"');
			// @codeCoverageIgnoreEnd
		}
		if (isset($this->categories[$category]))
		{
			unset($this->categories[$category]);
		}

		return $this;
	}
1210665
protected function prepareCategory(array &$category)
    {
        $this->setItemAlias($category, 'category', $this->alias);
        $this->setItemImages($category, 'category', $this->image);
        $this->setItemTranslation($category, 'category', $this->translation_entity);

        if (!empty($category['images'])) {
            foreach ($category['images'] as &$file) {
                $this->setItemTranslation($file, 'file', $this->translation_entity);
            }
        }
    }
1241549
public function add($category)
    {
        if (is_array($category)) {
            $this->collection[] = new Category($category);
        } elseif (is_object($category) && $category instanceof Category) {
            $this->collection[] = $category;
        }

        return $this;
    }
555036
private function getCategoryBreadcrumb(\Magento\Catalog\Model\Category $category)
    {
        $path    = $category->getPath();
        $rawPath = explode('/', $path);

        // First occurence is root category (1), second is root category of store.
        $rawPath = array_slice($rawPath, 2);

        // Last occurence is the category displayed.
        array_pop($rawPath);

        $breadcrumb = [];
        foreach ($rawPath as $categoryId) {
            $breadcrumb[] = html_entity_decode($this->getCategoryNameById($categoryId, $category->getStoreId()));
        }

        return $breadcrumb;
    }
743542
public function single($category)
    {
        $entry = new Entry($category);

        $entry
            ->field('id')
            ->field('label')
            ->field('slug')
            ->field('parent')
            ->field('position')
        ;

        return $entry->toArray();
    }