bnder/bnder

Create entities on the fly.

dev-master 2020-09-02 18:20 UTC

This package is auto-updated.

Last update: 2024-04-29 04:20:08 UTC


README

Build Status

🤖 Bnder

Bnder is inspired by the Laravel factories, it is meant to be a quick and clean way to create and persist and your Doctrine entities. It relies heavily on reflection class providing a fluent api.

Installation

composer require bnder/bnder

Example

$properties = [
    'user' => new User(),
    'email' => 'sample@mail.local',
];

Bnder::registerFactory(Factory::create(SampleEntity::class, $properties));

// This will create an array of 3 
$entities = Bnder::load(SampleEntity::class)->create(['email' => 'demo@mail.local'], 3);