orders = new ArrayCollection(); } public function __toString() { return $this->getLastAccess()->format('d-m-y h:i') . '( visites :' . $this->totalVisit . ')'; } public function getSummary() { return 'Visiteur non inscrit ( visites :' . $this->totalVisit . ')'; } public function getCookie(): ?string { return $this->cookie; } public function setCookie(?string $cookie): self { $this->cookie = $cookie; return $this; } public function getLastAccess(): ?\DateTimeInterface { return $this->lastAccess; } public function setLastAccess(\DateTimeInterface $lastAccess): self { $this->lastAccess = $lastAccess; return $this; } public function getIp(): ?string { return $this->ip; } public function setIp(?string $ip): self { $this->ip = $ip; return $this; } public function getTotalVisit(): ?int { return $this->totalVisit; } public function setTotalVisit(int $totalVisit): self { $this->totalVisit = $totalVisit; return $this; } /** * @return Collection|OrderShopInterface[] */ public function getOrders(): Collection { return $this->orders; } public function addOrder(OrderShopInterface $order): self { if (!$this->orders->contains($order)) { $this->orders[] = $order; $order->setVisitor($this); } return $this; } public function removeOrder(OrderShopInterface $order): self { if ($this->orders->contains($order)) { $this->orders->removeElement($order); // set the owning side to null (unless already changed) if ($order->getVisitor() === $this) { $order->setVisitor(null); } } return $this; } }