Jackalope\NodeType\ItemDefinition::fromArray PHP Method

fromArray() protected method

Overwritten for property and node to add more information, with a call to this parent method for the common things.
protected fromArray ( array $data )
$data array An array with the fields required by ItemDefinition
    protected function fromArray(array $data)
    {
        $this->declaringNodeType = $data['declaringNodeType'];
        $this->name = $data['name'];
        $this->isAutoCreated = $data['isAutoCreated'];
        $this->isMandatory = $data['isMandatory'];
        $this->isProtected = $data['isProtected'];
        $this->onParentVersion = $data['onParentVersion'];
    }

Usage Example

Example #1
0
 /**
  * Treat more information in addition to ItemDefinition::fromArray()
  *
  * See class documentation for the fields supported in the array.
  *
  * @param array $data The node definition in array form.
  */
 protected function fromArray(array $data)
 {
     parent::fromArray($data);
     $this->allowsSameNameSiblings = $data['allowsSameNameSiblings'];
     $this->defaultPrimaryTypeName = isset($data['defaultPrimaryTypeName']) ? $data['defaultPrimaryTypeName'] : null;
     $this->requiredPrimaryTypeNames = isset($data['requiredPrimaryTypeNames']) && count($data['requiredPrimaryTypeNames']) ? $data['requiredPrimaryTypeNames'] : array(self::DEFAULT_PRIMARY_NODE);
 }
All Usage Examples Of Jackalope\NodeType\ItemDefinition::fromArray