Exemplo n.º 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;
     }
 }
Exemplo n.º 2
0
 /**
  * Sets the new value for a date, time, or timestamp field from a
  * UNIX timestamp value. 
  *
  * If the field is not a date or time field, then returns an error. 
  * Otherwise, returns TRUE.
  *
  * If layout data for the target of this command has not already 
  * been loaded, calling this method loads layout data so that
  * the type of the field can be checked.
  *
  * @param string $field Name of the field to set.
  * @param string $timestamp Timestamp value.
  * @param integer $repetition Field repetition number to set. 
  *        Defaults to the first repetition.
  */
 public function setFieldFromTimestamp($field, $timestamp, $repetition = 0)
 {
     $fieldType = $this->layout->getField($field);
     if (FileMaker::isError($fieldType)) {
         return $fieldType;
     }
     switch ($fieldType->getResult()) {
         case 'date':
             return $this->setField($field, date('m/d/Y', $value), $repetition);
         case 'time':
             return $this->setField($field, date('H:i:s', $value), $repetition);
         case 'timestamp':
             return $this->setField($field, date('m/d/Y H:i:s', $value), $repetition);
     }
     throw new FileMakerException($this->fm, 'Only time, date, and timestamp fields can be set to the value of a timestamp.');
 }