option to move entries from one entity to another upon deletion (#409)
This commit is contained in:
@@ -9,9 +9,34 @@
|
||||
|
||||
namespace App\Repository\Query;
|
||||
|
||||
use App\Entity\Customer;
|
||||
|
||||
/**
|
||||
* Can be used for advanced queries with the: CustomerRepository
|
||||
*/
|
||||
class CustomerQuery extends VisibilityQuery
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $ignored = [];
|
||||
|
||||
/**
|
||||
* @param Customer|int $customer
|
||||
* @return $this
|
||||
*/
|
||||
public function addIgnoredEntity($customer)
|
||||
{
|
||||
$this->ignored[] = $customer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getIgnoredEntities()
|
||||
{
|
||||
return $this->ignored;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user