Dumplie\Metadata\Infrastructure\Doctrine\Dbal\DoctrineStorageException::unableToMapType PHP Method

unableToMapType() public static method

public static unableToMapType ( Type $type ) : DoctrineStorageException
$type Dumplie\Metadata\Schema\Type
return DoctrineStorageException
    public static function unableToMapType(Type $type) : DoctrineStorageException
    {
        return new static(sprintf('Unable to map type schema "%s" to doctrine field type', (string) $type));
    }

Usage Example

Example #1
0
 /**
  * @param string          $schema
  * @param Table           $table
  * @param string          $name
  * @param FieldDefinition $definition
  *
  * @throws DoctrineStorageException
  */
 public function map(string $schema, Table $table, string $name, FieldDefinition $definition)
 {
     foreach ($this->mapping as $mapping) {
         if ($mapping->maps($definition->type())) {
             $mapping->map($schema, $table, $name, $definition);
             return;
         }
     }
     throw DoctrineStorageException::unableToMapType($definition->type());
 }