Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!
NOTE: You can read more about Doctrine's Embeddables here: Types
To use the Doctrine's type, you have to follow those steps:
- Register the type in your Symfony's configuration;
- Implement the type in your entity.
Open the file /config/packages/doctrine.yaml
.
Add the type to the configuration:
doctrine:
dbal:
...
types:
uri: 'SerendipityHQ\Component\ValueObjects\Uri\Bridge\Doctrine\UriType'
...
Implement the uri type in your entity:
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use SerendipityHQ\Component\ValueObjects\Uri\UriInterface;
/**
* @ORM\Entity()
*/
class User
{
...
/**
* @var UriInterface
* @ORM\Column(type="uri")
*/
private $website;
...
}
Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks
to say thank you to all libraries you use in your current project, this included!