You are here

public function TweetEntity::setHashtags in Tweet Feed 8.3

Same name and namespace in other branches
  1. 4.x src/Entity/TweetEntity.php \Drupal\tweet_feed\Entity\TweetEntity::setHashtags()

File

src/Entity/TweetEntity.php, line 309

Class

TweetEntity
Defines the Tweet Feed Tweet entity.

Namespace

Drupal\tweet_feed\Entity

Code

public function setHashtags($hashtags) {
  $tags = [];
  foreach ($hashtags as $hashtag) {
    $tags[]['target_id'] = $hashtag;
  }
  $this
    ->set('hashtags', $tags);
  return $this;
}