Further modules included.
[yaffs-website] / web / modules / contrib / filefield_sources / src / Routing / FilefieldSourcesRoutes.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\filefield_sources\Routing\FilefieldSourcesRoutes.
6  */
7
8 namespace Drupal\filefield_sources\Routing;
9
10 /**
11  * Defines a route subscriber to register a url for serving filefield sources.
12  */
13 class FilefieldSourcesRoutes {
14
15   /**
16    * Returns an array of route objects.
17    *
18    * @return \Symfony\Component\Routing\Route[]
19    *   An array of route objects.
20    */
21   public function routes() {
22     $routes = array();
23
24     foreach (\Drupal::service('filefield_sources')->getDefinitions() as $definition) {
25       // Get routes defined by each plugin.
26       $callback = array($definition['class'], 'routes');
27       if (is_callable($callback)) {
28         $routes = array_merge($routes, call_user_func($callback));
29       }
30     }
31
32     return $routes;
33   }
34
35 }