Adds a new inheritance definition to the inheritance list and sets the
parent column of the inheritance to the current column.

@param  Inheritance|array $inheritance
@return Inheritance
484028
public function addInheritance($inheritance)
    {
        if ($inheritance instanceof Inheritance) {
            $inheritance->setColumn($this);
            if (null === $this->inheritanceList) {
                $this->inheritanceList = [];
                $this->isEnumeratedClasses = true;
            }
            $this->inheritanceList[] = $inheritance;

            return $inheritance;
        }

        $inh = new Inheritance();
        $inh->loadMapping($inheritance);

        return $this->addInheritance($inh);
    }
161791
public function setParent($parent) {
		if (! is_object($parent)) {
			throw new WrongParent('Parent of a helper must be an object, "' . gettype($parent) . '" was given');
		}
		
		$this->_parent = $parent;
		
		return $this;
	}
1137162
public function addParent(NodeInterface $parent, bool $setParentsChild = true): NodeInterface
    {
        if (!$this->supportsParent($parent)) {
            throw ParentTypeNotSupportedException::create($this, $parent);
        }

        $this->_parents[$parent->getId()] = $parent;

        if ($setParentsChild) {
            $parent->addChild($this, false);
        }

        $this->notifySubscribers(
            self::EVENT_ADD_PARENT,
            ['oldParents' => $this->_parents, 'newParent' => $parent, 'child' => $this]
        );

        return $this;
    }
674879
public function setRole($names, $inherit = null)
    {
        foreach ((array) $names as $name) {
            $this->roles[$name] = new SimpleRole($name, $inherit);
        }
    }
465866
public function setDescendantClass($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->descendant_class !== $v) {
            $this->descendant_class = $v;
            $this->modifiedColumns[StructureNodeTableMap::COL_DESCENDANT_CLASS] = true;
        }

        return $this;
    }
238728
public function setParentId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->parent_id !== $v) {
            $this->parent_id = $v;
            $this->modifiedColumns[SkillDependencyTableMap::COL_PARENT_ID] = true;
        }

        if ($this->aSkillRelatedByParentId !== null && $this->aSkillRelatedByParentId->getId() !== $v) {
            $this->aSkillRelatedByParentId = null;
        }

        return $this;
    }
246431
def apply_inheritance(self):
        
        super(Services, self).apply_inheritance()

        # add_item only ensure we can build a key for services later (after explode)
        for item in list(self.items.values()):
            self.add_item(item, False)
74647
public function inherited($field)
    {
        list($inherited, $currentParams) = $this->getInheritedParams($field);

        $this->modifyHeader($field, $currentParams);

        return $inherited;
    }
552243
public function extend($extends, $append = false)
    {
        if ($extends instanceof self) {
            $extends = $extends->toArray();
        }

        if ($append) {
            $a = $this->items;
            $b = $extends;
        } else {
            $a = $extends;
            $b = $this->items;
        }

        $this->items = $this->deepMerge($a, $b);

        return $this;
    }
992603
public function setParentClass(GClass $gClass) {
    $this->class->setParentClass($gClass);
    if ($gClass->exists()) {
      try {
        // damit die gclass vernünftig initialisiert wird
        $this->class->elevateParent();
        
      } catch (\Psc\Code\Generate\ReflectionException $e) {
        throw new \Psc\Exception(
          'Die Parent-Klasse: '.$gClass->getFQN().' kann nicht elevated werden. Das ist schlecht, denn so können nicht alle methoden korrekt vererbt werden oder properties erstellt werden.'.
          'Die SyntaxFehler der Klasse müssen zuerst behoben werden',
          0,
          $e
        );
      }
    }
    
    return $this;
  }
449956
public function setParent($parent)
    {
        if (!empty($parent)) {
            $this->_parent = $this->_normalizeClass($parent);
        } else {
            $this->_parent = null;
        }

        return $this;
    }
721476
protected function applyAncestor()
    {

        if ($this->skipAncestor === true) {
            return $this;
        }

        $ancestor = $this->getAncestor();

        if ($ancestor) {
            foreach ($ancestor as $a) {
                if ($a instanceof AncestorCriteriaInterface) {
                    $this->model = $a->apply($this->model, $this);
                }
            }
        }

        return $this;
    }
242121
protected function _mergeDecoratorOptions(Zend_Form_Element $element, array $inheritance) {
        foreach ($inheritance as $mergedDecorator) {
            $name = is_array($mergedDecorator) ? $mergedDecorator[0] : $mergedDecorator;
            $options = is_array($mergedDecorator) ? $mergedDecorator[1] : [];
            $existingDecorator = $element->getDecorator($name);
            if (!$existingDecorator) {
                continue;
            }
            foreach ($options as $key => $value) {
                $existingDecorator->setOption($key, $value);
            }
        }
    }
396371
public function setColumns(array $columns, $add = false) {
        if (!$add) {
            $this->columnDefinition = [];
        }
        foreach ($columns as $key => $def) {
            $this->addColumn($key, $def);
        }
        return $this;
    }
686872
public function setParent(InnerNode $parent)
    {
        // check integrity
        if ($this->isDescendant($parent->id())) {
            throw new CircularException('Can not add descendant "'.$parent->id().'" as my parent.');
        }

        return parent::setParent($parent);
    }
487862
protected function getInheritanceFinder(){
        if(!file_exists(storage_path('class_cache'))){
            mkdir(storage_path('class_cache'));
        }

        $config = new \Synga\InheritanceFinder\File\FileConfig();

        $config->setApplicationRoot(base_path());
        $config->setCacheDirectory(storage_path('class_cache'));

        return (new InheritanceFinderFactory())->getInheritanceFinder($config);
    }
417346
protected function buildPrototypeHierarchy()
    {
        if (!isset($this->objectTree['__prototypes'])) {
            return;
        }

        foreach ($this->objectTree['__prototypes'] as $prototypeName => $prototypeConfiguration) {
            $prototypeInheritanceHierarchy = [];
            $currentPrototypeName = $prototypeName;
            while (isset($this->objectTree['__prototypes'][$currentPrototypeName]['__prototypeObjectName'])) {
                $currentPrototypeName = $this->objectTree['__prototypes'][$currentPrototypeName]['__prototypeObjectName'];
                array_unshift($prototypeInheritanceHierarchy, $currentPrototypeName);
                if ($prototypeName === $currentPrototypeName) {
                    throw new Fusion\Exception(sprintf('Recursive inheritance found for prototype "%s". Prototype chain: %s', $prototypeName, implode(' < ', array_reverse($prototypeInheritanceHierarchy))), 1492801503);
                }
            }

            if (count($prototypeInheritanceHierarchy)) {
                // prototype chain from most *general* to most *specific* WITHOUT the current node type!
                $this->objectTree['__prototypes'][$prototypeName]['__prototypeChain'] = $prototypeInheritanceHierarchy;
            }
        }
    }