Jackalope\NodeType\NodeTypeManager::createPropertyDefinitionTemplate PHP Method

createPropertyDefinitionTemplate() public method

{@inheritDoc}
    public function createPropertyDefinitionTemplate()
    {
        return $this->factory->get('NodeType\\PropertyDefinitionTemplate', array($this));
    }

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());
 }