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);
    }