Jackalope\Node::removeMixin PHP Method

removeMixin() public method

{@inheritDoc}
public removeMixin ( $mixinName )
    public function removeMixin($mixinName)
    {
        $this->checkState();
        // check if node type is assigned
        if (!$this->hasProperty('jcr:mixinTypes')) {
            throw new NoSuchNodeTypeException("Node does not have type {$mixinName}");
        }
        $mixins = $this->getPropertyValue('jcr:mixinTypes');
        $key = array_search($mixinName, $mixins);
        if (false === $key) {
            throw new NoSuchNodeTypeException("Node does not have type {$mixinName}");
        }
        unset($mixins[$key]);
        $this->setProperty('jcr:mixinTypes', $mixins);
        // might be empty array which is fine
    }