Jackalope\NodeType\NodeTypeManager::createNodeTypeTemplate PHP Method

createNodeTypeTemplate() public method

{@inheritDoc}
public createNodeTypeTemplate ( $ntd = null )
    public function createNodeTypeTemplate($ntd = null)
    {
        return $this->factory->get('NodeType\\NodeTypeTemplate', array($this, $ntd));
    }

Usage Example

 /**
  * @covers Jackalope\NodeTYpe\NodeTypeTemplate::getPropertyDefinitionTemplates
  */
 public function testEmptyPropertyDefinitionTemplatesMutable()
 {
     $nt = $this->ntm->createNodeTypeTemplate();
     $property = $this->ntm->createPropertyDefinitionTemplate();
     $property->setName('test:propdef');
     $this->assertNull($nt->getDeclaredPropertyDefinitions());
     $properties = $nt->getPropertyDefinitionTemplates();
     $this->assertInstanceOf('ArrayObject', $properties);
     $properties[] = $property;
     $propertiesAgain = $nt->getPropertyDefinitionTemplates();
     $this->assertInstanceOf('ArrayObject', $propertiesAgain);
     $this->assertCount(1, $propertiesAgain);
     $propertiesArray = $propertiesAgain->getArrayCopy();
     $this->assertSame($property, reset($propertiesArray));
     $this->assertEquals('test:propdef', reset($propertiesArray)->getName());
 }