PHP code example of prayno / moveon

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

    

prayno / moveon example snippets


private $client;

public function __construct(HttpClientInterface $client)
{
    $this->client = $client->withOptions([
        'local_cert' => '/location/to/my/certificate/mycertificate.crt',
        'local_pk' => '/location/to/my/certificate/mycertificate.key',
        'passphrase' => 'myOptionalPassphraseToReadTheCertificate',
        'base_uri' => 'https://myUniversityInstance-api.moveonfr.com/restService/index.php?version=3.0'
    ]);
}

public function myFunction()
{
    $moveon = new MoveOn($this->client);
    ...
}

$data = $moveon->findBy("person",["surname"=>"Foo","first_name"=>"Bar"]);

$data = $moveon->findBy("person",["surname"=>"Doe","first_name"=>["John","Jane"]]);

$data = $moveon->findBy("person",["surname"=>"Foo","first_name"=>"Bar"],["surname"=>"asc","first_name"=>"asc"],20,1,["email","surname","last_name"],"fra");

$data = $moveon->save("person",["id"=>"1","surname"=>"Foo","first_name"=>"Bar"]);

$data = $moveon->sendQuery("person","list",YOUR_QUERY_STRING);