Skip to content

greydnls/doctrine-additions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doctrine Additions

This library offers a custom UrlType for Doctrine 2, based on league/url.

For additional information on custom doctrine types see here.

Usage:

In your Bootstrap file:

use Doctrine\DBAL\Types\Type;

Type::addType('url', Kayladnls\DoctrineAdditions\Type\UrlType::class);

Register the type with your connection:

$conn = $em->getConnection();
$conn->getDatabasePlatform()->registerDoctrineTypeMapping('varchar', 'url');

Use The type in your entity:

class MyEntity
{
    /** @Column(type="url") */
    private $link;
}

Attributions

Inspired by beberlei/DoctrineExtensions