You are here

public static function RestfulBase::isReadMethod in RESTful 7

Determines if the HTTP method represents a read operation.

Parameters

string $method: The method name.

boolean $strict: TRUE if the comparisons are case sensitive.

Return value

boolean TRUE if it is a read operation. FALSE otherwise.

3 calls to RestfulBase::isReadMethod()
RestfulBase::generateCacheId in plugins/restful/RestfulBase.php
Generate a cache identifier for the request and the current context.
RestfulBase::isValidMethod in plugins/restful/RestfulBase.php
Determines if the HTTP method is one of the known methods.
RestfulCsrfTokenTestCase::checkCsrfRequest in tests/RestfulCsrfTokenTestCase.test
Perform requests without, with invalid and with valid CSRF tokens.

File

plugins/restful/RestfulBase.php, line 506
Contains RestfulBase.

Class

RestfulBase
Class \RestfulBase

Code

public static function isReadMethod($method, $strict = TRUE) {
  $method = $strict ? $method : strtoupper($method);
  return in_array($method, array(
    \RestfulInterface::GET,
    \RestfulInterface::HEAD,
    \RestfulInterface::OPTIONS,
    \RestfulInterface::TRACE,
    \RestfulInterface::CONNECT,
  ));
}