Puli\Repository\Api\NoVersionFoundException::forPath PHP Method

forPath() public static method

Creates a new exception for a resource path.
public static forPath ( string $path, Exception $cause = null ) : static
$path string The path which was not found.
$cause Exception The exception that caused this exception.
return static The created exception.
    public static function forPath($path, Exception $cause = null)
    {
        return new static(sprintf('Could not find any version of path %s.', $path), 0, $cause);
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getVersions($path)
 {
     // Non-editable repositories always contain only one version of a resource
     try {
         return new VersionList($path, array($this->get($path)));
     } catch (ResourceNotFoundException $e) {
         throw NoVersionFoundException::forPath($path, $e);
     }
 }
All Usage Examples Of Puli\Repository\Api\NoVersionFoundException::forPath
NoVersionFoundException