You are here

class BeanCustom in Bean (for Drupal 7) 7

DO NOT USE THIS BEAN. ONLY USED FOR THE UI PLUGINS

Hierarchy

Expanded class hierarchy of BeanCustom

1 string reference to 'BeanCustom'
_bean_admin_default_plugin in bean_admin_ui/bean_admin_ui.module
The Default plugin settings

File

bean_admin_ui/plugins/BeanCustom.class.php, line 11
Bean ctools plugin

View source
class BeanCustom extends BeanPlugin {

  /**
   * Delete the record from the database.
   */
  public function delete() {
    db_delete('bean')
      ->condition('type', $this->type)
      ->execute();
    ctools_include('export');
    ctools_export_crud_delete('bean_type', $this->type);
    field_attach_delete_bundle('bean', $this->type);
    bean_reset();
  }

  /**
   * Save the record to the database
   */
  public function save($new = FALSE) {
    $bean_type = array(
      'name' => check_plain($this->type),
      'label' => check_plain($this
        ->getLabel()),
      'description' => check_plain($this
        ->getDescription()),
    );
    $primary_key = $new == FALSE ? 'name' : array();
    drupal_write_record('bean_type', $bean_type, $primary_key);
    bean_reset();
  }

  /**
   * Revert the bean type to code defaults.
   */
  public function revert() {
    ctools_include('export');
    ctools_export_crud_delete('bean_type', $this->type);
    bean_reset();
  }

  /**
   * Get the export status
   */
  public function getExportStatus() {
    return $this->plugin_info['export_status'];
  }

  /**
   * Set the label.
   *
   * @param label
   */
  public function setLabel($label) {
    $this->plugin_info['label'] = $label;
  }

  /**
   * Set the description.
   *
   * @param description
   */
  public function setDescription($description) {
    $this->plugin_info['description'] = $description;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BeanCustom::delete public function Delete the record from the database.
BeanCustom::getExportStatus public function Get the export status
BeanCustom::revert public function Revert the bean type to code defaults.
BeanCustom::save public function Save the record to the database
BeanCustom::setDescription public function Set the description.
BeanCustom::setLabel public function Set the label.
BeanPlugin::$plugin_info protected property
BeanPlugin::$type public property
BeanPlugin::buildURL public function Build the URL string Overrides BeanTypePluginInterface::buildURL
BeanPlugin::form public function The Plugin Form Overrides BeanTypePluginInterface::form 1
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::values public function Define the form values and their defaults Overrides BeanTypePluginInterface::values 1
BeanPlugin::view public function Return the block content. Overrides BeanTypePluginInterface::view
BeanPlugin::__construct public function Constructor Overrides BeanTypePluginInterface::__construct