Adds a label to this node, checks if the label does not exist to avoid duplicates

@param  string $label
@return bool
487986
public function addLabel($label)
    {
        if (null !== $label) {
            $l = (string) $label;
            if (!$this->hasLabel($l)) {
                $this->labels->add($l);

                return true;
            }
        }

        return false;
    }
323379
public function add($label, $url='')
    {
        if (is_array($label)) {
            if (count($label) > 0) foreach ($label as $crumb) {
                $defaults = [
                    'label' => '',
                    'url'   => ''
                ];
                $crumb = array_merge($defaults, $crumb);
                $this->add($crumb['label'], $crumb['url']);
            }
        } else {
            $label = trim(strip_tags($label, '<i><b><strong>'));
            if (! preg_match('|^http(s)?|', $url)) {
                $url = URL::to($url);
            }
            $this->crumbs[] = array('label' => $label, 'url' => $url);
        }

        return $this;
    }
1026857
public function saveLabel(\stdClass $label)
    {
        if (!empty($label->tid)) {
            // Prevents to save a label with a parent if it has children.
            // The labels vocabulary must have only two levels.
            if (!isset($label->original)) {
                $label->original = $this->entityManager->getStorage('taxonomy_term')->loadUnchanged($label->tid);
            }
            if (!isset($label->original->parent)) {
                $label->original->parent = 0;
            }
            if ($this->hasChildren($label) && $label->parent != $label->original->parent) {
                throw new \LogicException("Can't define a parent to a label which has children.");
            }
        }

        return taxonomy_term_save($label);
    }
569617
public function setLabel(Label $label)
    {
        $label->checkId();
        $label->setScriptEvents(true);
        $this->label = $label;
        return $this;
    }
1042315
public function setLabel($label)
    {
        if (is_array($label) && $label['icon']) {
            $this->setIcon($label['icon']);
        } elseif (is_string($label)) {
            return $this->setText($label);
        }

        return $this;
    }
1044011
private function get_add_element_content($label) {
        global $PAGE, $OUTPUT;

        $bs4 = false;

        $theme = $PAGE->theme;
        if ($theme->name === 'boost') {
            $bs4 = true;
        } else {
            foreach ($theme->parents as $basetheme) {
                if ($basetheme === 'boost') {
                    $bs4 = true;
                }
            }
        }

        if (!$bs4) {
            return $label;
        }
        return $OUTPUT->pix_icon('e/insert', $label);
    }
323516
public function setLabel( $label )
	{
		if ( $label == $this->getLabel() ) { return; }

		$this->_values['label'] = (string) $label;
		$this->setModified();
	}
1032796
public function setLabelOne($labels, $one)
    {
        $labels->singular_name = __($one);
        $labels->add_new = __('Add ' . $one);
        $labels->add_new_item = __('Add New ' . $one);
        $labels->edit_item = __('Edit ' . $one);
        $labels->new_item = __('New ' . $one);
        $labels->view_item = __('View ' . $one);
        $labels->parent_item_colon = __('Parent ' . $one . ':');
        $labels->archives = __($one . ' Archives');
        $labels->attributes = __($one . ' Attributes');
        $labels->insert_into_item = __('Insert into ' . strtolower($one));
        $labels->uploaded_to_this_item = __('Uploaded to this ' . strtolower($one));
        $labels->filter_items_list = __('Filter ' . strtolower($one) . ' list ');
        $labels->name_admin_bar = __($one);
        return $labels;
    }
1267338
protected function getOrCreateTag($label)
    {
        if (isset($this->tagFirstLevelCache[$label])) {
            return $this->tagFirstLevelCache[$label];
        }

        $tag = $this->tagRepository->findOneByLabel($label);

        if ($tag === null) {
            $tag = new Tag($label);
            $this->tagRepository->add($tag);
        }

        $this->tagFirstLevelCache[$label] = $tag;

        return $tag;
    }
1372633
public function createBrand($label)
    {
        $brand = new Link();
        $brand->attributes->addAttributeClass('navbar-brand');
        $brand->setAttributeHref(base_url());

        if (is_object($label)) {
            $brand->childNodes->push($label);
        } else {
            $brand->textContent->push($label);
        }

        $this->childNodes->unshift($brand);

        return $this->brand = $this->childNodes->last();
    }
501162
protected function setErrorExists($field, $label)
    {
        $error = $this->translation->text('@name already exists', array('@name' => $label));
        return $this->setError($field, $error);
    }
1022033
protected function createLabel($label)
    {
        if (!is_string($label)) {
            throw new InvalidArgumentException(
                "Provided label is not a string or an ElementInterface ".
                "interface object."
            );
        }

        $element = class_exists($label)
            ? $this->createLabelFromClass($label)
            : new Label('', $label);

        return $element;
    }
980882
public function label($label = null)
    {
        if (null !== $label) {
            $this->label = $label;

            return $this;
        }

        if (Lang::has($this->label)) {
            return __($this->label);
        }
        return $this->label;
    }
59589
public function addLabel($label, $before=false, $icon=NULL) {
		$this->tagName="div";
		$this->addToProperty("class", "labeled");
		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
		$this->content->setTagName("div");
		$label=new HtmlLabel("label-" . $this->identifier, $label, "a");
		if(isset($icon))
			$label->addIcon($icon);
		$label->setBasic();
		$this->addContent($label, $before);
		return $label;
	}
1231824
public function addButton($label = null, $options = array())
    {
        /** @type Button $but */
        $but = $this->add('Button', $options);
        $but->set($label);
        if ($this->vertical) {
            $but->js(true)->css('margin-top', '-3px');
        }

        return $but;
    }
1189046
public function getByLabel($label)
    {
        return isset($this->items[$label]) ? $this->items[$label] : null;
    }
961913
public function addLabel(Doozr_Form_Service_Component_Interface_Html $label)
    {
        $index               = $this->addChild($label);
        $this->index[$index] = self::LABEL;

        (!isset($this->indexReverse[self::LABEL])) ? $this->indexReverse[self::LABEL] = [] : null;
        $this->indexReverse[self::LABEL][]                                            = $index;

        return $index;
    }