예제 #1
0
 public function setExtendedInfo(Layout &$layout)
 {
     if (!$this->_isParsed) {
         throw new FileMakerException($this->_fm, 'Attempt to set extended information before parsing data.');
     }
     $layout->valueLists = $this->_valueLists;
     $layout->valueListTwoFields = $this->_valueListTwoFields;
     foreach ($this->_fields as $fieldName => $fieldInfos) {
         $field = $layout->getField($fieldName);
         $field->styleType = $fieldInfos['styleType'];
         $field->valueList = $fieldInfos['valueList'] ? $fieldInfos['valueList'] : null;
     }
 }
예제 #2
0
 /**
  * 
  * @return boolean TRUE on success
  * @throws FileMakerException
  */
 private function _commitEditChild()
 {
     $modifiedFields = [];
     foreach ($this->fields as $fieldName => $repetitions) {
         foreach ($repetitions as $repetition => $value) {
             if (!empty($this->_modifiedFields[$fieldName][$repetition])) {
                 $modifiedFields[$fieldName . '.' . $this->recordId][$repetition] = $value;
             }
         }
     }
     $editCommand = $this->fm->newEditCommand($this->parent->layout->getName(), $this->parent->getRecordId(), $modifiedFields);
     $result = $editCommand->execute();
     $records = $result->getRecords();
     $firstRecord = $records[0];
     $relatedSet = $firstRecord->getRelatedSet($this->layout->getName());
     foreach ($relatedSet as $record) {
         if ($record->getRecordId() == $this->recordId) {
             return $this->_updateFrom($record);
             break;
         }
     }
     throw new FileMakerException('Failed to find the updated child in the response.');
 }