cfmgrv4 init...3
This commit is contained in:
parent
ed55aad2fd
commit
e91eb63cef
@ -143,17 +143,10 @@ class RecordController extends CloudflareController
|
||||
if ($this->entity === null) {
|
||||
throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
|
||||
}
|
||||
//fixed 필드가 있고 값이 변경되었을때(toggle에서 fixed만 설정시사용)
|
||||
if (in_array('fixed', $this->fields)) {
|
||||
if (isset($this->formDatas['fixed']) && $this->formDatas['fixed'] !== $this->entity->fixed) {
|
||||
$this->entity = $this->getModel()->modify($this->entity, $this->formDatas);
|
||||
}
|
||||
} else {
|
||||
//부모데이터정의
|
||||
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
||||
//Socket처리
|
||||
$this->entity = $this->getService()->modify($this->_zone_entity, $this->entity, $this->formDatas);
|
||||
}
|
||||
//부모데이터정의
|
||||
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
||||
//Socket처리
|
||||
$this->entity = $this->getService()->modify($this->_zone_entity, $this->entity, $this->formDatas);
|
||||
}
|
||||
//단일필드작업
|
||||
public function toggle(mixed $uid, string $field): RedirectResponse
|
||||
|
||||
@ -88,6 +88,14 @@ class RecordService extends CloudflareService
|
||||
}
|
||||
public function modify(ZoneEntity $parent_entity, RecordEntity $entity, array $formDatas): RecordEntity
|
||||
{
|
||||
//fixed 필드가 있고 값이 변경되었을때(toggle에서 fixed만 설정시사용)
|
||||
if (in_array('fixed', array_keys($formDatas))) {
|
||||
if ($formDatas['fixed'] !== $entity->fixed) {
|
||||
$entity = $this->getModel()->modify($entity, $formDatas);
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
|
||||
//부모데이터정의
|
||||
$this->setParentEntity($parent_entity);
|
||||
//TTL값은 CDN(proxied)가 사용함일때는 무조건 1, 않함일때는 120이 적용
|
||||
|
||||
Loading…
Reference in New Issue
Block a user