You are here

public function SalesforceMapping::save in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::save()
  2. 8.3 modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::save()

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown.

Overrides ConfigEntityBase::save

File

modules/salesforce_mapping/src/Entity/SalesforceMapping.php, line 300

Class

SalesforceMapping
Defines a Salesforce Mapping configuration entity class.

Namespace

Drupal\salesforce_mapping\Entity

Code

public function save() {
  $this->updated = $this
    ->getRequestTime();
  if (isset($this->is_new) && $this->is_new) {
    $this->created = $this
      ->getRequestTime();
  }
  return parent::save();
}