public function convertTypeDefinitionDataProvider()
 {
     $folderTypeDefinition = new FolderTypeDefinition('cmis:folder');
     $folderTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_FOLDER));
     $typeMutability = new TypeMutability();
     $typeMutability->setCanCreate(true);
     $typeMutability->setCanUpdate(true);
     $typeMutability->setCanDelete(true);
     $documentTypeDefinition = new DocumentTypeDefinition('cmis:document');
     $documentTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_DOCUMENT));
     $documentTypeDefinition->setContentStreamAllowed(ContentStreamAllowed::cast(ContentStreamAllowed::ALLOWED));
     $documentTypeDefinition->setDescription('description');
     $documentTypeDefinition->setDisplayName('displayName');
     $documentTypeDefinition->setIsControllableACL(true);
     $documentTypeDefinition->setIsVersionable(true);
     $documentTypeDefinition->setIsControllablePolicy(true);
     $documentTypeDefinition->setIsCreatable(true);
     $documentTypeDefinition->setIsFileable(true);
     $documentTypeDefinition->setIsFulltextIndexed(true);
     $documentTypeDefinition->setIsIncludedInSupertypeQuery(true);
     $documentTypeDefinition->setIsQueryable(true);
     $documentTypeDefinition->setLocalName('localName');
     $documentTypeDefinition->setLocalNamespace('localNamespace');
     $documentTypeDefinition->setParentTypeId('parentTypeId');
     $documentTypeDefinition->setQueryName('queryName');
     $documentTypeDefinition->setTypeMutability($typeMutability);
     $relationshipTypeDefinition = new RelationshipTypeDefinition('cmis:relationship');
     $relationshipTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_RELATIONSHIP));
     $relationshipTypeDefinition->setAllowedSourceTypeIds(array('foo'));
     $relationshipTypeDefinition->setAllowedTargetTypeIds(array('bar'));
     $policyTypeDefinition = new PolicyTypeDefinition('cmis:policy');
     $policyTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_POLICY));
     $itemTypeDefinition = new ItemTypeDefinition('cmis:item');
     $itemTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_ITEM));
     $secondaryTypeDefinition = new SecondaryTypeDefinition('cmis:secondary');
     $secondaryTypeDefinition->setBaseTypeId(BaseTypeId::cast(BaseTypeId::CMIS_SECONDARY));
     return array('Folder type definition' => array($folderTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:folder', JSONConstants::JSON_TYPE_BASE_ID => BaseTypeId::CMIS_FOLDER)), 'Document type definition' => array($documentTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:document', JSONConstants::JSON_TYPE_BASE_ID => BaseTypeId::CMIS_DOCUMENT, JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED => ContentStreamAllowed::ALLOWED, JSONConstants::JSON_TYPE_DESCRIPTION => 'description', JSONConstants::JSON_TYPE_DISPLAYNAME => 'displayName', JSONConstants::JSON_TYPE_LOCALNAME => 'localName', JSONConstants::JSON_TYPE_LOCALNAMESPACE => 'localNamespace', JSONConstants::JSON_TYPE_PARENT_ID => 'parentTypeId', JSONConstants::JSON_TYPE_QUERYNAME => 'queryName', JSONConstants::JSON_TYPE_CONTROLABLE_ACL => true, JSONConstants::JSON_TYPE_VERSIONABLE => true, JSONConstants::JSON_TYPE_CONTROLABLE_POLICY => true, JSONConstants::JSON_TYPE_CREATABLE => true, JSONConstants::JSON_TYPE_FILEABLE => true, JSONConstants::JSON_TYPE_FULLTEXT_INDEXED => true, JSONConstants::JSON_TYPE_INCLUDE_IN_SUPERTYPE_QUERY => true, JSONConstants::JSON_TYPE_QUERYABLE => true, JSONConstants::JSON_TYPE_TYPE_MUTABILITY => array(JSONConstants::JSON_TYPE_TYPE_MUTABILITY_UPDATE => true, JSONConstants::JSON_TYPE_TYPE_MUTABILITY_CREATE => true, JSONConstants::JSON_TYPE_TYPE_MUTABILITY_DELETE => true), JSONConstants::JSON_TYPE_PROPERTY_DEFINITIONS => array(array()))), 'Relationship type definition' => array($relationshipTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:relationship', JSONConstants::JSON_TYPE_BASE_ID => 'cmis:relationship', JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES => array('foo', false, null, ''), JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES => array('bar', false, null, ''))), 'Policy type definition' => array($policyTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:policy', JSONConstants::JSON_TYPE_BASE_ID => 'cmis:policy')), 'Item type definition' => array($itemTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:item', JSONConstants::JSON_TYPE_BASE_ID => 'cmis:item')), 'Secondary type definition' => array($secondaryTypeDefinition, array(JSONConstants::JSON_TYPE_ID => 'cmis:secondary', JSONConstants::JSON_TYPE_BASE_ID => 'cmis:secondary')));
 }
 /**
  * Convert an array to a type mutability object
  *
  * @param array|null $data The data that should be populated to the object
  * @return TypeMutability|null Returns the type mutability object or <code>null</code> if empty array is given
  */
 public function convertTypeMutability(array $data = null)
 {
     if (empty($data)) {
         return null;
     }
     $typeMutability = new TypeMutability();
     $typeMutability->populate($data, array_combine(JSONConstants::getTypeTypeMutabilityKeys(), array_map(function ($key) {
         // add a prefix "can" to all keys as this are the property names
         return 'can' . ucfirst($key);
     }, JSONConstants::getTypeTypeMutabilityKeys())), true);
     $typeMutability->setExtensions($this->convertExtension($data, JSONConstants::getTypeTypeMutabilityKeys()));
     return $typeMutability;
 }