claim() public method

Claims a token for a module.
public claim ( integer | string $token, string $moduleName )
$token integer | string The claimed token. Can be any integer or string.
$moduleName string The module name.
Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function execute()
 {
     if ($this->mapping->isLoaded()) {
         return;
     }
     $this->mapping->load($this->containingModule, $this->modules);
     $moduleName = $this->containingModule->getName();
     $this->mappings->add($this->mapping);
     foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) {
         $this->mappingsByResource->set($repositoryPath, $this->mapping);
         $this->conflictDetector->claim($repositoryPath, $moduleName);
     }
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     if ($this->mapping->isLoaded() || !$this->containingModule) {
         return;
     }
     $this->mapping->load($this->containingModule, $this->modules);
     $moduleName = $this->containingModule->getName();
     foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) {
         $this->mappings->add($this->mapping);
         $this->conflictDetector->claim($repositoryPath, $moduleName);
     }
     // Restore conflicts
     foreach ($this->conflicts as $repositoryPath => $conflict) {
         $conflict->addMappings($this->conflictingMappings[$repositoryPath]);
     }
 }