You are here

party_commerce.module in Party 8.2

Support for Drupal Commerce customer profiles.

File

modules/party_commerce/party_commerce.module
View source
<?php

/**
 * @file
 * Support for Drupal Commerce customer profiles.
 */

/**
 * Implements hook_party_data_set_info().
 */
function party_commerce_party_data_set_info() {
  $sets = array();
  foreach (commerce_customer_profile_type_get_name() as $type => $label) {
    $sets["commerce_customer_profile_" . $type] = array(
      'label' => $label,
      'entity type' => 'commerce_customer_profile',
      'entity bundle' => $type,
      'class' => 'PartyCustomerProfileDataSet',
      // Provide details of admin interfaces
      'admin' => array(
        'manage fields' => 'admin/commerce/customer-profiles/types/' . $type . '/fields',
        'manage display' => 'admin/commerce/customer-profiles/types/' . $type . '/display',
      ),
      // Provide a piece corresponding to each data set.
      'piece' => array(
        'path' => 'customer-profile-' . str_replace('_', '-', $type),
        'title' => $label,
        'maker' => 'view',
        'page callback' => 'party_view_data_set',
        'page arguments' => array(
          1,
          "commerce_customer_profile_" . $type,
        ),
        // @todo: this needs to tell the access arguments for party_access()
        // about the argument for loading our attached entities.
        // In other words, some sort of %wildcard_to_arg() function maybe?
        'access arguments' => array(
          "view any {$type} customer profile",
        ),
        // File path is relative to implementing module.
        'file' => 'party.pages.inc',
      ),
    );
  }
  return $sets;
}

/**
 * Controller class for CRM integration.
 *
 * @todo: move this to an inc file for autoloading.
 */
class PartyCustomerProfileDataSet extends PartyDefaultDataSet {

}

Functions

Classes

Namesort descending Description
PartyCustomerProfileDataSet Controller class for CRM integration.