option to move entries from one entity to another upon deletion (#409)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user