1. Go to this page and download the library: Download jimmeak/doctrine-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// src/Entity/SomeEntity.php
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Person {
# Creating autogenerated UUID v7
use \Jimmeak\DoctrineBundle\Trait\UuidV7
# Giving Person FirstName attribute, getter and setter.
use \Jimmeak\DoctrineBundle\Trait\FirstName;
# Giving Person LastName attribute, getter and setter.
use \Jimmeak\DoctrineBundle\Trait\LastName;
}
#[ORM\Entity]
class User {
# Creating autogenerated UUID v7
use \Jimmeak\DoctrineBundle\Trait\UuidV7
# Giving Entity User First name, Last name, getters and setters
# Giving Entity User one additional getter for Full name
# with optional reverse possibility
use \Jimmeak\DoctrineBundle\Trait\FullName;
}
// src/Resolver/MyOwnDoctrineNameResolver.php
namespace Resolver;
use Jimmeak\DoctrineBundle\Resolver\NameResolverInterface;
class MyOwnDoctrineNameResolver implements NameResolverInterface
{
public function name(string $namespace, string $prefix): string
{
// return your table name based on namespace and prefix
}
public function manyToManyName(string $sourceEntityNamespace, string $targetEntityNamespace, string $prefix): string
{
// return your table name for joining table (relation many to many)
// having source and target entity namespaces and prefix.
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.