[ 'additionalColumns' => [ 'role' => 'teamRole' ] ] ]; public function afterUpdateEntity(Entity $entity, $data) { parent::afterUpdateEntity($entity, $data); if (property_exists($data, 'rolesIds')) { $this->clearRolesCache(); } } protected function clearRolesCache() { $this->fileManager->removeInDir('data/cache/application/acl'); $this->dataManager->updateCacheTimestamp(); } public function link(string $id, string $link, string $foreignId) { $result = parent::link($id, $link, $foreignId); if ($link === 'users') { $this->fileManager->removeFile('data/cache/application/acl/' . $foreignId . '.php'); $this->dataManager->updateCacheTimestamp(); } return $result; } public function unlink(string $id, string $link, string $foreignId) { $result = parent::unlink($id, $link, $foreignId); if ($link === 'users') { $this->fileManager->removeFile('data/cache/application/acl/' . $foreignId . '.php'); $this->dataManager->updateCacheTimestamp(); } return $result; } public function massLink(string $id, string $link, array $where, ?array $selectData = null) { $result = parent::massLink($id, $link, $where, $selectData); if ($link === 'users') { $this->clearRolesCache(); } return $result; } }