Method create

Create a rule now with your application in target. Then create the function public function create($param) in your class.

Run your rule as you did while developing the method read.

Here is an example of input value :

tuto_connecteur_method_create_input

Parameters :

  • data contains all the record Myddleware want to create in tour application. The key of each record is the id of the data trasfer in Myddleware
  • module is the module to write in your application
  • ruleId is teh id of the rule
  • rule contains the parameters of the rule
  • ruleFields contains the fields of the rule
  • ruleParams is the parameters of the rule
  • ruleRelationships contains the relationships with the current rule
  • fieldsType contains the type of all fields in the rule
  • jobId is the if of the job

The output of the function created should look like these :

tuto_connecteur_method_create_output

The function should then return an array with an array (key = id of the data transfer in Myddleware) for each record created.  This array has 2 entries :

  • id of the record in your application
  • error : the error message or empty if the record is successfully created