fourhundredfour / doctrine-lombok
A Doctrine library to create getter/setter at runtime with annotations.
1.0.0
2020-10-07 17:33 UTC
Requires
- ext-runkit7: *
- doctrine/annotations: ^1.10
Requires (Dev)
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2025-06-23 08:03:45 UTC
README
A Doctrine library to create getter/setter at runtime with annotations.
Index
Requirements
- Doctrine
-
=PHP 7.4
Usage
// my_source/Entity/User.php <?php namespace Schischkin\DoctrineLombok\Entity; use Schischkin\DoctrineLombok\Annotations\Getter; use Schischkin\DoctrineLombok\Annotations\Setter; /** @Getter */ class User { /** @Setter */ private $username; private $password; }
// app.php ... $annotation = new Schischkin\DoctrineLombok\Annotation($reader); $classLoader = new Schischkin\DoctrineLombok\ClassLoader(); $classNames = $classLoader->loadClasses(__DIR__ . '/my_source'); foreach ($classNames as $className) { $annotation->parseClassByClassName($className); } $user = new User(); $user->setUsername('fourhundredfour'); echo $user->getUsername(); // Access to the private property