Ejemplo n.º 1
0
 private function getFields()
 {
     $fields = array();
     // initialize field api-object with list_id
     $field = new Laposta_Field($this->list_id);
     try {
         // get all fields from this list
         // $result will contain een array with the response from the server
         $result = $field->all();
     } catch (Exception $e) {
         // you can use the information in $e to react to the exception
     }
     if ($result['data']) {
         foreach ($result['data'] as $field) {
             $fields[] = $field['field'];
         }
     }
     return $fields;
 }
Ejemplo n.º 2
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("BaImMu3JZA");
/*
try {
	// update field, insert info as argument
	// $result will contain een array with the response from the server
	$result = $field->update('PbRsfv2sek', array(
		'required' => 'false'
		)
	);
	print '<pre>';print_r($result);print '</pre>';

} catch (Exception $e) {

	// you can use the information in $e to react to the exception
	print '<pre>';print_r($e);print '</pre>';

}
*/
// example with select_multiple
try {
    // update field, insert info as argument
    // $result will contain een array with the response from the server
    $result = $field->update('TOXHXMUGKi', array('options_full' => array('0' => 'Rood', '1' => 'Oranje', '2' => 'Groen')));
    print '<pre>';
    print_r($result);
    print '</pre>';
Ejemplo n.º 3
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("BaImMu3JZA");
try {
    // get field info, use field_id or email as argument
    // $result will contain een array with the response from the server
    $result = $field->get("iPcyYaTCkG");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Ejemplo n.º 4
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("BaImMu3JZA");
try {
    // get all fields from this list
    // $result will contain een array with the response from the server
    $result = $field->all();
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Ejemplo n.º 5
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("srbhotdwob");
try {
    // create new field, insert info as argument
    // $result will contain een array with the response from the server
    // Note: we need to put 'true' in quotes, because php translates true to 1 and false to [empty]
    $result = $field->create(array('name' => 'Kleur', 'defaultvalue' => 'Groen', 'datatype' => 'select_multiple', 'options' => array('Rood', 'Groen', 'Blauw'), 'required' => 'true', 'in_form' => 'true', 'in_list' => 'true'));
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Ejemplo n.º 6
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize field with list_id
$field = new Laposta_Field("BaImMu3JZA");
try {
    // (permanently) delete field, use field_id or email as argument
    // $result will contain een array with the response from the server
    $result = $field->delete("PbRsfv2sek");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}