Skip to content
Zhmayev Yaroslav edited this page Nov 30, 2017 · 2 revisions

The most basic example of how to use vtwsclib-php is to "define" a module - retrieve a list of module fields, the output info is actually very useful when using filters on entities->findOne find findMany methods.

// Let's print out the information about Leads module,
// including the list of required and optional fields etc
print_r($client->modules->getOne('Leads'));

// The output
Array
(
  [label] => Leads
  [name] => Leads
  [createable] => 1
  [updateable] => 1
  [deleteable] => 1
  [retrieveable] => 1
  [fields] => Array
    (
        ...
        [1] => Array
        (
          [name] => firstname
          [label] => First Name
          [mandatory] =>
          [type] => Array
            (
              [name] => string
            )

          [nullable] => 1
          [editable] => 1
          [default] =>
        )
        ...
    )
)