src/Entity/Common/Contact.php line 15
<?php
namespace App\Entity\Common;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use App\Model\Common\HaveOwnerInterface;
use App\Model\Common\OwnerInterface;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'contacts')]
#[ORM\Entity(repositoryClass: 'App\Repository\Common\ContactRepository')]
#[ORM\HasLifecycleCallbacks]
class Contact implements UserCreatedInterface, UserUpdatedInterface, HaveOwnerInterface
{
use TrackerFields;
public const TYPE_PHONE = 'phone';
public const TYPE_EMAIL = 'email';
public const TYPE_SITE = 'site';
// const TYPE_OTHER = 'other';
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: true)]
private $type;
/**
* @var string|null
*/
#[ORM\Column(type: 'string')]
private $caption;
/**
* @var string|null
*/
#[ORM\Column(type: 'string')]
private $value;
/**
* @var Owner
*/
#[ORM\Embedded(class: 'App\Entity\Common\Owner')]
private $owner;
public function __construct()
{
$this->owner = new Owner();
}
public static function getTypes()
{
return [self::TYPE_PHONE, self::TYPE_EMAIL, self::TYPE_SITE, /*self::TYPE_OTHER*/];
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param string|null $type
*/
public function setType(?string $type): void
{
$this->type = $type;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->caption;
}
/**
* @param string|null $caption
*/
public function setCaption(?string $caption): void
{
$this->caption = $caption;
}
/**
* @return string|null
*/
public function getValue(): ?string
{
return $this->value;
}
/**
* @param string|null $value
*/
public function setValue(?string $value): void
{
$this->value = $value;
}
/**
* @return Owner
*/
public function getOwner(): OwnerInterface
{
return $this->owner;
}
/**
* @param Owner $owner
*/
public function setOwner(Owner $owner): void
{
$this->owner = $owner;
}
}