You are here

class AssetViewsController in Asset 7

Hierarchy

Expanded class hierarchy of AssetViewsController

1 string reference to 'AssetViewsController'
asset_entity_info in ./asset.module
Implements hook_entity_info().

File

includes/asset.controllers.inc, line 104
Provides a controller classes for Asset and related entities

View source
class AssetViewsController extends EntityDefaultViewsController {

  /**
   * Alternative for hook_views_data().
   */
  public function views_data() {
    $data = parent::views_data();
    $table = $this->info['base table'];
    $data[$table]['aid'] = array(
      'title' => t('Aid'),
      'help' => t('The asset ID.'),
      'field' => array(
        'handler' => 'asset_views_handler_field_asset',
        'click sortable' => TRUE,
      ),
      'argument' => array(
        'handler' => 'asset_views_handler_argument_asset_aid',
        'name field' => 'title',
        'numeric' => TRUE,
        'validate type' => 'aid',
      ),
      'filter' => array(
        'handler' => 'views_handler_filter_numeric',
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      ),
    );
    $data[$table]['title'] = array(
      'title' => t('Title'),
      'help' => t('The asset title.'),
      'field' => array(
        'handler' => 'asset_views_handler_field_asset',
        'click sortable' => TRUE,
        'link_to_asset default' => TRUE,
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      ),
      'filter' => array(
        'handler' => 'views_handler_filter_string',
      ),
      'argument' => array(
        'handler' => 'views_handler_argument_string',
      ),
    );

    // Set proper filter handler to allow autocomplete on field.
    $data[$table]['uid']['filter']['handler'] = 'views_handler_filter_user_name';
    $data[$table]['edit_asset'] = array(
      'field' => array(
        'title' => t('Edit link'),
        'help' => t('Provide a simple link to edit the asset.'),
        'handler' => 'asset_views_handler_field_asset_link_edit',
      ),
    );
    $data[$table]['delete_asset'] = array(
      'field' => array(
        'title' => t('Delete link'),
        'help' => t('Provide a simple link to delete the asset.'),
        'handler' => 'asset_views_handler_field_asset_link_delete',
      ),
    );
    $data[$table]['insert_asset'] = array(
      'field' => array(
        'title' => t('Insert button'),
        'help' => t('Provide a button for assets library.'),
        'handler' => 'asset_views_handler_field_asset_link_insert',
      ),
    );
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AssetViewsController::views_data public function Alternative for hook_views_data(). Overrides EntityDefaultViewsController::views_data
EntityDefaultViewsController::$type protected property
EntityDefaultViewsController::getRelationshipHandlerClass public function Determines the handler to use for a relationship to an entity type.
EntityDefaultViewsController::map_from_schema_info protected function Comes up with views information based on the given schema and property info.
EntityDefaultViewsController::optionsListCallback public static function A callback returning property options, suitable to be used as views options callback.
EntityDefaultViewsController::schema_fields protected function Try to come up with some views fields with the help of the schema and the entity property information.
EntityDefaultViewsController::schema_revision_fields protected function Try to come up with some views fields with the help of the revision schema and the entity property information.
EntityDefaultViewsController::__construct public function