<?php

namespace App\Entities\Cloudflare;

use App\Models\Cloudflare\RecordModel;
use App\Entities\CommonEntity;

class RecordEntity extends CommonEntity
{
    public function __toString()
    {
        return "{$this->getPK()}|{$this->getParent()}|{$this->getTitle()}|{$this->attributes['host']}|{$this->attributes['content']}|{$this->attributes['proxied']}|{$this->attributes['fixed']}|{$this->attributes['locked']}";
    }
    public function getPK(): string
    {
        return $this->attributes[RecordModel::PK];
    }
    public function getTitle(): string
    {
        return $this->attributes[RecordModel::TITLE];
    }
    public function setTitle(string $title): void
    {
        $this->attributes[RecordModel::TITLE] = $title;
    }
    //Common Function
    public function getParent(): string
    {
        return $this->attributes[RecordModel::PARENT];
    }
}
