<?php
namespace App\Model\ViewOrder;
use App\Model\Traits\ImportableObjectTrait;
use App\Model\ViewOrderInfo\ViewOrderInfo;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
class ViewOrder
{
const VIEWORDER_PROSPECT = 'Prospect';
const VIEWORDER_QUOTE = 'Quote';
const VIEWORDER_TASK = 'Task';
const VIEWORDER_CONTACT = 'Contact';
const VIEWORDER_MAILTYPE = 'MailType';
const VIEWORDER_UNIT_MAILING = 'unitMail';
const VIEWORDER_PRODUCT = 'Product';
const VIEWORDER_TYPE_FORM = 'form';
const VIEWORDER_TYPE_SEARCH = 'search';
const VIEWORDER_LIST = 'list';
use ImportableObjectTrait;
/**
* @var string|null
* @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:update"})
*/
private $id;
/**
* @var string|null
* @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
*/
private $entity;
/**
* @var string|null
* @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
*/
private $customerId;
/**
* @var string|null
* @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
*/
private $userId;
/**
* @var ViewOrderInfo[]|Collection
* @MaxDepth(5)
* @Groups({"list_view_order", "show_view_order", "new_view_order", "ViewOrder:create"})
*/
private $viewOrderInfos;
/**
* ViewOrderInfo constructor.
*/
public function __construct()
{
$this->viewOrderInfos = new ArrayCollection();
}
/**
* @return string|null
*/
public function getId(): ?string
{
return $this->id;
}
/**
* @param string|null $id
*
* @return ViewOrder
*/
public function setId(?string $id): ViewOrder
{
$this->id = $id;
return $this;
}
/**
* @return string|null
*/
public function getEntity(): ?string
{
return $this->entity;
}
/**
* @param string|null $entity
*
* @return ViewOrder
*/
public function setEntity(?string $entity): ViewOrder
{
$this->entity = $entity;
return $this;
}
/**
* @return string|null
*/
public function getCustomerId(): ?string
{
return $this->customerId;
}
/**
* @param string|null $customerId
*
* @return ViewOrder
*/
public function setCustomerId(?string $customerId): ViewOrder
{
$this->customerId = $customerId;
return $this;
}
/**
* @return ViewOrderInfo[]|Collection
*/
public function getViewOrderInfos(): ?Collection
{
return $this->viewOrderInfos;
}
/**
* Add a children viewOrderInfo object.
*
* @param ViewOrderInfo $children
*/
public function addViewOrderInfo(ViewOrderInfo $children)
{
if (!$this->getViewOrderInfos()->contains($children)) {
$children->setViewOrder($this);
$this->getViewOrderInfos()->add($children);
}
}
/**
* Add a children viewOrderInfo object without setting the link.
*
* @param ViewOrderInfo $children
*/
public function addViewOrderInfoWithoutLink(ViewOrderInfo $children)
{
if (!$this->getViewOrderInfos()->contains($children)) {
$this->getViewOrderInfos()->add($children);
}
}
/**
* Remove a children viewOrderInfo object.
*
* @param ViewOrderInfo $children
*/
public function removeViewOrderInfo(ViewOrderInfo $children)
{
if ($this->getViewOrderInfos()->contains($children)) {
$children->setViewOrder(null);
$this->getViewOrderInfos()->removeElement($children);
}
}
/**
* @return string|null
*/
public function getUserId(): ?string
{
return $this->userId;
}
/**
* @param string|null $userId
*
* @return ViewOrder
*/
public function setUserId(?string $userId): ViewOrder
{
$this->userId = $userId;
return $this;
}
}