original_string: public function convertCreatablePropertyTypes(array $data = null)
      {
          if (empty($data)) {
              return null;
          }
  
          $object = new CreatablePropertyTypes();
          $canCreate = [];
          foreach ($data[JSONConstants::JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE] ?? [] as $canCreateItem) {
              try {
                  $canCreate[] = PropertyType::cast($canCreateItem);
              } catch (InvalidEnumerationValueException $exception) {
                  // ignore invalid types
              }
          }
  
          $object->setCanCreate($canCreate);
  
          $object->setExtensions(
              $this->convertExtension(
                  $data,
                  JSONConstants::getCapabilityCreatablePropertyKeys()
              )
          );
  
          return $object;
      }
code: public function convertCreatablePropertyTypes(array $data = null)
      {
          if (empty($data)) {
              return null;
          }
  
          $object = new CreatablePropertyTypes();
          $canCreate = [];
          foreach ($data[JSONConstants::JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE] ?? [] as $canCreateItem) {
              try {
                  $canCreate[] = PropertyType::cast($canCreateItem);
              } catch (InvalidEnumerationValueException $exception) {
                  // ignore invalid types
              }
          }
  
          $object->setCanCreate($canCreate);
  
          $object->setExtensions(
              $this->convertExtension(
                  $data,
                  JSONConstants::getCapabilityCreatablePropertyKeys()
              )
          );
  
          return $object;
      }
code_tokens: public function convertCreatablePropertyTypes ( array $ data = null ) { if ( empty ( $ data ) ) { return null ; } $ object = new CreatablePropertyTypes ( ) ; $ canCreate = [ ] ; foreach ( $ data [ JSONConstants :: JSON_CAP_CREATABLE_PROPERTY_TYPES_CANCREATE ] ?? [ ] as $ canCreateItem ) { try { $ canCreate [ ] = PropertyType :: cast ( $ canCreateItem ) ; } catch ( InvalidEnumerationValueException $ exception ) { // ignore invalid types } } $ object -> setCanCreate ( $ canCreate ) ; $ object -> setExtensions ( $ this -> convertExtension ( $ data , JSONConstants :: getCapabilityCreatablePropertyKeys ( ) ) ) ; return $ object ; }
docstring: Create CreatablePropertyTypes object and populate given data to it
  
  @param array|null $data The data that should be populated to the CreatablePropertyTypes object
  @return CreatablePropertyTypes|null Returns a CreatablePropertyTypes object or <code>null</code> if empty data
  is given.
docstring_tokens: Create CreatablePropertyTypes object and populate given data to it