all method Null safety
- String ptr,
- {String? origin}
Returns all LicenseRecord
s for a ptr
.
Optionally, an origin
may be specified. If null origin
defaults
to the init origin.
The LicenseRecord
s returned may be expired or not applicable to a
specific LicenseUse. To check license validity, use the guard
method.
Implementation
List<LicenseRecord> all(String ptr, {String? origin}) {
ptr = _hashPtr(ptr);
TitleModel? title = _titleService.getByPtr(ptr, origin: origin);
if (title == null) return [];
List<LicenseModel> licenses = _licenseService.getAll(title.transactionId!);
return licenses.map((license) => _toLicense(title, license)).toList();
}