You are here

protected function LinkToFileConstraint::hasPath in File Link 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Validation/Constraint/LinkToFileConstraint.php \Drupal\file_link\Plugin\Validation\Constraint\LinkToFileConstraint::hasPath()

Check whereas given URL has a path.

Parameters

string $url: URL.

Return value

bool Whereas given URL has a path.

1 call to LinkToFileConstraint::hasPath()
LinkToFileConstraint::validate in src/Plugin/Validation/Constraint/LinkToFileConstraint.php
Checks if the passed value is valid.

File

src/Plugin/Validation/Constraint/LinkToFileConstraint.php, line 105

Class

LinkToFileConstraint
Validation constraint for file_link, checking that URI points to a file.

Namespace

Drupal\file_link\Plugin\Validation\Constraint

Code

protected function hasPath($url) {
  return !empty($this
    ->getPath($url));
}