You are here

class BeanTestPlugin in Bean (for Drupal 7) 7

Hierarchy

Expanded class hierarchy of BeanTestPlugin

2 string references to 'BeanTestPlugin'
BeanUnitTests::testBeanTypeURL in tests/BeanUnitTests.test
Test the URL of the bean types.
bean_test_bean_types in tests/bean_test.module
Implements hook_bean_types().

File

tests/bean_test.module, line 61
Primary hook implementations for the Bean Test module.

View source
class BeanTestPlugin extends BeanPlugin {
  public function values() {
    return array(
      'test_boolean' => TRUE,
      'test_string' => t('String'),
      'test_array' => array(
        'test_array_1' => 'test_array_1',
      ),
    );
  }
  public function form($bean, $form, &$form_state) {
    $form = array();
    $form['test_boolean'] = array(
      '#type' => 'textfield',
      '#title' => t('String'),
      '#default_value' => $bean->test_string,
    );
    $form['test_boolean'] = array(
      '#type' => 'checkbox',
      '#title' => t('Boolean'),
      '#default_value' => $bean->test_boolean,
    );
    $form['test_array'] = array(
      '#type' => 'string',
      '#title' => t('Array'),
      '#default_value' => $bean->test_array['test_array_1'],
    );
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BeanPlugin::$plugin_info protected property
BeanPlugin::$type public property
BeanPlugin::buildURL public function Build the URL string Overrides BeanTypePluginInterface::buildURL
BeanPlugin::getDescription public function Get the description Overrides BeanTypePluginInterface::getDescription
BeanPlugin::getInfo public function Get Plugin info Overrides BeanTypePluginInterface::getInfo
BeanPlugin::getLabel public function Get the label Overrides BeanTypePluginInterface::getLabel
BeanPlugin::isEditable public function Is the bean type editable Overrides BeanTypePluginInterface::isEditable
BeanPlugin::setBean public function Add a Bean to the plugin Overrides BeanTypePluginInterface::setBean
BeanPlugin::submit public function React to the saving of the bean Overrides BeanTypePluginInterface::submit
BeanPlugin::validate public function THe plugin validation function Overrides BeanTypePluginInterface::validate
BeanPlugin::view public function Return the block content. Overrides BeanTypePluginInterface::view
BeanPlugin::__construct public function Constructor Overrides BeanTypePluginInterface::__construct
BeanTestPlugin::form public function The Plugin Form Overrides BeanPlugin::form
BeanTestPlugin::values public function Define the form values and their defaults Overrides BeanPlugin::values