You are here

public function EckEntity::setCreatedTime in Entity Construction Kit (ECK) 8

Sets the creation date of the entity.

Parameters

int $created: The timestamp of when the entity was created.

Return value

\Drupal\eck\EckEntityInterface The class instance that this method is called on.

Overrides EckEntityInterface::setCreatedTime

File

src/Entity/EckEntity.php, line 141

Class

EckEntity
Defines the ECK entity.

Namespace

Drupal\eck\Entity

Code

public function setCreatedTime($timestamp) {
  if ($this
    ->hasField('created')) {
    $this
      ->set('created', $timestamp);
  }
  return $this;
}