You are here

class CustomLinkGenerator in Simple XML sitemap 8

CustomLinkGenerator class.

Hierarchy

Expanded class hierarchy of CustomLinkGenerator

File

src/CustomLinkGenerator.php, line 14
Contains \Drupal\simplesitemap\LinkGenerators\CustomLinkGenerator.

Namespace

Drupal\simplesitemap
View source
class CustomLinkGenerator extends LinkGeneratorBase {

  /**
   * Returns an array of all urls of the custom paths.
   *
   * @param array $custom_paths
   *
   * @return array $urls
   *
   */
  public function get_paths($custom_paths) {
    $paths = array();
    foreach ($custom_paths as $i => $custom_path) {
      if (FALSE !== ($path_data = $this
        ->get_multilang_urls_from_user_input($custom_path['path']))) {
        $paths[$i]['path_data'] = $path_data;
        $paths[$i]['priority'] = isset($custom_path['priority']) ? $custom_path['priority'] : NULL;
        $paths[$i]['lastmod'] = NULL;

        //todo: implement lastmod
      }
    }
    return $paths;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CustomLinkGenerator::get_paths public function Returns an array of all urls of the custom paths. Overrides LinkGeneratorBase::get_paths
LinkGeneratorBase::$anonymous_account private property
LinkGeneratorBase::$current_entity_type private property
LinkGeneratorBase::$default_language_id protected property
LinkGeneratorBase::$entity_paths private property
LinkGeneratorBase::$languages protected property
LinkGeneratorBase::access protected function Checks if anonymous users have access to a given path.
LinkGeneratorBase::ANONYMOUS_USER_ID constant
LinkGeneratorBase::get_entity_paths public function Overrides LinkGeneratorInterface::get_entity_paths
LinkGeneratorBase::get_multilang_urls_from_route protected function Wrapper function for Drupal\Core\Url::fromRoute. Returns url data for every language.
LinkGeneratorBase::get_multilang_urls_from_user_input protected function Wrapper function for Drupal\Core\Url::fromUserInput. Returns url data for every language.
LinkGeneratorBase::PATH_DOES_NOT_EXIST constant
LinkGeneratorBase::PLUGIN_ERROR_MESSAGE constant
LinkGeneratorBase::register_error protected function Logs and displays an error.
LinkGeneratorBase::__construct function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.