miqwit / dedex

A generic efficient DDEX parser. Parse seemlessly the complex DDEX format and transform it into classes easily useable in your PHP project. Supports several versions (3.8.2, 4.1, 4.1.1) and is listed in the official DDEX page: https://kb.ddex.net/display/HBK/Open+Source+Software
MIT License
23 stars 11 forks source link

Get release info for specific territory #27

Closed GeorgNation closed 11 months ago

GeorgNation commented 11 months ago

How do I get information about releases, tracks and other files for individual regions? For example one track (although it can be both a file and a release) contains information for Worldwide and US regions, how to get the release for US?

miqwit commented 11 months ago

Hello @GeorgNation. You closed this issue so I guess you found a solution. I give an answer here for reference to other users.

Foreach Simple Entity, there is an access to a function getDetailsByTerritory($element, string $type, string $territory = "worldwide") where you can get information for a given territory (worldwide by default).

Note that you need to know the territory you are looking for. If the territory is missing for this element, an \Exception will be raised (in this case you can catch it and fallback on Worldwide if you wish).