PHP code example of abdulmueid / entity-reference

1. Go to this page and download the library: Download abdulmueid/entity-reference 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/ */

    

abdulmueid / entity-reference example snippets




ty = '202020';
$amount = '500';
$referencesToGenerate = 10;
$generator = new abdulmueid\EntityReference\Generator();

// Generate a reference
$reference = $generator->generateReference($entity, $amount);

// Validate Reference, should return true
$generator->isReferenceValid($entity, $amount, $reference); // Should return true

// Generate n number of references
// Should return an array with valid references
$references = $generator->generateReferences($entity, $amount, $referencesToGenerate);
shell script
phpunit tests/GeneratorTest.php