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

  • CacheDirectives
  • HeaderParameter
  • Preconditions
  • QueryParameter

Interfaces

  • StateTransitionOption

Class Preconditions

A REST API request options helper providing precondition features. This is similar to the CacheDirectives class, but applies inverse logic.

Class Preconditions

Gedcomx\Rs\Client\Options\Preconditions implements Gedcomx\Rs\Client\Options\StateTransitionOption
Namespace: Gedcomx\Rs\Client\Options
Package: Gedcomx\Rs\Client\Options
Located at Rs/Client/Options/Preconditions.php

Methods summary

public
# setLastModified( DateTime $lastModified )

Sets the last modified date to send to the server for evaluation. If the last modified date specified here matches the server's last modified date for a resource, the resource will be returned; otherwise, a precondition-failed status is returned.

Sets the last modified date to send to the server for evaluation. If the last modified date specified here matches the server's last modified date for a resource, the resource will be returned; otherwise, a precondition-failed status is returned.

Parameters

$lastModified
public
# setEtag( string $etag )

Sets the ETag to send to the server for evaluation. If the ETag (entity tag) specified here matches the server's ETag for a resource, the resource will be returned; otherwise, a precondition-failed status is returned.

Sets the ETag to send to the server for evaluation. If the ETag (entity tag) specified here matches the server's ETag for a resource, the resource will be returned; otherwise, a precondition-failed status is returned.

Parameters

$etag
public
# setBothConditions( string $etag, DateTime $lastModified )

Sets the last modified date and ETag to send to the server for evaluation. If the ETag (entity tag) specified here matches the server's ETag for a resource, the resource will be returned; otherwise, a precondition-failed status is returned. The same applies to last modified. If the server's last modified date for a resource is equal to the last modified specified here, the resource will be returned; otherwise, a precondition-failed status is returned.

Sets the last modified date and ETag to send to the server for evaluation. If the ETag (entity tag) specified here matches the server's ETag for a resource, the resource will be returned; otherwise, a precondition-failed status is returned. The same applies to last modified. If the server's last modified date for a resource is equal to the last modified specified here, the resource will be returned; otherwise, a precondition-failed status is returned.

Parameters

$etag
$lastModified
public
# setState( Gedcomx\Rs\Client\GedcomxApplicationState $state )

Sets the state to use for specifying the last modified date and ETag. The last modified date and ETag values used in the preconditions will come from the specified state instance.

Sets the state to use for specifying the last modified date and ETag. The last modified date and ETag values used in the preconditions will come from the specified state instance.

Parameters

$state
public GuzzleHttp\Psr7\Request
# apply( GuzzleHttp\Psr7\Request $request, GuzzleHttp\Psr7\Request $request,… )

Applies the ETag or last modified cache control headers to the specified REST API request. The cache control headers are applied conditionally. The ETag and last modified values will only be applied if they are not null. Furthermore, the application of each are independent of the other. This could, therefore, only apply a last modified cache control header and not an ETag cache control header if the ETag property of this instance were null and last modified was not.

Applies the ETag or last modified cache control headers to the specified REST API request. The cache control headers are applied conditionally. The ETag and last modified values will only be applied if they are not null. Furthermore, the application of each are independent of the other. This could, therefore, only apply a last modified cache control header and not an ETag cache control header if the ETag property of this instance were null and last modified was not.

Parameters

$request
$request,…

Returns

GuzzleHttp\Psr7\Request
New request object reflecting the changes

Implementation of

Gedcomx\Rs\Client\Options\StateTransitionOption::apply()
gedcomx-php-client API documentation generated by ApiGen