class ViewsCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands
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.

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

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 io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

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