Puli\Manager\Api\Repository\PathMapping::getLoadErrors PHP Method

getLoadErrors() public method

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getLoadErrors ( ) : Exceptio\Exception[]
return Exceptio\Exception[] The errors that occurred during loading. If the returned array is empty, the mapping was loaded successfully.
    public function getLoadErrors()
    {
        if (null === $this->state) {
            throw new NotLoadedException('The mapping is not loaded.');
        }
        return $this->loadErrors;
    }

Usage Example

Ejemplo n.º 1
0
 private function assertNoLoadErrors(PathMapping $mapping)
 {
     $loadErrors = $mapping->getLoadErrors();
     if (count($loadErrors) > 0) {
         // Rethrow first error
         throw reset($loadErrors);
     }
 }
All Usage Examples Of Puli\Manager\Api\Repository\PathMapping::getLoadErrors