PHP code example of swisscom / referencedataimport

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

    

swisscom / referencedataimport example snippets



namespace Your\Package\Domain\Model;

use Neos\Flow\Annotations as Flow;
use Swisscom\ReferenceDataImport\Annotation as ReferenceData;

/**
 * @Flow\Entity
 * @ReferenceData\Entity
 */
class Vat
{
    /**
     * @var string
     */
    protected $name;
    
    /**
     * @var float
     * @ReferenceData\Updatable
     */
    protected $rate;
}

public function findByReferenceDataEntity(object $object): ?Vat
{
    $query = $this->createQuery();
    return $query->matching($query->equals('name', $object->getName()))->execute()->getFirst();
}