PHP code example of arslanimamutdinov / iso-standard-utilities
1. Go to this page and download the library: Download arslanimamutdinov/iso-standard-utilities 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/ */
arslanimamutdinov / iso-standard-utilities example snippets
composer
public static function getByAlpha2(
array $standardsData,
string $alpha2
): ?array;
public function getByAlpha2(
array $standardsData,
string $alpha2
): ?array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getByAlpha2($rawStandardsData, 'AU');
var_dump($result);
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
$result = StandardSearchUtility::getByAlpha2($rawStandardsData, 'RU');
var_dump($result);
NULL
$service = new StandardSearchUtilityService();
$result = $service->getByAlpha2($rawStandardsData, 'AU');
var_dump($result);
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
$result = $service->getByAlpha2($rawStandardsData, 'RU');
var_dump($result);
NULL
public static function getByAlpha3(
array $standardsData,
string $alpha3
): ?array;
public function getByAlpha3(
array $standardsData,
string $alpha3
): ?array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getByAlpha3($rawStandardsData, 'ARM');
var_dump($result);
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
$result = StandardSearchUtility::getByAlpha3($rawStandardsData, 'FOO');
var_dump($result);
NULL
$service = new StandardSearchUtilityService();
$result = $service->getByAlpha3($rawStandardsData, 'ARM');
var_dump($result);
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
$result = $service->getByAlpha3($rawStandardsData, 'RUS');
var_dump($result);
NULL
public static function getByNumericCode(
array $standardsData,
string $numericCode
): ?array;
public function getByNumericCode(
array $standardsData,
string $numericCode
): ?array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getByNumericCode($rawStandardsData, '051');
var_dump($result);
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
$result = StandardSearchUtility::getByNumericCode($rawStandardsData, '000');
var_dump($result);
NULL
$service = new StandardSearchUtilityService();
$result = $service->getByNumericCode($rawStandardsData, '051');
var_dump($result);
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
$result = $service->getByNumericCode($rawStandardsData, '000');
var_dump($result);
NULL
public static function getStandardsDataByAttributeCode(
array $standardsData,
string $attributeCode,
string $value
): ?array;
public function getStandardsDataByAttributeCode(
array $standardsData,
string $attributeCode,
string $value
): ?array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getStandardsDataByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AU');
var_dump($result);
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
$result = StandardSearchUtility::getStandardsDataByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AUS');
var_dump($result);
NULL
$service = new StandardSearchUtilityService();
$result = $service->getStandardsDataByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AU');
var_dump($result);
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
$result = $service->getStandardsDataByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AUS');
var_dump($result);
NULL
public static function existByAlpha2(
array $standardsData,
string $alpha2
): bool;
public function existByAlpha2(
array $standardsData,
string $alpha2
): bool;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::existByAlpha2($rawStandardsData, 'AU');
var_dump($result);
bool(true)
$result = StandardSearchUtility::existByAlpha2($rawStandardsData, 'AUS');
var_dump($result);
bool(false)
$service = new StandardSearchUtilityService();
$result = $service->existByAlpha2($rawStandardsData, 'AU');
var_dump($result);
bool(true)
$result = $service->existByAlpha2($rawStandardsData, 'AUS');
var_dump($result);
bool(false)
public static function existByAlpha3(
array $standardsData,
string $alpha3
): bool;
public function existByAlpha3(
array $standardsData,
string $alpha3
): bool;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::existByAlpha3($rawStandardsData, 'AUS');
var_dump($result);
bool(true)
$result = StandardSearchUtility::existByAlpha3($rawStandardsData, 'AU');
var_dump($result);
bool(false)
$service = new StandardSearchUtilityService();
$result = $service->existByAlpha3($rawStandardsData, 'AUS');
var_dump($result);
bool(true)
$result = $service->existByAlpha3($rawStandardsData, 'AU');
var_dump($result);
bool(false)
public static function existByNumericCode(
array $standardsData,
string $numericCode
): bool;
public function existByNumericCode(
array $standardsData,
string $numericCode
): bool;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::existByNumericCode($rawStandardsData, '036');
var_dump($result);
bool(true)
$result = StandardSearchUtility::existByNumericCode($rawStandardsData, '000');
var_dump($result);
bool(false)
$service = new StandardSearchUtilityService();
$result = $service->existByNumericCode($rawStandardsData, '036');
var_dump($result);
bool(true)
$result = $service->existByNumericCode($rawStandardsData, '000');
var_dump($result);
bool(false)
public static function existByAttributeCode(
array $standardsData,
string $attributeCode,
string $value
): bool;
public function existByAttributeCode(
array $standardsData,
string $attributeCode,
string $value
): bool;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::existByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AU');
var_dump($result);
bool(true)
$result = StandardSearchUtility::existByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'foo');
var_dump($result);
bool(false)
$service = new StandardSearchUtilityService();
$result = $service->existByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'AU');
var_dump($result);
bool(true)
$result = $service->existByAttributeCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, 'foo');
var_dump($result);
bool(false)
public static function getAllNames(
array $standardsData
): array;
public function getAllNames(
array $standardsData
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllNames($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(7) "Armenia"
[1]=>
string(5) "Aruba"
[2]=>
string(9) "Australia"
}
$service = new StandardSearchUtilityService();
$result = $service->getAllNames($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(7) "Armenia"
[1]=>
string(5) "Aruba"
[2]=>
string(9) "Australia"
}
public static function getAllNumericCodes(
array $standardsData
): array;
public function getAllNumericCodes(
array $standardsData
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllNumericCodes($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(3) "051"
[1]=>
string(3) "533"
[2]=>
string(3) "036"
}
$service = new StandardSearchUtilityService();
$result = $service->getAllNumericCodes($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(3) "051"
[1]=>
string(3) "533"
[2]=>
string(3) "036"
}
public static function getAllAlpha3(
array $standardsData
): array;
public function getAllAlpha3(
array $standardsData
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllAlpha3($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(3) "ARM"
[1]=>
string(3) "ABW"
[2]=>
string(3) "AUS"
}
$service = new StandardSearchUtilityService();
$result = $service->getAllAlpha3($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(3) "ARM"
[1]=>
string(3) "ABW"
[2]=>
string(3) "AUS"
}
public static function getAllAlpha2(
array $standardsData
): array;
public function getAllAlpha2(
array $standardsData
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllAlpha2($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(2) "AM"
[1]=>
string(2) "AW"
[2]=>
string(2) "AU"
}
$service = new StandardSearchUtilityService();
$result = $service->getAllAlpha2($rawStandardsData);
var_dump($result);
array(3) {
[0]=>
string(2) "AM"
[1]=>
string(2) "AW"
[2]=>
string(2) "AU"
}
public static function getAllAttributesByCode(
array $standardsData,
string $attributeCode
): array;
public function getAllAttributesByCode(
array $standardsData,
string $attributeCode
): array
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllAttributesByCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2);
var_dump($result);
array(3) {
[0]=>
string(2) "AM"
[1]=>
string(2) "AW"
[2]=>
string(2) "AU"
}
$service = new StandardSearchUtilityService();
$result = $service->getAllAttributesByCode($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2);
var_dump($result);
array(3) {
[0]=>
string(2) "AM"
[1]=>
string(2) "AW"
[2]=>
string(2) "AU"
}
public static function getAllByAttributeCodeValues(
array $standardsData,
string $attributeCode,
array $values
): array;
public function getAllByAttributeCodeValues(
array $standardsData,
string $attributeCode,
array $values
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllByAttributeCodeValues($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, ['AU', 'AM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = StandardSearchUtility::getAllByAttributeCodeValues($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, ['AUS', 'ARM']);
var_dump($result);
array(0) {
}
$service = new StandardSearchUtilityService();
$result = $service->getAllByAttributeCodeValues($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, ['AU', 'AM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = $service->getAllByAttributeCodeValues($rawStandardsData, AttributeCodes::ATTRIBUTE_ALPHA2, ['AUS', 'ARM']);
var_dump($result);
array(0) {
}
public static function getAllByAlpha2Values(
array $standardsData,
array $values
): array;
public function getAllByAlpha2Values(
array $standardsData,
array $values
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllByAlpha2Values($rawStandardsData, ['AU', 'AM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = StandardSearchUtility::getAllByAlpha2Values($rawStandardsData, ['AUS', 'ARM']);
var_dump($result);
array(0) {
}
$service = new StandardSearchUtilityService();
$result = $service->getAllByAlpha2Values($rawStandardsData, ['AU', 'AM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = $service->getAllByAlpha2Values($rawStandardsData, ['AUS', 'ARM']);
var_dump($result);
array(0) {
}
public static function getAllByAlpha3Values(
array $standardsData,
array $values
): array;
public function getAllByAlpha3Values(
array $standardsData,
array $values
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllByAlpha3Values($rawStandardsData, ['AUS', 'ARM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = StandardSearchUtility::getAllByAlpha3Values($rawStandardsData, ['AU', 'AM']);
var_dump($result);
array(0) {
}
$service = new StandardSearchUtilityService();
$result = $service->getAllByAlpha3Values($rawStandardsData, ['AUS', 'ARM']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = $service->getAllByAlpha3Values($rawStandardsData, ['AU', 'AM']);
var_dump($result);
array(0) {
}
public static function getAllByNumericCodeValues(
array $standardsData,
array $values
): array;
public function getAllByNumericCodeValues(
array $standardsData,
array $values
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllByNumericCodeValues($rawStandardsData, ['051', '036']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = StandardSearchUtility::getAllByNumericCodeValues($rawStandardsData, ['000', '111']);
var_dump($result);
array(0) {
}
$service = new StandardSearchUtilityService();
$result = $service->getAllByNumericCodeValues($rawStandardsData, ['051', '036']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = $service->getAllByNumericCodeValues($rawStandardsData, ['000', '111']);
var_dump($result);
array(0) {
}
public static function getAllByNameValues(
array $standardsData,
array $values
): array;
public function getAllByNameValues(
array $standardsData,
array $values
): array;
$rawStandardsData = [
[
AttributeCodes::ATTRIBUTE_NAME => "Armenia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AM",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ARM",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "051",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Aruba",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AW",
AttributeCodes::ATTRIBUTE_ALPHA3 => "ABW",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "533",
],
[
AttributeCodes::ATTRIBUTE_NAME => "Australia",
AttributeCodes::ATTRIBUTE_ALPHA2 => "AU",
AttributeCodes::ATTRIBUTE_ALPHA3 => "AUS",
AttributeCodes::ATTRIBUTE_NUMERIC_CODE => "036",
],
];
$result = StandardSearchUtility::getAllByNameValues($rawStandardsData, ['Armenia', 'Australia']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = StandardSearchUtility::getAllByNameValues($rawStandardsData, ['foo', 'bar']);
var_dump($result);
array(0) {
}
$service = new StandardSearchUtilityService();
$result = $service->getAllByNameValues($rawStandardsData, ['Armenia', 'Australia']);
var_dump($result);
array(2) {
[0]=>
array(4) {
["name"]=>
string(7) "Armenia"
["alpha2"]=>
string(2) "AM"
["alpha3"]=>
string(3) "ARM"
["numericCode"]=>
string(3) "051"
}
[1]=>
array(4) {
["name"]=>
string(9) "Australia"
["alpha2"]=>
string(2) "AU"
["alpha3"]=>
string(3) "AUS"
["numericCode"]=>
string(3) "036"
}
}
$result = $service->getAllByNameValues($rawStandardsData, ['foo', 'bar']);
var_dump($result);
array(0) {
}