# NPSParser

Implements \NPS\DependencyInjection\IXMLContentParser

Content parser for NPS

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\NPS\Repository\FileRepository $fileRepo)

### Arguments

#### $fileRepo

`\NPS\Repository\FileRepository`

## Gets the parsed description

    getDescription() : string|null

inheritDoc |

### Response

`string|null`

## Gets the parsed images

    getImages() : array

inheritDoc |

### Response

`array`

## Gets a link by URI

    getLink(string $uri)

### Arguments

#### $uri

`string`

## Gets a local public link by uri Also handles proper browser cache clearance

    getLocalPublicLink(string $uri) : string|null

### Arguments

#### $uri

`string`

### Response

`string|null`

## Gets the parsed sounds

    getSounds() : array

inheritDoc |

### Response

`array`

## Gets the parsed title

    getTitle() : string|null

inheritDoc |

### Response

`string|null`

## Gets the parsed videos

    getVideos() : array

inheritDoc |

### Response

`array`

## Guards the getters against calling prior to any parsing operation

    guard()

Throws | \NPS\Exception\ParserNotCalledException

## Decides whether the URI is local or remote

    isRemoteUri(string $uri) : boolean

### Arguments

#### $uri

`string`

### Response

`boolean`

## Parses an XML content structure

    parse(\NPS\Model\TraversableXMLElement $xml,  $discriminatorTag) : boolean

inheritDoc |

### Arguments

#### $xml

`\NPS\Model\TraversableXMLElement`

XML to parse

#### $discriminatorTag

``

### Response

`boolean`

## Parses simple text

    parseBasic(\NPS\Model\TraversableXMLElement $xml)

### Arguments

#### $xml

`\NPS\Model\TraversableXMLElement`

## Parses new enhanced question/hypothesis/answer format

    parseEnhanced(\NPS\Model\TraversableXMLElement $xml)

### Arguments

#### $xml

`\NPS\Model\TraversableXMLElement`

## Validates the elements for a valid uri link and returns array of valid links

    parseMultimedia(array $elements) : array

### Arguments

#### $elements

`array`

### Response

`array`

## Parses a text string For indexes support and future use

    parseText(string $str) : string

inheritDoc |

### Arguments

#### $str

`string`

### Response

`string`

### Properties

## title

    title : string|null

var |

### Type(s)

`string|null`

## description

    description : string|null

var |

### Type(s)

`string|null`

## images

    images : array

var |

### Type(s)

`array`

## videos

    videos : array

var |

### Type(s)

`array`

## sounds

    sounds : array

var |

### Type(s)

`array`

## parsed

    parsed : boolean

var |

### Type(s)

`boolean`

## tag

    tag : string

var |

### Type(s)

`string`

## fileRepo

    fileRepo : \NPS\Repository\FileRepository

var |

### Type(s)

`\NPS\Repository\FileRepository`