PHP code example of oveleon / contao-propstack-api-bundle
1. Go to this page and download the library: Download oveleon/contao-propstack-api-bundle 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/ */
oveleon / contao-propstack-api-bundle example snippets
$objUnits = new UnitController();
$objUnits->setFormat(PropstackController::FORMAT_JSON);
$units = $objUnits->read($parameters);
$units = $objUnits->readOne($id);
$units = $objUnits->edit($id, $parameters);
$units = $objUnits->create($parameters);
$units = $objUnits->delete($id);
// Create a unit with custom fields
$objUnits->setCustomFields(['my_custom_field']);
$units = $objUnits->create([
'title' => 'My Unit',
'marketing_type' => 'BUY',
'object_type' => 'LIVING',
'rs_type' => 'APARTMENT',
'custom_fields' => [
'my_custom_field' => '123'
]
]);