public function __construct(FactoryInterface $factory, NodeTypeManager $nodeTypeManager, $nodetype = null)
{
$this->factory = $factory;
$this->valueConverter = $this->factory->get('PHPCR\\Util\\ValueConverter');
$this->nodeTypeManager = $nodeTypeManager;
if ($nodetype instanceof DOMElement) {
$this->fromXml($nodetype);
} elseif (is_array($nodetype)) {
$this->fromArray($nodetype);
} elseif ($nodetype instanceof NodeTypeDefinitionInterface) {
$this->fromNodeTypeDefinition($nodetype);
// copy constructor
} elseif (!is_null($nodetype)) {
throw new InvalidArgumentException('Implementation Error -- unknown nodetype class: ' . get_class($nodetype));
}
}