Bravo3\Orm\Services\EntityManager::flush PHP Method

flush() public method

Execute the current unit of work
public flush ( )
    public function flush()
    {
        $this->driver->flush();
        return $this->getProxy();
    }

Usage Example

Esempio n. 1
0
 /**
  * Re-persist an array of records
  *
  * @param object[] $records
  * @param Entity   $metadata
  * @param int      $batch_size
  */
 private function rebuildRecords($records, Entity $metadata, $batch_size)
 {
     $count = 0;
     /** @var OrmProxyInterface $record */
     foreach ($records as $record) {
         $this->entity_manager->persist($record);
         if (++$count == $batch_size) {
             $this->entity_manager->flush();
             $count = 0;
         }
     }
     if ($count) {
         $this->entity_manager->flush();
     }
 }
All Usage Examples Of Bravo3\Orm\Services\EntityManager::flush