webchemistry / doctrine-extras
Installs: 1 032
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >= 8.1
- doctrine/orm: ^2.14
- nette/utils: ^3.2 || ^4.0
Requires (Dev)
- nette/tester: ^2.4
- phpstan/phpstan: ^1.9
This package is auto-updated.
Last update: 2024-11-02 13:40:24 UTC
README
$factory = new BulkFactory($em); // insert $bulk = $factory->createInsert(Entity::class, ['id', 'firstName']); $bulk->setReplace(true); // REPLACE INTO ... $bulk->setSkipConflicts(true); // INSERT IGNORE ... $bulk->setUpsert(true); // INSERT INTO ... ON DUPLICATE KEY UPDATE $bulk->addValues([ 'id' => 1, 'firstName' => 'Jane', ]); $bulk->execute(); // update $bulk = $factory->createUpdate(Entity::class, ['firstName'], ['id']); // updates only firstName, field id is in where clause $bulk->addValues([ 'id' => 1, 'firstName' => 'Jane', ]); $bulk->execute();