<?php
namespace App\Entity;
use App\Entity\Enum\HearingAidFrequencyEnum;
use App\Entity\Enum\HearingAidTypeEnum;
use App\Entity\Enum\HearingAidScaleEnum;
use App\Entity\Enum\HearingAidHearingLossEnum;
use App\Repository\HearingAidRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=HearingAidRepository::class)
* @Vich\Uploadable
*/
class HearingAid
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text")
*/
private $description;
/**
* @ORM\Column(type="string", length=255)
*/
private $imagePath;
/**
* @assert\File( mimeTypes = {"image/jpeg", "image/png", "image/gif", "image/jpg"})
* @Vich\UploadableField(mapping="hearing_aid_images", fileNameProperty="imagePath")
* @var File
*/
private $imageFile;
/**
* @ORM\Column(type="boolean")
*/
private $rechargeable;
/**
* @ORM\Column(type="string")
*/
private $price;
/**
* @ORM\ManyToOne(targetEntity=HearingMaker::class, inversedBy="hearingAids")
* @ORM\JoinColumn(nullable=false)
*/
private $hearingMaker;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\Column(type="boolean")
*/
private $volumeControl;
/**
* @ORM\Column(type="boolean")
*/
private $pushButton;
/**
* @ORM\Column(type="boolean")
*/
private $tPosition;
/**
* @ORM\Column(type="boolean")
*/
private $bluetooth;
/**
* @ORM\Column(type="boolean")
*/
private $iphoneConnect;
/**
* @ORM\Column(type="boolean")
*/
private $remoteAdjustment;
/**
* @ORM\Column(type="boolean")
*/
private $smartphoneApp;
/**
* @ORM\Column(type="boolean")
*/
private $androidStreaming;
/**
* @ORM\Column(type="boolean")
*/
private $windReducer;
/**
* @ORM\Column(type="boolean")
*/
private $impulseNoiseReducer;
/**
* @ORM\Column(type="boolean")
*/
private $lowNoiseReducer;
/**
* @ORM\Column(type="boolean")
*/
private $echoReducer;
/**
* @ORM\Column(type="boolean")
*/
private $tinnitusMasker;
/**
* @ORM\Column(type="integer")
*/
private $frequency;
/**
* @ORM\Column(type="integer")
*/
private $type;
/**
* @ORM\Column(type="boolean")
*/
private $discretion;
/**
* @ORM\Column(type="smallint", nullable=true)
*/
private $scale;
/**
* @ORM\Column(type="smallint", nullable=true)
*/
private $hearingLoss;
public function __construct()
{
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getImagePath(): ?string
{
return $this->imagePath;
}
public function setImagePath(string $imagePath): self
{
$this->imagePath = $imagePath;
return $this;
}
public function hasImage()
{
return !is_null($this->imagePath);
}
public function setImageFile(File $image = null)
{
$this->imageFile = $image;
if ($image) {
$this->updatedAt = new \DateTime('now');
}
}
public function getImageFile()
{
return $this->imageFile;
}
public function getRechargeable(): ?bool
{
return $this->rechargeable;
}
public function setRechargeable(bool $rechargeable): self
{
$this->rechargeable = $rechargeable;
return $this;
}
public function getPrice(): ?int
{
return $this->price;
}
public function setPrice($price): self
{
$this->price = $price;
return $this;
}
public function getHearingMaker(): ?HearingMaker
{
return $this->hearingMaker;
}
public function setHearingMaker(?HearingMaker $hearingMaker): self
{
$this->hearingMaker = $hearingMaker;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getVolumeControl(): ?bool
{
return $this->volumeControl;
}
public function setVolumeControl(bool $volumeControl): self
{
$this->volumeControl = $volumeControl;
return $this;
}
public function getPushButton(): ?bool
{
return $this->pushButton;
}
public function setPushButton(bool $pushButton): self
{
$this->pushButton = $pushButton;
return $this;
}
public function getTPosition(): ?bool
{
return $this->tPosition;
}
public function setTPosition(bool $tPosition): self
{
$this->tPosition = $tPosition;
return $this;
}
public function getBluetooth(): ?bool
{
return $this->bluetooth;
}
public function setBluetooth(bool $bluetooth): self
{
$this->bluetooth = $bluetooth;
return $this;
}
public function getIphoneConnect(): ?bool
{
return $this->iphoneConnect;
}
public function setIphoneConnect(bool $iphoneConnect): self
{
$this->iphoneConnect = $iphoneConnect;
return $this;
}
public function getRemoteAdjustment(): ?bool
{
return $this->remoteAdjustment;
}
public function setRemoteAdjustment(bool $remoteAdjustment): self
{
$this->remoteAdjustment = $remoteAdjustment;
return $this;
}
public function getSmartphoneApp(): ?bool
{
return $this->smartphoneApp;
}
public function setSmartphoneApp(bool $smartphoneApp): self
{
$this->smartphoneApp = $smartphoneApp;
return $this;
}
public function getAndroidStreaming(): ?bool
{
return $this->androidStreaming;
}
public function setAndroidStreaming(bool $androidStreaming): self
{
$this->androidStreaming = $androidStreaming;
return $this;
}
public function getWindReducer(): ?bool
{
return $this->windReducer;
}
public function setWindReducer(bool $windReducer): self
{
$this->windReducer = $windReducer;
return $this;
}
public function getImpulseNoiseReducer(): ?bool
{
return $this->impulseNoiseReducer;
}
public function setImpulseNoiseReducer(bool $impulseNoiseReducer): self
{
$this->impulseNoiseReducer = $impulseNoiseReducer;
return $this;
}
public function getLowNoiseReducer(): ?bool
{
return $this->lowNoiseReducer;
}
public function setLowNoiseReducer(bool $lowNoiseReducer): self
{
$this->lowNoiseReducer = $lowNoiseReducer;
return $this;
}
public function getEchoReducer(): ?bool
{
return $this->echoReducer;
}
public function setEchoReducer(bool $echoReducer): self
{
$this->echoReducer = $echoReducer;
return $this;
}
public function getTinnitusMasker(): ?bool
{
return $this->tinnitusMasker;
}
public function setTinnitusMasker(bool $tinnitusMasker): self
{
$this->tinnitusMasker = $tinnitusMasker;
return $this;
}
public function getTypeName(): string
{
return HearingAidTypeEnum::getTypeName($this->getType());
}
public function getFrequencyName(){
return HearingAidFrequencyEnum::getFrequencyName($this->getFrequency());
}
public function getFrequency(): ?int
{
return $this->frequency;
}
public function setFrequency(int $frequency): self
{
$this->frequency = $frequency;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(int $type): self
{
$this->type = $type;
return $this;
}
public function getDiscretion(): ?bool
{
return $this->discretion;
}
public function setDiscretion(bool $discretion): self
{
$this->discretion = $discretion;
return $this;
}
public function __toString()
{
return $this->getName();
}
public function getScale(): ?int
{
return $this->scale;
}
public function setScale(?int $scale): self
{
$this->scale = $scale;
return $this;
}
public function getHearingLoss(): ?int
{
return $this->hearingLoss;
}
public function setHearingLoss(?int $hearingLoss): self
{
$this->hearingLoss = $hearingLoss;
return $this;
}
}