示例#1
0
 /**
  * @param TemporalField $field
  * @return int
  * @throws UnsupportedTemporalTypeException
  */
 public function getLong(TemporalField $field)
 {
     $value = $this->fieldValues->get($field);
     if ($value !== null) {
         return $value;
     }
     if ($this->date !== null && $this->date->isSupported($field)) {
         return $this->date->getLong($field);
     }
     if ($this->time !== null && $this->time->isSupported($field)) {
         return $this->time->getLong($field);
     }
     if ($field instanceof CF) {
         throw new UnsupportedTemporalTypeException("Unsupported field: " . $field);
     }
     return $field->getFrom($this);
 }