* @package taoGroups * @deprecated use migrations instead. See https://github.com/oat-sa/generis/wiki/Tao-Update-Process */ class Updater extends \common_ext_ExtensionUpdater { const OLD_MEMBER_PROPERTY = 'http://www.tao.lu/Ontologies/TAOGroup.rdf#Members'; /** * (non-PHPdoc) * @see common_ext_ExtensionUpdater::update() */ public function update($initialVersion) { if ($this->isVersion('2.6')) { OntologyUpdater::syncModels(); $iterator = new \core_kernel_classes_ResourceIterator([GroupsService::singleton()->getRootClass()]); foreach ($iterator as $group) { $users = $group->getPropertyValues(new \core_kernel_classes_Property(self::OLD_MEMBER_PROPERTY)); foreach ($users as $userUri) { if (GroupsService::singleton()->addUser($userUri, $group)) { //$group->removePropertyValue(new \core_kernel_classes_Property(self::OLD_MEMBER_PROPERTY), $userUri); } } } $this->setVersion('2.6.1'); } if ($this->isBetween('2.6.1', '2.7')) { $this->setVersion('2.7'); } if ($this->isVersion('2.7')) { OntologyUpdater::syncModels(); $this->setVersion('2.7.1'); } $this->skip('2.7.1', '3.0.0'); // fix anonymous access if ($this->isVersion('3.0.0')) { AclProxy::revokeRule(new AccessRule(AccessRule::GRANT, TaoRoles::ANONYMOUS, Api::class)); $this->setVersion('3.0.1'); } $this->skip('3.0.1', '6.5.1'); //Updater files are deprecated. Please use migrations. //See: https://github.com/oat-sa/generis/wiki/Tao-Update-Process $this->setVersion($this->getExtension()->getManifest()->getVersion()); } }