option to move entries from one entity to another upon deletion (#409)

This commit is contained in:
Kevin Papst
2018-11-12 00:01:49 +01:00
committed by GitHub
parent 1dabeedaa0
commit f9dc42d1f9
18 changed files with 524 additions and 23 deletions

View File

@@ -24,6 +24,10 @@ class CustomerFixtures extends Fixture
* @var int
*/
protected $amount = 0;
/**
* @var bool
*/
protected $isVisible = null;
/**
* @return int
@@ -44,6 +48,17 @@ class CustomerFixtures extends Fixture
return $this;
}
/**
* @param bool $visible
* @return $this
*/
public function setIsVisible(bool $visible)
{
$this->isVisible = $visible;
return $this;
}
/**
* {@inheritdoc}
*/
@@ -53,6 +68,9 @@ class CustomerFixtures extends Fixture
for ($i = 0; $i < $this->amount; $i++) {
$visible = 0 != $i % 3;
if (null !== $this->isVisible) {
$visible = $this->isVisible;
}
$entity = new Customer();
$entity
->setCurrency($faker->currencyCode)