You are here

public static function SocialApi::create in Social API 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/SocialApi.php \Drupal\social_api\Entity\SocialApi::create()

Constructs a new entity object, without permanently saving it.

Parameters

array $values: (optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

Return value

static The entity object.

Overrides EntityBase::create

File

src/Entity/SocialApi.php, line 17

Class

SocialApi
Defines a base class for Social API content entities.

Namespace

Drupal\social_api\Entity

Code

public static function create(array $values = []) {
  if (isset($values['token'])) {
    $values['token'] = static::encryptToken($values['token']);
  }
  return parent::create($values);
}