SilverStripe 2.4 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
Version: master
  • master
  • 3.1
  • 3.0
  • 2.4
  • tagfield

Packages

  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • publishers
    • reports
    • security
    • tasks
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • installer
  • None
  • PHP
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets

Classes

  • _DiffEngine
  • _DiffOp
  • _DiffOp_Add
  • _DiffOp_Change
  • _DiffOp_Copy
  • _DiffOp_Delete
  • CMSActionOptionsForm
  • Diff
  • LeftAndMain
  • LeftAndMainDecorator
  • MappedDiff
  • ModelAdmin
  • ModelAdmin_CollectionController
  • ModelAdmin_RecordController

Class ModelAdmin_CollectionController

Handles a managed model class and provides default collection filtering behavior.

Object
Extended by ViewableData implements IteratorAggregate
Extended by RequestHandler
Extended by Controller
Extended by ModelAdmin_CollectionController
Package: cms\core
Located at cms/code/ModelAdmin.php

Methods summary

public
# __construct( mixed $parent, mixed $model )

Overrides

RequestHandler::__construct
public string
# Link( string $action = null )

Appends the model class to the URL.

Appends the model class to the URL.

Parameters

$action
string
$action

Returns

string
public unknown
# getModelClass( )

Return the class name of the model being managed.

Return the class name of the model being managed.

Returns

unknown
public unknown
# handleActionOrID( unknown_type $request )

Delegate to different control flow, depending on whether the URL parameter is a number (record id) or string (action).

Delegate to different control flow, depending on whether the URL parameter is a number (record id) or string (action).

Parameters

$request
unknown_type
$request

Returns

unknown
public RecordController
# handleID( SS_HTTPRequest $request )

Delegate to the RecordController if a valid numeric ID appears in the URL segment.

Delegate to the RecordController if a valid numeric ID appears in the URL segment.

Parameters

$request
SS_HTTPRequest
$request

Returns

RecordController
public string
# getModelSidebar( )

Get a combination of the Search, Import and Create forms that can be inserted into a ModelAdmin sidebar.

Get a combination of the Search, Import and Create forms that can be inserted into a ModelAdmin sidebar.

Returns

string
public Form
# SearchForm( )

Get a search form for a single DataObject subclass.

Get a search form for a single DataObject subclass.

Returns

Form
public
# CreateForm( )

Create a form that consists of one button that directs to a give model's Add form

Create a form that consists of one button that directs to a give model's Add form

public
# showImportForm( )

Checks if a CSV import form should be generated by a className criteria or in general for ModelAdmin.

Checks if a CSV import form should be generated by a className criteria or in general for ModelAdmin.

public Form
# ImportForm( )

Generate a CSV import form for a single DataObject subclass.

Generate a CSV import form for a single DataObject subclass.

Returns

Form
public
# import( array $data, Form $form, SS_HTTPRequest $request )

Imports the submitted CSV file based on specifications given in self::model_importers. Redirects back with a success/failure message.

Imports the submitted CSV file based on specifications given in self::model_importers. Redirects back with a success/failure message.

Parameters

$data
array
$data
$form
Form
$form
$request
SS_HTTPRequest
$request
public
# columnsAvailable( )

Return the columns available in the column selection field. Overload this to make other columns available

Return the columns available in the column selection field. Overload this to make other columns available

public
# columnsSelectedByDefault( )

Return the columns selected by default in the column selection field. Overload this to make other columns selected by default

Return the columns selected by default in the column selection field. Overload this to make other columns selected by default

public
# ColumnSelectionField( )

Give the flexibilility to show variouse combination of columns in the search result table

Give the flexibilility to show variouse combination of columns in the search result table

public string
# search( mixed $request, mixed $form )

Action to render a data object collection, using the model context to provide filters and paging.

Action to render a data object collection, using the model context to provide filters and paging.

Returns

string
public SQLQuery
# getSearchQuery( mixed $searchCriteria )

Gets the search query generated on the SearchContext from DataObject::getDefaultSearchContext(), and the current GET parameters on the request.

Gets the search query generated on the SearchContext from DataObject::getDefaultSearchContext(), and the current GET parameters on the request.

Returns

SQLQuery
public
# getResultColumns( array $searchCriteria, boolean $selectedOnly = true )

Returns all columns used for tabular search results display. Defaults to all fields specified in DataObject->summaryFields().

Returns all columns used for tabular search results display. Defaults to all fields specified in DataObject->summaryFields().

Parameters

$searchCriteria
array
$searchCriteria Limit fields by populating the 'ResultsAssembly' key
$selectedOnly
boolean
$selectedOnly Limit by 'ResultsAssempty
public TableListField
# getResultsTable( array $searchCriteria )

Creates and returns the result table field for resultsForm. Uses resultsTableClassName() to initialise the formfield. Method is called from ModelAdmin_CollectionController::ResultsForm().

Creates and returns the result table field for resultsForm. Uses resultsTableClassName() to initialise the formfield. Method is called from ModelAdmin_CollectionController::ResultsForm().

Parameters

$searchCriteria
array
$searchCriteria passed through from ResultsForm

Returns

TableListField

Used by

ModelAdmin_CollectionController::ResultsForm()
public Form
# ResultsForm( mixed $searchCriteria )

Shows results from the "search" action in a TableListField.

Shows results from the "search" action in a TableListField.

Returns

Form

Uses

ModelAdmin_CollectionController::getResultsTable()
public unknown
# add( unknown_type $request )

Create a new model record.

Create a new model record.

Parameters

$request
unknown_type
$request

Returns

unknown
public Form
# AddForm( )

Returns a form suitable for adding a new model, falling back on the default edit form.

Returns a form suitable for adding a new model, falling back on the default edit form.

Caution: The add-form shows a DataObject's DataObject->getCMSFields() method on a record that doesn't exist in the database yet, hence has no ID. This means the DataObject->getCMSFields() implementation has to ensure that no fields are added which would rely on a record ID being present, e.g. HasManyComplexTableField.

Example:

function getCMSFields() {
  $fields = parent::getCMSFields();
    if($this->exists()) {
      $ctf = new HasManyComplexTableField($this, 'MyRelations', 'MyRelation');
      $fields->addFieldToTab('Root.Main', $ctf);
    }
  return $fields;
}

Returns

Form
public
# doCreate( mixed $data, mixed $form, mixed $request )

Methods inherited from Controller

CurrentMember(), Now(), PastMember(), PastVisitor(), can(), curr(), defaultAction(), disableBasicAuth(), getAction(), getFormOwner(), getRequest(), getResponse(), getSession(), getURLParams(), getViewer(), handleAction(), handleRequest(), hasAction(), hasActionTemplate(), has_curr(), init(), isAjax(), join_links(), popCurrent(), pushCurrent(), redirect(), redirectBack(), redirectedTo(), render(), setSession(), setURLParams()

Methods inherited from RequestHandler

allowedActions(), checkAccessAction(), httpError()

Methods inherited from ViewableData

ATT_val(), BaseHref(), CSSClasses(), CurrentPage(), Debug(), Even(), EvenOdd(), First(), FirstLast(), HasPerm(), IsAjax(), JS_val(), Last(), Me(), Middle(), MiddleString(), Modulus(), MultipleOf(), Odd(), Pos(), RAW_val(), SQL_val(), ThemeDir(), Top(), TotalItems(), XML_val(), __get(), __isset(), __set(), buildCastingCache(), cachedCall(), castingClass(), castingHelper(), castingHelperPair(), castingObjectCreator(), castingObjectCreatorPair(), customise(), defineMethods(), escapeTypeForField(), getField(), getIterator(), getSecurityID(), getXMLValues(), hasField(), hasValue(), i18nLocale(), iteratorProperties(), obj(), renderWith(), setCustomisedObj(), setField()

Methods inherited from Object

__call(), __toString(), addMethodsFrom(), addStaticVars(), addWrapperMethod(), add_extension(), add_static_var(), allMethodNames(), cacheToFile(), cacheToFileWithArgs(), clearCache(), combined_static(), create(), createMethod(), create_from_string(), exists(), extInstance(), extend(), getCustomClass(), getExtensionInstance(), getExtensionInstances(), get_extensions(), get_static(), hasExtension(), hasMethod(), has_extension(), invokeWithExtensions(), is_a(), loadCache(), parentClass(), parse_class_spec(), remove_extension(), sanitiseCachename(), saveCache(), set_stat(), set_static(), set_uninherited(), stat(), strong_create(), uninherited(), uninherited_static(), useCustomClass()

Magic methods summary

Properties summary

public mixed $parentController
#
protected mixed $modelClass
#
public mixed $showImportForm
#
public static array $url_handlers
#

Default URL handlers - (Action)/(ID)/(OtherID)

Default URL handlers - (Action)/(ID)/(OtherID)

Properties inherited from Controller

$action, $allowed_actions, $baseInitCalled, $basicAuthEnabled, $controller_stack, $request, $requestParams, $response, $session, $urlParams

Properties inherited from RequestHandler

$brokenOnConstruct

Properties inherited from ViewableData

$casting, $customisedObject, $default_cast, $failover, $iteratorPos, $iteratorTotalItems

Properties inherited from Object

$class, $extension_instances, $extensions

Comments

Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
Use the Silverstripe Forum to ask questions.
blog comments powered by Disqus
SilverStripe 2.4 API Docs API documentation generated by ApiGen 2.8.0