kayladnls / doctrine-additions
Additional Doctrine Types and helpers
Installs: 15 660
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 1
Forks: 2
pkg:composer/kayladnls/doctrine-additions
Requires
- php: >=5.5
Requires (Dev)
- doctrine/orm: ^2.5
- league/uri: ^4.1.1
- phpunit/phpunit: >=4.8
Suggests
- league/uri: For use with the UrlType
This package is not auto-updated.
Last update: 2025-10-02 00:23:26 UTC
README
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