acfViewData = $acfViewData->getDeepClone(); $this->acfCardData = $acfCardData->getDeepClone(); $this->posts = []; } public function getAcfViewData(int $viewId): AcfViewData { if (key_exists($viewId, $this->posts)) { return $this->posts[$viewId]; } $acfViewData = $this->acfViewData->getDeepClone(); $acfViewData->loadFromPostContent($viewId); $this->posts[$viewId] = $acfViewData; return $acfViewData; } public function getAcfCardData(int $cardId): AcfCardData { if (key_exists($cardId, $this->posts)) { return $this->posts[$cardId]; } $acfCardData = $this->acfCardData->getDeepClone(); $acfCardData->loadFromPostContent($cardId); $this->posts[$cardId] = $acfCardData; return $acfCardData; } }