/** * @return PromiseInterface */ public function create() { do { $signature = $this->createSignature(); } while ($this->connection->count(self::PROMISES_TABLE_NAME, ['`signature` = ?', $signature])); $this->connection->execute('INSERT INTO ' . self::PROMISES_TABLE_NAME . ' (signature, created_at) VALUES (?, ?)', $signature, (new Carbon())->format('Y-m-d H:i:s')); if ($this->log) { $this->log->info('Promise {promise_id} created', ['promise_id' => $signature]); } return new Promise($signature); }
/** * {@inheritdoc} */ public function isExecuted(MigrationInterface $migration) { return (bool) $this->connection->count($this->getTableName(), ['`migration` = ?', get_class($migration)]); }
/** * {@inheritdoc} */ public function countBatches() { return $this->connection->count(self::BATCHES_TABLE_NAME); }