stringToObjectType function

ObjectTypes stringToObjectType(
  1. String type
)

Returns the object type of the given object type string.

Implementation

ObjectTypes stringToObjectType(String type) {
  switch (type) {
    case 'error':
      return ObjectTypes.Error;
    case 'database':
      return ObjectTypes.Database;
    case 'list':
      return ObjectTypes.List;
    case 'page':
      return ObjectTypes.Page;
    case 'object':
      return ObjectTypes.Object;
    case 'block':
      return ObjectTypes.Block;
    case '':
    default:
      return ObjectTypes.None;
  }
}