You are here

public static function SFID::createIfValid in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x src/SFID.php \Drupal\salesforce\SFID::createIfValid()

Given a potential SFID, return a new SFID object if it's valid.

Parameters

string $id: A potential sfid.

Return value

\Drupal\salesforce\SFID|false A new SFID if $id is valid, otherwise FALSE.

File

src/SFID.php, line 48

Class

SFID
Class SFID.

Namespace

Drupal\salesforce

Code

public static function createIfValid($id) {
  if (static::isValid($id)) {
    return new static($id);
  }
  return FALSE;
}