PHP code example of statickidz / bedca-api

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

    

statickidz / bedca-api example snippets




use StaticKidz\BedcaAPI\BedcaClient;

$client = new BedcaClient();

$foodGroups = $client->getFoodGroups();

object(stdClass)#17 (1) {
  ["food"]=>
  array(13) {
    [0]=>
    object(stdClass)#18 (3) {
      ["fg_id"]=>
      string(1) "1"
      ["fg_ori_name"]=>
      string(20) "Lácteos y derivados"
      ["fg_eng_name"]=>
      string(22) "Milk and milk products"
    }
    [1]=>
    object(stdClass)#19 (3) {
      ["fg_id"]=>
      string(1) "2"
      ["fg_ori_name"]=>
      string(18) "Huevos y derivados"
      ["fg_eng_name"]=>
      string(21) "Eggs and egg products"
    }
    [2]=>
    object(stdClass)#20 (3) {
      ["fg_id"]=>
      string(1) "3"
      ["fg_ori_name"]=>
      string(21) "Cárnicos y derivados"
      ["fg_eng_name"]=>
      string(22) "Meat and meat products"
    }
    ..........
  }
}

$food = $client->getFoodsInGroup(3);

$food = $client->getFood(893);