- Add SendSmsMessage class for encapsulating SMS message data. - Create KavehNegarProvider and RanginehProvider classes implementing SmsProviderInterface for sending SMS. - Implement SmsLogRepository and SmsTemplateRepository for managing SMS logs and templates. - Develop SendSmsHandler for handling SMS sending messages. - Create SmsService to manage SMS dispatching and logging. - Add UserProfileController for managing user profiles with CRUD operations. - Implement UserProfile entity and repository for user profile data management. - Update symfony.lock and bootstrap.php for project dependencies and environment setup.
86 lines
3.1 KiB
PHP
86 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace App\Doctor\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Uid\Uuid;
|
|
|
|
#[ORM\Entity]
|
|
#[ORM\Table(name: 'doctor_addresses')]
|
|
#[ORM\Index(columns: ['doctor_id'], name: 'idx_doctor_addresses_doctor')]
|
|
class DoctorAddress
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column(type: 'integer')]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(type: 'string', length: 36, unique: true)]
|
|
private string $uuid;
|
|
|
|
#[ORM\ManyToOne(targetEntity: Doctor::class, inversedBy: 'addresses')]
|
|
#[ORM\JoinColumn(name: 'doctor_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
|
|
private Doctor $doctor;
|
|
|
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
|
private ?string $name = null;
|
|
|
|
#[ORM\Column(type: 'text', nullable: true)]
|
|
private ?string $address = null;
|
|
|
|
#[ORM\Column(type: 'string', length: 50, nullable: true)]
|
|
private ?string $telephone = null;
|
|
|
|
#[ORM\Column(type: 'float', nullable: true)]
|
|
private ?float $latitude = null;
|
|
|
|
#[ORM\Column(type: 'float', nullable: true)]
|
|
private ?float $longitude = null;
|
|
|
|
#[ORM\Column(name: 'created_at', type: 'integer')]
|
|
private int $createdAt;
|
|
|
|
#[ORM\Column(name: 'updated_at', type: 'integer')]
|
|
private int $updatedAt;
|
|
|
|
public function __construct(Doctor $doctor)
|
|
{
|
|
$this->uuid = Uuid::v4()->toRfc4122();
|
|
$this->doctor = $doctor;
|
|
$this->createdAt = time();
|
|
$this->updatedAt = time();
|
|
}
|
|
|
|
public function getId(): ?int { return $this->id; }
|
|
public function getUuid(): string { return $this->uuid; }
|
|
public function getDoctor(): Doctor { return $this->doctor; }
|
|
public function getName(): ?string { return $this->name; }
|
|
public function getAddress(): ?string { return $this->address; }
|
|
public function getTelephone(): ?string { return $this->telephone; }
|
|
public function getLatitude(): ?float { return $this->latitude; }
|
|
public function getLongitude(): ?float { return $this->longitude; }
|
|
|
|
public function setName(?string $v): self { $this->name = $v; return $this; }
|
|
public function setAddress(?string $v): self { $this->address = $v; $this->touch(); return $this; }
|
|
public function setTelephone(?string $v): self { $this->telephone = $v; $this->touch(); return $this; }
|
|
public function setLatitude(?float $v): self { $this->latitude = $v; $this->touch(); return $this; }
|
|
public function setLongitude(?float $v): self { $this->longitude = $v; $this->touch(); return $this; }
|
|
|
|
private function touch(): void { $this->updatedAt = time(); }
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'id' => (string) $this->id,
|
|
'uuid' => $this->uuid,
|
|
'name' => $this->name,
|
|
'map' => [
|
|
'latitude' => $this->latitude !== null ? (string) $this->latitude : null,
|
|
'longitude' => $this->longitude !== null ? (string) $this->longitude : null,
|
|
],
|
|
'address' => $this->address,
|
|
'telephone' => $this->telephone,
|
|
];
|
|
}
|
|
}
|