*/ class Portal extends Record implements Di\FileManagerAware, Di\DataManagerAware { use Di\FileManagerSetter; use Di\DataManagerSetter; protected $getEntityBeforeUpdate = true; protected $mandatorySelectAttributeList = [ 'customUrl', 'customId', ]; protected function afterUpdateEntity(Entity $entity, $data) { /** @var PortalEntity $entity */ $this->loadUrlField($entity); if (property_exists($data, 'portalRolesIds')) { $this->clearRolesCache(); } } protected function loadUrlField(PortalEntity $entity): void { $this->getPortalRepository()->loadUrlField($entity); } protected function clearRolesCache(): void { $this->fileManager->removeInDir('data/cache/application/aclPortal'); $this->fileManager->removeInDir('data/cache/application/aclPortalMap'); $this->dataManager->updateCacheTimestamp(); } private function getPortalRepository(): Repository { /** @var Repository */ return $this->getRepository(); } }