$fieldGroupsFilter
$fieldGroupsFilter : \Dewdrop\Fields\Filter\Groups
A filter that can be used to sort and group fields according to user-defined selections.
CrudAbstract basically provides some shortcuts to implementing the CrudInterface used for all the stock CRUD functionality in the Dewdrop admin. It's a little fiddly, really. There are several cases where you might find yourself calling parent::someMethod() and then modifying the bit that was provided by CrudAbstract. But it does save some boilerplate if you're cranking out lots of CRUD components.
$fieldGroupsFilter : \Dewdrop\Fields\Filter\Groups
A filter that can be used to sort and group fields according to user-defined selections.
$visibilityFilter : \Dewdrop\Fields\Filter\Visibility
A filter to determine which fields should be displayed in a Component's Listing.
$listing : \Dewdrop\Fields\Listing
The Listing used by the component.
$rowEditor : \Dewdrop\Fields\RowEditor
The RowEditor used to save changes back to row objects.
$pimple : \Pimple
The Pimple object used to supply dependencies to the admin component.
Basically used as a service locator in this context, which makes testability a bit trickier in the context of the component class itself. However, it makes using component classes in other contexts (e.g. testing your page classes) much easier.
$env : \Dewdrop\Admin\Env\EnvInterface
The admin environment. Used to do anything environment (i.e. WP or Silex) specific, like perform redirects.
$model : \Dewdrop\Db\Table
$primaryKeyField : \Dewdrop\Db\Field
$deleteField : \Dewdrop\Db\Field
$listingSelect : \Dewdrop\Db\Select
$menuPosition : integer
The position this item should take in the admin navigation menu.
To see the current menu positions, you can var_dump($_GLOBALS['menu']). Note that is you pick an already used menu position, you will essentially hide that item. For example, if you set your menu position to "5", which is the default value for "Posts", your component will show up there instead of "Posts", rather than just pushing "Posts" further down like you might expect. You can leave $menuPosition blank if you'd simply like your component to be appended to the end of the menu.
$customPageFactory : \Dewdrop\Admin\PageFactory\Custom
A page factory to allow overriding of page classes that come from other factories.
$permissions : \Dewdrop\Admin\Permissions
The permissions for this component.
$activityLogHandler : \Dewdrop\ActivityLog\Handler\HandlerInterface
getActivityLogHandler() : \Dewdrop\ActivityLog\Handler\HandlerInterface
getFieldGroupsFilter() : \Dewdrop\Fields\Filter\Groups
Get the sorting/grouping fields filter.
getVisibilityFilter() : \Dewdrop\Fields\Filter\Visibility
Get the visibility filter for listing fields.
getRowEditor() : \Dewdrop\Fields\RowEditor
Get the row editor for saving changes to records in the component. You'll need to tell the row editor how to link rows for your component.
getInflector() : \Dewdrop\Inflector
Get a Inflector object.
getPaths() : \Dewdrop\Paths
Get a Paths object.
None found |
getRequest() : \Dewdrop\Request
Get a Request object.
None found |
getDb() : \Dewdrop\Db\Adapter
Get the DB adapter associated with this component. This is used frequently by page classes to get access to the DB connection.
None found |
None found |
getPermissions() : \Dewdrop\Admin\Permissions
Get the Permissions object for this component.
None found |
createPageObject(string $name) : \Dewdrop\Admin\Page\PageAbstract|false
Iterate over the page factories, attempting to create a page object for the supplied name. If no page factory can handle the page name, that's a 404.
string | $name |
None found |
url(string $page, array $params = array())
Request that the admin Env assemble a URL that will work to get to the specified page.
string | $page | |
array | $params |
returns |
string |
---|
addToSubmenu(string $title, string $page, array $params = array()) : \Dewdrop\Admin\Component\ComponentAbstract
Add a link to the submenu for this component.
string | $title | |
string | $page | |
array | $params |
None found |
addSubmenuDivider() : $this
Add a divider to the component's submenu.
None found |
getSubmenuPages() : array
Get all sub-menu pages that have been added to this component.
None found |
getName() : string
Get the name of the component (i.e. the string that would represent it in the URL.
None found |
setEnv(\Dewdrop\Admin\Env\EnvInterface $env) : $this
Allow overriding of the admin environment after instantiation.
\Dewdrop\Admin\Env\EnvInterface | $env |
None found |
setTitle(string $title) : \Dewdrop\Admin\Component\ComponentAbstract
Set the title of this component as it should be displayed in the admin menu.
string | $title |
None found |
getTitle() : string
Get the title of the component that would be displayed in the admin menu.
None found |
setBadgeContent(string $badgeContent) : $this
Set the badge content that should be displayed alongside this component's navigation.
string | $badgeContent |
None found |
getBadgeContent() : string
Get the badge content assigned to this component.
None found |
setIcon(string $icon) : \Dewdrop\Admin\Component\ComponentAbstract
Set the icon that should be used in this component's admin menu entry.
string | $icon |
None found |
getIcon() : string
Get the icon that should be displayed for the component in the admin menu.
None found |
setMenuPosition(integer $menuPosition) : \Dewdrop\Admin\Component\ComponentAbstract
Set the position of the component's menu entry
integer | $menuPosition |
None found |
getMenuPosition() : integer
Get the position at which this component should be rendered in the admin shell nav menu.
None found |
None found |
setActivityLogHandler(\Dewdrop\ActivityLog\Handler\HandlerInterface $activityLogHandler) : $this
\Dewdrop\ActivityLog\Handler\HandlerInterface | $activityLogHandler |
None found |
getFullyQualifiedName() : string
Get a fully-qualified name for the component that can be used when referencing the component in externals systems like the DB.
None found |
getListingQueryParamsSessionName() : string
Get an identifier that can be used when storing this component's listing query string parameters in the session. We store the params so that we can redirect while maintaining filter and pagination state.
None found |
getPageFactories() : array
Get all the page factories associated with this component.
None found |
getCustomPageFactory() : \Dewdrop\Admin\PageFactory\Custom
Get the custom page factory for this component.
None found |
addPageFactory(\Dewdrop\Admin\PageFactory\PageFactoryInterface $pageFactory) : $this
Add a new page factory to this component.
\Dewdrop\Admin\PageFactory\PageFactoryInterface | $pageFactory |
None found |
onPageDispatch( $pageName, callable $callback) : $this
Register a callback to run when the page matching the supplied name is dispatched on this component. Your callback will receive the new page object as its first argument.
$pageName | ||
callable | $callback |
None found |
dispatchPage(mixed $page = null, \Dewdrop\Admin\Response $response = null) : mixed
Dispatch the routed page, working through its init(), process() and render() methods.
Each abstract page class can specify whether the process() method should actually be run by implementing a shouldProcess() method. The page's init() method is guaranteed to always be called. If after calling render there is no output, the component will attempt to render the page's default view script automatically.
mixed | $page | |
\Dewdrop\Admin\Response | $response |
None found |
setShouldRenderLayout(boolean $shouldRenderLayout) : $this
Set whether the admin environment should wrap the page's output with the layout (the admin shell chrome).
boolean | $shouldRenderLayout |
None found |
shouldRenderLayout() : boolean
Check to see whether the page output should be wrapped by the layout.
None found |
getSlug() : string
Get WP slug for this component.
We use the component name, with namespace back slashes replaced with URL-friendly front slashes, as the slug.
None found |
createPrimaryModel() : \Dewdrop\Db\Table
None found |
getPrimaryModel() : \Dewdrop\Db\Table
Get the primary model that is used by this component. This model will be used to provide page and button titles. By default, its primary key will also be used to filter the listing when needed (e.g. when viewing a single item rather than the full listing).
None found |
getListing() : \Dewdrop\Fields\Listing
Get a \Dewdrop\Fields\Listing object that allows the component to retrieve records for viewing. The Listing handles applying user sorts and filters.
None found |
checkRequiredProperties()
Make sure the title property was set in the component's init() method.
None found |
renderJsonResponse(array $output) : void
Render the supplied output as a JSON response. This method is mostly in place to allow mocking (and thus dodging the exit statement) during testing.
array | $output |
None found |
setListingSelect(\Dewdrop\Db\Select $listingSelect)
\Dewdrop\Db\Select | $listingSelect |
None found |
setPrimaryKeyField(\Dewdrop\Db\Field $primaryKeyField)
\Dewdrop\Db\Field | $primaryKeyField |
None found |
setDeleteField(\Dewdrop\Db\Field $deleteField)
\Dewdrop\Db\Field | $deleteField |
None found |
executePageDispatchCallbacks(\Dewdrop\Admin\Page\PageAbstract $page) : $this
Run any page dispatch callbacks assigned to the provided page. We support both the WP and hyphen-separated versions of the page names in this method to make it easier to reuse page dispatch code across different environments.
\Dewdrop\Admin\Page\PageAbstract | $page |
None found |