added multi-select for customer, project and activity (#1557)

This commit is contained in:
Kevin Papst
2020-03-16 14:06:26 +01:00
committed by GitHub
parent 6eeb01ad48
commit 4b1cfa5840
74 changed files with 1262 additions and 754 deletions

View File

@@ -21,9 +21,9 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
public const PROJECT_ORDER_ALLOWED = ['id', 'name', 'comment', 'customer', 'orderNumber', 'projectStart', 'projectEnd'];
/**
* @var Customer|int|null
* @var array
*/
private $customer;
private $customers = [];
/**
* @var \DateTime
*/
@@ -42,23 +42,61 @@ class ProjectQuery extends BaseQuery implements VisibilityInterface
/**
* @return Customer|int|null
* @deprecated since 1.9 - use getCustomers() instead - will be removed with 2.0
*/
public function getCustomer()
{
return $this->customer;
if (count($this->customers) > 0) {
return $this->customers[0];
}
return null;
}
/**
* @param Customer|int|null $customer
* @return $this
* @deprecated since 1.9 - use setCustomers() or addCustomer() instead - will be removed with 2.0
*/
public function setCustomer($customer = null)
{
$this->customer = $customer;
if (null === $customer) {
$this->customers = [];
} else {
$this->customers = [$customer];
}
return $this;
}
/**
* @param Customer|int $customer
* @return $this
*/
public function addCustomer($customer)
{
$this->customers[] = $customer;
return $this;
}
public function setCustomers(array $customers): self
{
$this->customers = $customers;
return $this;
}
public function getCustomers(): array
{
return $this->customers;
}
public function hasCustomers(): bool
{
return !empty($this->customers);
}
public function getProjectStart(): ?\DateTime
{
return $this->projectStart;