Puli\Repository\Api\ResourceNotFoundException::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('The resource %s does not exist.', $path), 0, $cause);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getChild($relPath)
 {
     if (!$this->getRepository()) {
         throw ResourceNotFoundException::forPath($this->getRepositoryPath() . '/' . $relPath);
     }
     return $this->getRepository()->get($this->getRepositoryPath() . '/' . $relPath);
 }
All Usage Examples Of Puli\Repository\Api\ResourceNotFoundException::forPath
ResourceNotFoundException