You are here

function _userpoints_userpoints_transaction_properties in User Points 7

Returns properties of userpoints_transaction data object.

2 calls to _userpoints_userpoints_transaction_properties()
userpoints_rules_rules_data_info in ./userpoints_rules.rules.inc
Implements hook_rules_data_info().
userpoints_token_info in ./userpoints.module
Implements hook_token_info().

File

./userpoints.module, line 2065

Code

function _userpoints_userpoints_transaction_properties() {
  return array(
    'user' => array(
      'type' => 'user',
      'label' => t('User'),
      'description' => t('The user that will receive the !points', userpoints_translation()),
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'points' => array(
      'type' => 'integer',
      'label' => t('!Points', userpoints_translation()),
      'description' => t('Amount of !points to give or take.', userpoints_translation()),
      'restriction' => 'input',
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'tid' => array(
      'label' => t('!Points category', userpoints_translation()),
      'description' => t('The category to which these transaction belongs.'),
      'type' => 'integer',
      'options list' => 'userpoints_rules_get_categories',
      'restriction' => 'input',
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'entity' => array(
      'label' => t('Entity'),
      'type' => 'entity',
      'description' => t('The entity to which this transaction refers.'),
      'restriction' => 'input',
      'optional' => TRUE,
      'getter callback' => 'entity_metadata_verbatim_get',
    ),
    'description' => array(
      'label' => t('Description'),
      'type' => 'text',
      'description' => t('Can contain the reason why the points have been given.'),
      'restriction' => 'input',
      'optional' => TRUE,
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'reference' => array(
      'label' => t('Reference'),
      'type' => 'text',
      'description' => t('Can contain a reference for this transaction.'),
      'optional' => TRUE,
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'operation' => array(
      'label' => t('Operation'),
      'type' => 'text',
      'description' => t('Describes the operation (Insert/Remove/...).'),
      'restriction' => 'input',
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'reason' => array(
      'label' => t('Reason'),
      'type' => 'text',
      'description' => t('The reason why the points were granted.'),
      'restriction' => 'input',
    ),
    'time-stamp' => array(
      'label' => t('Timestamp'),
      'type' => 'date',
      'description' => t('Time when the points were given.'),
      'setter callback' => 'entity_metadata_verbatim_set',
      'getter callback' => 'entity_metadata_verbatim_get',
    ),
    'expirydate' => array(
      'label' => t('Expiry date'),
      'type' => 'date',
      'description' => t('Time when the points will expire.'),
      'setter callback' => 'entity_metadata_verbatim_set',
      'getter callback' => 'entity_metadata_verbatim_get',
    ),
    'display' => array(
      'label' => t('Display'),
      'type' => 'boolean',
      'description' => t('Whether to show a message to the user for this transaction or not.'),
      'setter callback' => 'entity_metadata_verbatim_set',
    ),
    'status' => array(
      'label' => t('Status'),
      'type' => 'integer',
      'description' => t('Status of this transaction.'),
      'options list' => 'userpoints_txn_status',
      'setter callback' => 'entity_metadata_verbatim_set',
      'getter callback' => 'entity_metadata_verbatim_get',
    ),
  );
}