Esempio n. 1
0
 /**
  * Add command constructor.
  *
  * @ignore
  * @param FileMaker $fm FileMaker object the command was created by.
  * @param string $layout Layout to add a record to.
  * @param array $values Associative array of field name => value pairs. To set field repetitions,
  * use a numerically indexed array for the value of a field, with the numeric keys
  * corresponding to the repetition number to set.
  */
 public function __construct(FileMaker $fm, $layout, $values = array())
 {
     parent::__construct($fm, $layout);
     foreach ($values as $fieldname => $value) {
         if (!is_array($value)) {
             $this->setField($fieldname, $value, 0);
         } else {
             foreach ($value as $repetition => $repetitionValue) {
                 $this->setField($fieldname, $repetitionValue, $repetition);
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * Edit command constructor.
  *
  * @ignore
  * @param FileMaker $fm FileMaker object the command was created by.
  * @param string $layout Layout the record is part of.
  * @param string $recordId ID of the record to edit.
  * @param array $updatedValues Associative array of field name => value pairs.
  *        To set field repetitions, use a numerically indexed array for
  *        the value of a field, with the numeric keys corresponding to the
  *        repetition number to set.
  */
 public function __construct(FileMaker $fm, $layout, $recordId, $updatedValues = [])
 {
     parent::__construct($fm, $layout);
     $this->recordId = $recordId;
     $this->_deleteRelated = null;
     foreach ($updatedValues as $fieldname => $value) {
         if (!is_array($value)) {
             $this->setField($fieldname, $value, 0);
         } else {
             foreach ($value as $repetition => $repetitionValue) {
                 $this->setField($fieldname, $repetitionValue, $repetition);
             }
         }
     }
 }
Esempio n. 3
0
 /**
  * PerformScript command constructor.
  *
  * @ignore
  * @param \airmoi\FileMaker\FileMaker $fm FileMaker object the command was created by.
  * @param string $layout Layout to use for script context.
  * @param string $scriptName Name of the script to run.
  * @param string $scriptParameters Any parameters to pass to the script.
  */
 public function __construct(FileMaker $fm, $layout, $scriptName, $scriptParameters = null)
 {
     parent::__construct($fm, $layout);
     $this->_script = $scriptName;
     $this->_scriptParams = $scriptParameters;
 }
Esempio n. 4
0
 /**
  * Duplicate command constructor.
  *
  * @ignore
  * @param FileMaker $fm FileMaker object the command was created by.
  * @param string $layout Layout the record to duplicate is in.
  * @param string $recordId ID of the record to duplicate.
  */
 public function __construct(FileMaker $fm, $layout, $recordId)
 {
     parent::__construct($fm, $layout);
     $this->recordId = $recordId;
 }