for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* components
*
* @author Wolfy-J
*/
namespace Spiral\ORM\Commands;
use Spiral\ORM\CommandInterface;
* Command to handle multiple inner commands.
class TransactionalCommand extends AbstractCommand implements \IteratorAggregate
{
* Nested commands.
* @var CommandInterface[]
private $commands = [];
* {@inheritdoc}
public function addCommand(CommandInterface $command)
if ($command instanceof NullCommand) {
return;
}
$this->commands[] = $command;
public function getIterator()
foreach ($this->commands as $command) {
if ($command instanceof \Traversable) {
yield from $command;
yield $command;
public function execute()
//nothing to do (see getCommands())
public function complete()
public function rollBack()