PHP code example of linkorb / haigha

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

    

linkorb / haigha example snippets


// Instantiate a new Alice loader
$loader = new Nelmio\Alice\Fixtures\Loader();

// Add the Haigha instantiator
$instantiator = new Haigha\TableRecordInstantiator();
$loader->addInstantiator($instantiator);

// Load (Haigha) objects from a Alice yml file
$objects = $loader->load('examples/random_users.yml');

// Instantiate the Haigha PDO persister, and pass a PDO connection
$persister = new PdoPersister($pdo);

// Persist the Haigha objects on the PDO connection
$persister->persist($objects);