X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FRouting%2FLinkIndex.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FRouting%2FLinkIndex.php;h=71a0846faeb8bf36b0cb2c484892d7cdcf76a7fc;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkIndex.php b/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkIndex.php new file mode 100644 index 000000000..71a0846fa --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkIndex.php @@ -0,0 +1,60 @@ +getIdentifier(); + + if (isset($this->idiotBox[$id])) { + $id .= '_' . $this->idiotBox[$id]++; + } + else { + $this->idiotBox[$id] = 0; + } + + $this->set($binding->getSource()->getPath()->__toString(), $binding); + $binding->onIndexed($id, $this); + } + + /** + * Builds all the links in this index and returns them as an array of arrays, + * keyed by link ID. + * + * @return array + */ + public function build() { + $build = []; + + foreach ($this as $binding) { + $build[ $binding->getIdentifier() ] = $binding->build(); + } + + return $build; + } + +}