gedcomx-php-client
  • Namespace
  • Class

Namespaces

  • Gedcomx
    • Agent
    • Atom
    • Common
    • Conclusion
    • Extensions
      • FamilySearch
        • Platform
          • Artifacts
          • Discussions
          • Tree
          • Users
        • Rs
          • Client
            • FamilyTree
            • Helpers
            • Memories
            • Util
        • Rt
        • Types
    • GedcomxFile
    • Links
    • Records
    • Rs
      • Client
        • Exception
        • Options
        • Util
    • Rt
    • Search
    • Source
    • Support
    • Types
    • Util
    • Vocab

Classes

  • Collection
  • Duration
  • FormalDate
  • JsonMapper
  • SimpleDate
  • XmlMapper

Class Duration

Class representing a Duration in a GedcomX formal date. The form of a Duration string is

P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]

for a duration in years, months, days, hours, minutes and/or seconds.

User: Danny Yeshurun (ported from Java code)

Namespace: Gedcomx\Util
Located at Util/Duration.php

Methods summary

public
# parse( string $durationString )

A parsing method that takes a valid duration string and parses it into a Duration object.

A parsing method that takes a valid duration string and parses it into a Duration object.

Parameters

$durationString
of the form "P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]" that specifies a duration.

Throws

Exception
public true
# isValid( )

Tell whether the Duration is valid, which means that at least one of its values is non-null, and none exceeds the 2-digit limit (or 4 digits for year).

Tell whether the Duration is valid, which means that at least one of its values is non-null, and none exceeds the 2-digit limit (or 4 digits for year).

Returns

true
if valid, false otherwise.
public string
# __toString( )

Convert this Duration to the canonical string for a Duration, of the form: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] for use in a GedcomX formal date string.

Convert this Duration to the canonical string for a Duration, of the form: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] for use in a GedcomX formal date string.

Returns

string
public
# setDay( integer $day )

Set the duration day.

Set the duration day.

Parameters

$day
public integer
# getDay( )

Get the duration day, or null if not specified.

Get the duration day, or null if not specified.

Returns

integer
public
# setHour( integer $hour )

Set the duration hour.

Set the duration hour.

Parameters

$hour
public integer
# getHour( )

Get the duration hour, or null if not specified.

Get the duration hour, or null if not specified.

Returns

integer
public
# setMinute( integer $minute )

Set the duration minute.

Set the duration minute.

Parameters

$minute
public integer
# getMinute( )

Get the duration minute, or null if not specified.

Get the duration minute, or null if not specified.

Returns

integer
public
# setMonth( integer $month )

Set the duration month.

Set the duration month.

Parameters

$month
public integer
# getMonth( )

Get the duration month, or null if not specified.

Get the duration month, or null if not specified.

Returns

integer
public
# setSecond( integer $second )

Set the duration second.

Set the duration second.

Parameters

$second
public integer
# getSecond( )

Get the duration second, or null if not specified.

Get the duration second, or null if not specified.

Returns

integer
public
# setYear( integer $year )

Set the duration year.

Set the duration year.

Parameters

$year
public integer
# getYear( )

Get the duration year, or null if not specified.

Get the duration year, or null if not specified.

Returns

integer
gedcomx-php-client API documentation generated by ApiGen