nalgoo / doctrine-custom-schema
Custom annotations for extending schema generation of Doctrine's SchemaTool
Installs: 64
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/nalgoo/doctrine-custom-schema
Requires
- php: >=8.0
- doctrine/migrations: ~3.4
- doctrine/orm: ~2
Requires (Dev)
- ext-dom: *
- ext-json: *
- phpunit/phpunit: ~9.5
- roave/security-advisories: dev-latest
- symfony/cache: ~6.0
- webmozart/assert: ^1.11
README
This package allows you to define custom schema on top of your ORM model. For instance, creating foreign keys without the need of JoinColumn
.
Install via Composer
composer require nalgoo/doctrine-custom-schema
Usage
$entityManager = EntityManager::create(...);
CustomSchemaListener::register($entityManager);
Annotations
ForeignKey
class Entity
{
/**
* @ORM\Column(name="user_id", type="integer", nullable=false)
* @ForeignKey(refTable="user", refColumn="id", onUpdate="CASCADE", onDelete="CASCADE")
*/
public int $userId;
}