phpdevcommunity / paper-orm-bundle
PaperORMBundle is a Symfony bundle that integrates PaperORM, a lightweight and performant PHP ORM.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.4
- ext-pdo: *
- monolog/monolog: ^2.10|^3.0
- phpdevcommunity/paper-orm: ^1.0.0@alpha
- symfony/config: ^5.4 || ^6.0 || ^7.0
- symfony/console: ^5.4 || ^6.0 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0
- symfony/http-kernel: ^5.4 || ^6.0 || ^7.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.6|^10.5
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0
This package is auto-updated.
Last update: 2025-10-01 16:02:22 UTC
README
PaperORMBundle is a Symfony bundle that integrates PaperORM, a lightweight and performant PHP ORM.
PaperORM itself is framework-agnostic.
This bundle provides seamless integration into Symfony: configuration via config/packages/
, service wiring, and logger support.
🚀 Installation
composer require phpdevcommunity/paper-orm-bundle:1.0.0-alpha
This will install both the bundle and the core PaperORM.
Then, enable the bundle (if Flex does not do it automatically):
// config/bundles.php return [ // ... PhpDevCommunity\PaperORMBundle\PaperORMBundle::class => ['all' => true], ];
⚙️ Configuration
Add your configuration in config/packages/paper_orm.yaml
:
paper_orm: dsn: '%env(resolve:DATABASE_URL)%' debug: '%kernel.debug%' logger: 'paper.logger' entity_dir: '%kernel.project_dir%/src/Entity' migrations_dir: '%kernel.project_dir%/migrations' migrations_table: 'mig_versions'
Options
Key | Type | Default | Description |
---|---|---|---|
dsn |
string | (required) | Database DSN |
debug |
bool | false |
Enable verbose debugging |
logger |
string | null |
Service ID of a logger (ex: paper.logger ) |
entity_dir |
string | %kernel.project_dir%/src/Entity |
Path to your entities |
migrations_dir |
string | %kernel.project_dir%/migrations |
Path to migration files |
migrations_table |
string | mig_versions |
Table name used for migration tracking |
🛠️ Services
After configuration, the following services are available in the container:
PhpDevCommunity\PaperORM\EntityManagerInterface
PhpDevCommunity\PaperORM\EntityManager
You can inject them directly:
use PhpDevCommunity\PaperORM\EntityManagerInterface; final class UserService { public function __construct(private EntityManagerInterface $em) {} public function createUser(string $name, string $email): void { $user = new User(); $user->setName($name)->setEmail($email); $this->em->persist($user); $this->em->flush(); } }
📖 Documentation
Full ORM usage, entity mapping, and repositories are documented in the main PaperORM repository:
📌 Status
This bundle is in alpha (1.0.0-alpha). We welcome early feedback, bug reports, and contributions.