You are here

function UserpointsTransaction::setEntity in User Points 7.2

Define the referenced entity.

Parameters

$entity_type: Entity type that should be referenced.

$entity_id: Id of the referenced entity.

Return value

UserpointsTransaction

File

./userpoints.transaction.inc, line 188
Contains the UserpointsTransaction and related classes.

Class

UserpointsTransaction
A Userpoints transaction.

Code

function setEntity($entity_type, $entity_id) {
  $this
    ->checkChange();

  // Ignore empty values.
  if (empty($entity_type) || empty($entity_id)) {
    return $this;
  }
  $this->entity_type = $entity_type;
  $this->entity_id = $entity_id;
  return $this;
}