class ViewsCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Properties

protected $configFactory
protected $moduleHandler
protected $entityTypeManager
protected $renderer

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, EntityTypeManagerInterface $entityTypeManager, RendererInterface $renderer)

ViewsCommands constructor.

LoggerInterface
logger()

Returns a logger object.

io()

Override Robo's IO function with our custom style.

printFile(string $file)

Print the contents of a file.

ConfigFactoryInterface
getConfigFactory()

No description

ModuleHandlerInterface
getModuleHandler()

No description

EntityTypeManagerInterface
getEntityTypeManager()

No description

RendererInterface
getRenderer()

No description

dev()

Set several Views settings to more developer-oriented values.

RowsOfFields
vlist($options = ['name' => self::REQ, 'tags' => self::REQ, 'status' => self::REQ, 'format' => 'table'])

Get a list of all views in the system.

string
execute($view_name, $display = null, $view_args = null, $options = ['count' => 0, 'show-admin-links' => false])

Execute a view and show a count of the results, or the rendered HTML.

RowsOfFields
analyze()

Get a list of all Views and analyze warnings.

enable(string $views)

Enable the specified views.

disable(string $views)

Disable the specified views.

cacheClear($types, $include_bootstrapped_types)

Adds a cache clear option for views.

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, EntityTypeManagerInterface $entityTypeManager, RendererInterface $renderer)

ViewsCommands constructor.

Parameters

ConfigFactoryInterface $configFactory
ModuleHandlerInterface $moduleHandler
EntityTypeManagerInterface $entityTypeManager
RendererInterface $renderer

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected io()

Override Robo's IO function with our custom style.

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

ConfigFactoryInterface getConfigFactory()

Return Value

ConfigFactoryInterface

ModuleHandlerInterface getModuleHandler()

Return Value

ModuleHandlerInterface

EntityTypeManagerInterface getEntityTypeManager()

Return Value

EntityTypeManagerInterface

RendererInterface getRenderer()

Return Value

RendererInterface

dev()

Set several Views settings to more developer-oriented values.

RowsOfFields vlist($options = ['name' => self::REQ, 'tags' => self::REQ, 'status' => self::REQ, 'format' => 'table'])

Get a list of all views in the system.

Parameters

$options

Return Value

RowsOfFields

string execute($view_name, $display = null, $view_args = null, $options = ['count' => 0, 'show-admin-links' => false])

Execute a view and show a count of the results, or the rendered HTML.

Parameters

$view_name
$display
$view_args
$options

Return Value

string

RowsOfFields analyze()

Get a list of all Views and analyze warnings.

Return Value

RowsOfFields

enable(string $views)

Enable the specified views.

Parameters

string $views A comma delimited list of view names.

disable(string $views)

Disable the specified views.

Parameters

string $views A comma delimited list of view names.

cacheClear($types, $include_bootstrapped_types)

Adds a cache clear option for views.

Parameters

$types
$include_bootstrapped_types