@private

Add an extension for the given category (icons, addClass).

@param {string} category Category to which the extension is being added
@param {function} callback The extension function itself
515817
function _addExtension(category, callback) {
        if (!callback || typeof callback !== "function") {
            console.error("Attempt to add FileTreeView", category, "extension without a callback function");
            return;
        }
        var callbackList = _extensions.get(category);
        if (!callbackList) {
            callbackList = Immutable.List();
        }
        callbackList = callbackList.push(callback);
        _extensions = _extensions.set(category, callbackList);
    }
346358
def add_category(self, category):
        '''
        
        '''
        if category == sre.CATEGORY_DIGIT:
            self._categories |= UNICODE_DIGIT_CATEGORIES
        elif category == sre.CATEGORY_NOT_DIGIT:
            self._categories |= UNICODE_CATEGORIES - UNICODE_DIGIT_CATEGORIES
        elif category == sre.CATEGORY_SPACE:
            self._categories |= UNICODE_SPACE_CATEGORIES
            for c in (UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS):
                self._whitelist_chars.add(c)
        elif category == sre.CATEGORY_NOT_SPACE:
            self._categories |= UNICODE_CATEGORIES - UNICODE_SPACE_CATEGORIES
            for c in (UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS):
                self._blacklist_chars.add(c)
        elif category == sre.CATEGORY_WORD:
            self._categories |= UNICODE_WORD_CATEGORIES
            self._whitelist_chars.add(u'_')
            if HAS_WEIRD_WORD_CHARS and self._unicode:
                for c in UNICODE_WEIRD_NONWORD_CHARS:
                    self._blacklist_chars.add(c)
        elif category == sre.CATEGORY_NOT_WORD:
            self._categories |= UNICODE_CATEGORIES - UNICODE_WORD_CATEGORIES
            self._blacklist_chars.add(u'_')
            if HAS_WEIRD_WORD_CHARS and self._unicode:
                for c in UNICODE_WEIRD_NONWORD_CHARS:
                    self._whitelist_chars.add(c)
176182
public function addCategory(CategoryInterface $category)
    {
        if (!$this
            ->categories
            ->contains($category)
        ) {
            $this
                ->categories
                ->add($category);
        }

        return $this;
    }
69010
def add_callback(self, callback, *callback_args, **callback_kwargs):
        """"""
        return self.add_callbacks(callback, callback_args=callback_args,
                           callback_kwargs=callback_kwargs)
1351218
function(category) {
			var settings  = this.getSettings(category);
			for (var i = 0; i < settings.length; i++){
				var label = settings[i].getCategoryLabel();
				if (label) {
					return label;
				}
			}
			return null;
		}
1337438
protected function addCategory()
    {
        if (!$this->isError()) {
            $id = $this->category->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
62877
function appendExtensions (obj, extensions) {
  if (!extensions) {
    return
  }

  for (var i = 0; i < extensions.length; i++) {
    var extension = extensions[i]

    // add extension to the type entry
    appendExtension(obj, extension)
  }
}
103324
def add_maxjobs_category(self,categoryName,maxJobsNum):
    
    self.__maxjobs_categories.append((str(categoryName),str(maxJobsNum)))
1042415
public static UICategory create(UICategory category, String... categories)
   {
      Assert.notNull(category, "Parent UICategory must not be null.");
      Assert.notNull(categories, "Sub categories must not be null.");
      List<String> args = new ArrayList<>();
      args.add(category.getName());
      args.addAll(Arrays.asList(categories));
      return create(args.toArray(new String[args.size()]));
   }
1370318
private function setCategoryFullSlug(Category $category): void
    {
        static $languages;

        if (! $languages) {
            $languages = $this->language ? [$this->language] : TransHelper::getAllLanguages();
        }

        foreach ($languages as $language) {
            $category->translations()->where('locale', $language->iso_code)->update([
                'full_slug' => $this->getSlugForCategory($category->id, $language->iso_code),
            ]);
        }

        foreach ($category->descendants()->get() as $descendant) {
            foreach ($languages as $language) {
                $descendant->translations()->where('locale', $language->iso_code)->update([
                    'full_slug' => $this->getSlugForCategory($descendant->id, $language->iso_code),
                ]);
            }
        }
    }
240059
protected function submitAddCategory()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('category');
        $this->addCategory();
    }
64195
function addonsManager_getCategoryId(aSpec) {
    var spec = aSpec || { };
    var category = spec.category;

    if (!category)
      throw new Error(arguments.callee.name + ": Category not specified.");

    return category.getNode().id;
  }
867299
public function addNestedSetChild(ChildCategory $category)
    {
        if (null === $this->collNestedSetChildren) {
            $this->initNestedSetChildren();
        }
        if (!in_array($category, $this->collNestedSetChildren->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
            $this->collNestedSetChildren[]= $category;
            $category->setParent($this);
        }
    }
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;
    }
44400
public static function extend($type, $callback=null)
    {
        if (is_array($type)) {
            self::$type=array_merge(self::$type, $type);
        } else {
            self::$type[$type]=$callback;
        }
    }
990983
public function category(Category $category)
    {
        $this->category = $category;

        $this->category->categorise($this);
    }
946032
static function updateCategory($category)
    {
        // Update the category thread and post counts
        $threads = $category->threads()->where('deleted_at', null)->get();
        $category->thread_count = $threads->count();

        $postCount = 0;
        foreach ($threads as $thread) {
            $postCount += $thread->posts->count();
        }

        $category->post_count = $postCount;
        $category->saveWithoutTouch();
    }