PHP code example of xterr / php-ubl-generator

1. Go to this page and download the library: Download xterr/php-ubl-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xterr / php-ubl-generator example snippets


use Xterr\UBL\Xml\Mapping\CodelistMeta;

#[CodelistMeta(listID: 'criterion-element-type', listAgencyID: 'OP', listVersionID: '4.1.0')]
enum CriterionElementType: string
{
    case QUESTION = 'QUESTION';
    case REQUIREMENT = 'REQUIREMENT';
    case CAPTION = 'CAPTION';
    // ...
}

private ?CriterionElementType $typeCode = null;

private BooleanGUIControl|FinancialRatio|OccupationCode|null $expectedCode = null;

public function getExpectedCode(): BooleanGUIControl|FinancialRatio|OccupationCode|null
{
    return $this->expectedCode;
}

public function setExpectedCode(BooleanGUIControl|FinancialRatio|OccupationCode|null $expectedCode = null): self
{
    $this->expectedCode = $expectedCode;
    return $this;
}
bash
composer