You are here

protected function LogProcessor::newEntity in Log entity 7

Creates a new log in memory and returns it.

File

includes/feeds/plugins/LogProcessor.inc, line 31
Class definition of LogProcessor.

Class

LogProcessor
Creates logs from feed items.

Code

protected function newEntity(FeedsSource $source) {

  // If an author is not defined, set the author to the current user.
  $uid = $this->config['author'];
  global $user;
  if (empty($uid) && !empty($user->uid)) {
    $uid = $user->uid;
  }

  // Assemble and return the entity.
  $values = array(
    'type' => $this
      ->bundle(),
    'created' => REQUEST_TIME,
    'changed' => REQUEST_TIME,
    'uid' => $uid,
    'is_new' => TRUE,
  );
  return entity_create('log', $values);
}