trait ContentHubEntityTrait in Acquia Content Hub 8
Same name in this branch
- 8 tests/src/Functional/ContentHubEntityTrait.php \Drupal\Tests\acquia_contenthub\Functional\ContentHubEntityTrait
- 8 tests/src/Unit/ContentHubEntityTrait.php \Drupal\Tests\acquia_contenthub\Unit\ContentHubEntityTrait
Content Hub Entity Trait.
Hierarchy
- trait \Drupal\Tests\acquia_contenthub\Functional\ContentHubEntityTrait
File
- tests/
src/ Functional/ ContentHubEntityTrait.php, line 8
Namespace
Drupal\Tests\acquia_contenthub\FunctionalView source
trait ContentHubEntityTrait {
/**
* Origin of the entity.
*
* @var string
*/
private $origin = '2c8b1237-1ee6-453e-aa11-3edf9e9c5f9d';
/**
* Timestamp of last modification.
*
* @var string
*/
private $modified = '';
/**
* Convert an regular entity to Content Hub entity.
*
* @param object $entity
* A Drupal entity.
*/
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();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentHubEntityTrait:: |
private | property | Timestamp of last modification. | |
ContentHubEntityTrait:: |
private | property | Origin of the entity. | |
ContentHubEntityTrait:: |
private | function | Convert an regular entity to Content Hub entity. |