aboutgoods/php-jakku-client

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.3.4) of this package.


README

1. installation

add to your composer.json file:

  ...
  "require": {
      ...
      "aboutgoods/php-jakku-client": "dev-master"
  }

Then run:

composer install

2. Usage

this is a basic usage to send an organization:

<?php
require __DIR__."/vendor/autoload.php";

use \Aboutgoods\Jakku\DataBag\Data\DataType;
use \Aboutgoods\Jakku\Connector;
use \Aboutgoods\Jakku\DataBag;

$connector = Connector::connect([
    "address"  => "localhost",
    "port"     => 5672,
    "login"    => "guest",
    "password" => "guest",
    "queue"    => "jakku",
]);
$raw = new DataType\StringType("FNAC ANNECY");
$processed = (new DataType\OrganizationType())
    ->setSource(DataType\SourceType::stringRange("FNAC", 0, 3))
    ->setIdOrganization("123456")
    ->setName("Fnac")
    ->setLegalName("FNAC")
    ->setPointOfSales([
        (new DataType\PointOfSaleType())
            ->setSource(DataType\SourceType::stringRange("FNAC ANNECY", 0, 10))
            ->setName("Fnac Annecy")
            ->setPlace(
                (new DataType\PlaceType())
                    ->setSource(DataType\SourceType::string("elasticsearch"))
                    ->setName("Centre commercial Courier")
                    ->setStreetAddress("65 Rue Carnot")
                    ->setPostalCode("74000")
                    ->setAddressCity("ANNECY")
                    ->setAddressRegion("ARA")
                    ->setAddressCountry("FRANCE")
                    ->addGeo(new DataType\GeoType(45.904878, 6.122516))
                    ->addGeo(new DataType\GeoType(45.905066, 6.123516))
                    ->addGeo(new DataType\GeoType(45.904844, 6.124087))
                    ->addGeo(new DataType\GeoType(45.903851, 6.124615))
                    ->addGeo(new DataType\GeoType(45.903123, 6.123539))
            ),
    ])
;
$databag = (new DataBag\Organization(true))
    ->setDescription("A organization debug databag example")
    ->enableHumanVerification("parce que c'est pas tout a fait parfait")
    ->setFrom("example")
    ->setFromVersion("1.0.0")
    ->addRawData($raw)
    ->addProcessedData($processed)
;
Connector::emit($databag);

3. Update the project

Don't forget to add you classes and tag the commit version. Please also update this readme with the new version.git status git

4 Update the jakku bundle

Since you changed the client, you need to also update the jakku bundle project So tag the jakku bundle commmit and also update the version in the composer.json