You are here

private function ContentHubEntityTrait::convertToContentHubEntity in Acquia Content Hub 8

Convert an regular entity to Content Hub entity.

Parameters

object $entity: A Drupal entity.

2 calls to ContentHubEntityTrait::convertToContentHubEntity()
NodeFormTest::testNodeForm in tests/src/Functional/NodeFormTest.php
Configure content hub node form.
NodeFormTest::testNodeFormIntroduceLocalChange in tests/src/Functional/NodeFormTest.php
Configure content hub node form, auto setting to "having local change".

File

tests/src/Functional/ContentHubEntityTrait.php, line 30

Class

ContentHubEntityTrait
Content Hub Entity Trait.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

private function convertToContentHubEntity($entity) {
  $imported_entity = $this->container
    ->get('acquia_contenthub.acquia_contenthub_entities_tracking')
    ->setImportedEntity($entity
    ->getEntityTypeId(), $entity
    ->id(), $entity
    ->uuid(), $this->modified, $this->origin);
  $imported_entity
    ->save();
}