sets categories where the item is included into

Does not consider the domain of the category.

@param   string[]  $categories
@return  \stubbles\xml\rss\RssFeedItem
160841
public function inCategories(array $categories): self
    {
        foreach ($categories as $category) {
            if (is_array($category)) {
                $this->inCategory($category['category'], $category['domain']);
            } else {
                $this->inCategory($category);
            }
        }

        return $this;
    }
724760
public function addCategories($categories)
    {
        $this->setProperty(
            'categories',
            'CATEGORIES' . $this->getCharsetString(),
            trim(implode(',', $categories))
        );

        return $this;
    }
1063361
public static function delete_categories($categories) {
        global $CFG, $DB;
        require_once($CFG->dirroot . "/course/lib.php");

        // Validate parameters.
        $params = self::validate_parameters(self::delete_categories_parameters(), array('categories' => $categories));

        $transaction = $DB->start_delegated_transaction();

        foreach ($params['categories'] as $category) {
            $deletecat = core_course_category::get($category['id'], MUST_EXIST);
            $context = context_coursecat::instance($deletecat->id);
            require_capability('moodle/category:manage', $context);
            self::validate_context($context);
            self::validate_context(get_category_or_system_context($deletecat->parent));

            if ($category['recursive']) {
                // If recursive was specified, then we recursively delete the category's contents.
                if ($deletecat->can_delete_full()) {
                    $deletecat->delete_full(false);
                } else {
                    throw new moodle_exception('youcannotdeletecategory', '', '', $deletecat->get_formatted_name());
                }
            } else {
                // In this situation, we don't delete the category's contents, we either move it to newparent or parent.
                // If the parent is the root, moving is not supported (because a course must always be inside a category).
                // We must move to an existing category.
                if (!empty($category['newparent'])) {
                    $newparentcat = core_course_category::get($category['newparent']);
                } else {
                    $newparentcat = core_course_category::get($deletecat->parent);
                }

                // This operation is not allowed. We must move contents to an existing category.
                if (!$newparentcat->id) {
                    throw new moodle_exception('movecatcontentstoroot');
                }

                self::validate_context(context_coursecat::instance($newparentcat->id));
                if ($deletecat->can_move_content_to($newparentcat->id)) {
                    $deletecat->delete_move($newparentcat->id, false);
                } else {
                    throw new moodle_exception('youcannotdeletecategory', '', '', $deletecat->get_formatted_name());
                }
            }
        }

        $transaction->allow_commit();
    }
539287
public function setCategory($category)
    {
        $properties = $this->getProperty();
        $properties['category'] = (array) $category;
        $this->getConfig()->setSection('bundle', $properties, true);

        return $this;
    }
903594
public function setCategory(array $category)
    {
        $categoryClassInstance = new Category();
        foreach ($category as $categoryInstance) {
            Validate::isInstanceOf(
                $categoryInstance,
                $categoryClassInstance,
                'category'
            );
        }
        $this->category = $category;
    }
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;
    }
1112591
private function formatCategories(array $categories) {

    $terms = [];

    foreach ($categories as $cid) {
      $term = $this->categoryRepo->loadCategoryTerm($cid);
      if ($term) {
        $terms[] = $term->id();
      }
    }

    return ($terms);
  }
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;
    }
866559
public function load($categories)
    {
        if (is_string($categories)) {
            $categories = [$categories];
        }

        foreach ($categories as $idx => $category) {
            if (isset($this->items[$category])) {
                unset($categories[$idx]);
            } else {
                $this->items[$category] = [];
            }
        }

        if (empty($categories)) {
            return;
        }

        $result = (new Query())->select(['category', 'key', 'value'])->from('setting')->where([
            'category' => $categories
        ])->all();

        foreach ($result as $row) {
            try {
                $this->items[$row['category']][$row['key']] = Json::decode($row['value']);
            } catch (InvalidParamException $ex) {
                $this->items[$row['category']][$row['key']] = $row['value'];
            }
        }
    }
1222113
public function setCategory(\HarvestCloud\CoreBundle\Entity\Category $category)
    {
        $this->category = $category;

        // copy over the path
        $this->setCategoryPath($category->getPath());
    }
751520
public function setItems(array $items)
    {
        $this->feedManager->get($this->name)->addFromArray($items);

        return $this;
    }
681276
public function setCategory(\Innova\LexiconBundle\Entity\Category $category = null)
    {
        $this->category = $category;

        return $this;
    }
1228283
public function getAllFromCategories(array $categories)
    {
        $queryBuilder = $this->createQueryBuilder('p');
        $this->addPerformanceJoinsToQueryBuilder($queryBuilder);

        return $queryBuilder
            ->innerJoin('p.categories', 'c')
            ->where('c.id IN (:categories)')
            ->setParameters([
                'categories' => $categories,
            ])
            ->getQuery()
            ->getResult();
    }
994662
public function setCategories($categories)
    {
        foreach ($categories as $key => $name) {
            $this->_categories[$key] = $name;
        }
    }
975658
public function setDisplayCategories($displayCategories) {
		$this->displayCategories = [];

		foreach ($displayCategories as $displayCategory) {
			$this->addDisplayCategory($displayCategory);
		}

		return $this;
	}
130693
public function addCategory(CategoryInterface $category)
    {
        if (! $this->hasCategory($category)) {
            $this->categories->add($category);
        }

        return $this;
    }
711145
public function removeCategorie(\Haven\CoreBundle\Entity\Category $categories)
    {
        $this->categories->removeElement($categories);
    }