You are here

public static function FieldRedirectionResult::fromUrl in Field Redirection 8.2

Factory method to create from a URL object.

Parameters

\Drupal\Core\Url $url: The URL object.

Return value

\Drupal\field_redirection\FieldRedirectionResult New instance.

3 calls to FieldRedirectionResult::fromUrl()
FieldRedirectionResultBuilder::buildResult in src/FieldRedirectionResultBuilder.php
Builds a redirection result for a given set of values.
FieldRedirectionResultBuilderLinkTest::testFieldRedirectionResultBuilderSuccess in tests/src/Kernel/FieldRedirectionResultBuilderLinkTest.php
Tests the builder for redirect state.
FieldRedirectionResultUnitTest::testFromUrl in tests/src/Unit/FieldRedirectionResultUnitTest.php
@covers ::fromUrl

File

src/FieldRedirectionResult.php, line 99

Class

FieldRedirectionResult
Defines a value object for a field redirection result.

Namespace

Drupal\field_redirection

Code

public static function fromUrl(Url $url) {
  $instance = new static();
  $instance->redirectUrl = $url;
  return $instance;
}