\Dewdrop\Admin\Page\StockDebugListingSql

This page helps understand how your Listing's Select object is translated to SQL. It uses the getModifiedSelect() method of your Listing to ensure that sorts, filters, etc. are applied and then pretty-prints the SQL.

It might be cool to provide some basic profiling and index management features on this page, but that might be tricky when factoring in cross-platform support, etc.

Summary

Methods
Properties
Constants
renderView()
__construct()
createStockPage()
init()
shouldProcess()
process()
render()
url()
createResponseHelper()
getView()
setName()
getName()
No public properties found
No constants found
inflectViewScriptName()
$component
$view
$request
$viewScriptPath
N/A
stockSubclassHasViewScript()
getClassLocation()
$classLocation
$name
N/A

Properties

$view

$view : \Dewdrop\View\View

A view object available for rendering. Generally, your page should not be rendering any output directly, but instead passing information from models to the view and then rendering the view.

Type

\Dewdrop\View\View

$request

$request : \Dewdrop\Request

An object representing the current HTTP request. The is primarily around to make it easier to test your pages by injecting POST and GET data into the request object.

Type

\Dewdrop\Request

$viewScriptPath

$viewScriptPath : string

The path where this page's view script should be found.

Type

string

$classLocation

$classLocation : string

Type

string

$name

$name : string

The name used in the URL to route to this page.

Type

string

Methods

renderView()

renderView() : string

You can call renderView() directly from your render() method. Or, if your render method produces no output itself, the component will call this method itself to automatically render your view script.

Returns

string

__construct()

__construct(\Dewdrop\Admin\Component\ComponentInterface  $component, \Dewdrop\Request  $request, string  $viewScriptPath = null) 

Create a new page with a reference to its component and the file in which it is defined.

Also, by default, the page will be configured to look for view scripts in the view-scripts sub-folder of its component.

Parameters

\Dewdrop\Admin\Component\ComponentInterface $component
\Dewdrop\Request $request
string $viewScriptPath

createStockPage()

createStockPage(  $name) 

Parameters

$name

init()

init() : void

Create any resources that need to be accessible both for processing and rendering.

shouldProcess()

shouldProcess() : boolean

Whether this page's process method should be called. By default, process() is always called, but sub-classes like EditAbstract can alter that logic to make other common patterns easier to support.

Returns

boolean

process()

process(\Dewdrop\Admin\ResponseHelper\Standard  $response) 

Perform any processing or data manipulation needed before render.

A response helper object will be passed to this method to allow you to easily add success messages or redirects. This helper should be used to handle these kinds of actions so that you can easily test your page's code.

Parameters

\Dewdrop\Admin\ResponseHelper\Standard $response

render()

render() 

Get the processed SQL statement from the Listing, pretty print it, and pass it to our view script.

url()

url(string  $page, array  $params = array()) : string

As the component this page belongs to for a URL matching the provided page and query string parameters. This method should always be used for generating URLs in your components so that it will play nicely with various WP integration points like submenus.

Parameters

string $page
array $params

Returns

string

createResponseHelper()

createResponseHelper(callable  $redirector) : \Dewdrop\Admin\ResponseHelper\Standard

Create a response helper object for this page.

If your page would benefit from an alternative response helper with additional methods relevant to your use case, you can override this method and the helper will be injected into the page's process() method rather than the standard helper created in PageAbstract.

Parameters

callable $redirector

Returns

\Dewdrop\Admin\ResponseHelper\Standard

getView()

getView() : \Dewdrop\View\View

Get a reference to this page's view object.

Returns

\Dewdrop\View\View

setName()

setName(string  $name) : $this

Set the name used in the URL to route to this page.

Parameters

string $name

Returns

$this

getName()

getName() : string

Set the name used in the URL to route to this page.

Returns

string

inflectViewScriptName()

inflectViewScriptName() : string

Determine the view script name for this page by inflecting the page class name to all lower case with the words separated by hyphens.

For example, the following class name:

Admin\MyComponent\Index

Would become:

index.phtml

Returns

string

stockSubclassHasViewScript()

stockSubclassHasViewScript(  $scriptFilename) 

Parameters

$scriptFilename

getClassLocation()

getClassLocation()