entity_generic-8.x-3.x-dev/src/Generic/EntityCreatedTrait.php
src/Generic/EntityCreatedTrait.php
<?php
namespace Drupal\entity_generic\Generic;
/**
* Implements created functionality.
*/
trait EntityCreatedTrait {
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
$key = $this->getEntityType()->getKey('created');
return $this->get($key)->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$key = $this->getEntityType()->getKey('created');
$this->set($key, $timestamp);
return $this;
}
}
