0

I have an custome made entity

  function sbsl_order_entity_info() {
    $entitys = array();

    $entitys['sbsl_delivery_information'] = array(
      'label' => t('Delivery information'),
      'controller class' => 'EntityAPIController',
      'base table' => 'sbsl_delivery_information',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'delivery_information_id',
        'bundle' => 'bundle',
      ),
      'bundle keys' => array(
        'bundle' => 'bundle',
      ),
      'bundles' => array(),
      'load hook' => 'sbsl_order_delivery_information_load',
      'view modes' => array(
        'full' => array(
          'label' => t('Full content'),
          'custom settings' => FALSE,
        ),
      ),
    );

    return $entitys;
  }

I want to attach a form to my widget with field_attach_form

but can't figure out where i should define the form elements

1 Answer 1

2

You need to do more than simply declare the entity. The Entity Examples in https://www.drupal.org/project/examples will walk you through each step in the process of declaring the entity, defining the form, and adding menu hooks to be able to manage the entities and the field structure for both the form and display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.