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
}