Example #1
0
 public function query(TemporalQuery $query)
 {
     if ($query == TemporalQueries::zoneId()) {
         return ZoneId::of("Europe/Paris");
     }
     return parent::query($query);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function query(TemporalQuery $query)
 {
     if ($query == TemporalQueries::precision()) {
         return ChronoUnit::ERAS();
     }
     return parent::query($query);
 }
 public function query(TemporalQuery $query)
 {
     if ($query == TemporalQueries::zoneId()) {
         return $this->base->getZone();
     }
     return parent::query($query);
 }
Example #4
0
 /**
  * Queries this year using the specified query.
  * <p>
  * This queries this year using the specified query strategy object.
  * The {@code TemporalQuery} object defines the logic to be used to
  * obtain the result. Read the documentation of the query to understand
  * what the result of this method will be.
  * <p>
  * The result of this method is obtained by invoking the
  * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
  * specified query passing {@code this} as the argument.
  *
  * @param <R> the type of the result
  * @param TemporalQuery $query the query to invoke, not null
  * @return mixed the query result, null may be returned (defined by the query)
  * @throws DateTimeException if unable to query (defined by the query)
  * @throws ArithmeticException if numeric overflow occurs (defined by the query)
  */
 public function query(TemporalQuery $query)
 {
     if ($query == TemporalQueries::chronology()) {
         return IsoChronology::INSTANCE();
     } else {
         if ($query == TemporalQueries::precision()) {
             return ChronoUnit::YEARS();
         }
     }
     return parent::query($query);
 }
Example #5
0
 /**
  * Queries this month-day using the specified query.
  * <p>
  * This queries this month-day using the specified query strategy object.
  * The {@code TemporalQuery} object defines the logic to be used to
  * obtain the result. Read the documentation of the query to understand
  * what the result of this method will be.
  * <p>
  * The result of this method is obtained by invoking the
  * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the
  * specified query passing {@code this} as the argument.
  *
  * @param <R> the type of the result
  * @param TemporalQuery $query the query to invoke, not null
  * @return mixed the query result, null may be returned (defined by the query)
  * @throws DateTimeException if unable to query (defined by the query)
  * @throws ArithmeticException if numeric overflow occurs (defined by the query)
  */
 public function query(TemporalQuery $query)
 {
     if ($query == TemporalQueries::chronology()) {
         return IsoChronology::INSTANCE();
     }
     return parent::query($query);
 }