Class Subsite
A dynamically created subsite. SiteTree objects can now belong to a subsite. You can simulate subsite access without setting up virtual hosts by appending ?SubsiteID=<ID> to the request.
- Object
-
ViewableData
implements
IteratorAggregate
-
DataObject
implements
DataObjectInterface,
i18nEntityProvider
-
Subsite
implements
PermissionProvider
Direct known subclasses
Methods summary
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public
|
#
allowedThemes( )
Return the themes that can be used with this subsite, as an array of themecode => description |
public
|
|
public
|
#
onBeforeDelete( )
Event handler called before deleting from the database. You can overload this to clean up or otherwise process data before delete this record. Don't forget to call parent::onBeforeDelete(), though! |
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
an
|
#
getCMSActions( )
need to be overload by solid dataobject, so that the customised actions of that dataobject, including that dataobject's decorator customised actions could be added to the EditForm. |
public
|
|
public static
|
|
public static
integer
|
#
currentSubsiteID( )
This function gets the current subsite ID from the session. It used in the backend so Ajax requests use the correct subsite. The frontend handles subsites differently. It calls getSubsiteIDForDomain directly from ModelAsController::getNestedController. Only gets Subsite instances which have their IsPublic flag set to TRUE. |
public static
|
|
public
|
|
public
boolean
|
|
public
|
|
public static
integer
|
#
getSubsiteIDForDomain( mixed $host = null, mixed $returnMainIfNotFound = true )
Get a matching subsite for the given host, or for the current HTTP_HOST. |
public
|
|
public static
|
|
public
|
|
public
|
#
accessible_sites( mixed $permCode, mixed $includeMainSite = false, mixed $mainSiteTitle = "Main site", mixed $member = null )
Return the subsites that the current user can access. Look for one of the given permission codes on the site. |
public static
|
|
public
|
|
public
|
#
providePermissions( )
Return a map of permission codes to add to the dropdown shown in the Security
section of the CMS. array( |
public static
|
#
get_from_all_subsites( mixed $className, mixed $filter = "", mixed $sort = "", mixed $join = "", mixed $limit = "" )
|
public static
|
#
disable_subsite_filter( mixed $disabled = true )
Disable the sub-site filtering; queries will select from all subsites |
public
|
Methods inherited from DataObject
Aggregate(),
RelationshipAggregate(),
__construct(),
baseTable(),
belongs_to(),
buildDataObjectSet(),
buildSQL(),
can(),
canCreate(),
canDelete(),
canView(),
castedUpdate(),
composite_fields(),
context_obj(),
customDatabaseFields(),
custom_database_fields(),
data(),
databaseFields(),
databaseIndexes(),
database_extensions(),
database_fields(),
db(),
dbObject(),
debug(),
defaultSearchFilters(),
defineMethods(),
delete(),
delete_by_id(),
destroy(),
disableCMSFieldsExtensions(),
disable_subclass_access(),
enableCMSFieldsExtensions(),
enable_subclass_access(),
exists(),
extendedSQL(),
fieldLabel(),
fieldLabels(),
flushCache(),
flush_and_destroy_cache(),
forceChange(),
get(),
getAllFields(),
getChangedFields(),
getClassAncestry(),
getComponent(),
getComponents(),
getComponentsQuery(),
getDefaultSearchContext(),
getField(),
getFrontEndFields(),
getManyManyComponents(),
getManyManyComponentsQuery(),
getManyManyFilter(),
getManyManyJoin(),
getRemoteJoinField(),
getReverseAssociation(),
getTitle(),
get_by_id(),
get_one(),
get_validation_enabled(),
hasDatabaseField(),
hasField(),
hasOwnTableDatabaseField(),
hasValue(),
has_many(),
has_one(),
has_own_table(),
i18n_plural_name(),
i18n_singular_name(),
inheritedDatabaseFields(),
instance_get(),
instance_get_one(),
isChanged(),
isEmpty(),
isInDB(),
is_composite_field(),
many_many(),
many_many_extraFields(),
merge(),
newClassInstance(),
onAfterDelete(),
onBeforeWrite(),
plural_name(),
populateDefaults(),
provideI18nEntities(),
relObject(),
requireDefaultRecords(),
requireTable(),
reset(),
scaffoldFormFields(),
scaffoldSearchFields(),
searchableFields(),
setCastedField(),
setClassName(),
setComponent(),
setField(),
set_context_obj(),
set_validation_enabled(),
singular_name(),
summaryFields(),
toMap(),
update(),
validate(),
write(),
writeComponents(),
writeWithoutVersion()
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
escapeTypeForField(),
getIterator(),
getSecurityID(),
getXMLValues(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
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 static
boolean
|
$disable_subsite_filter |
#
$disable_subsite_filter If enabled, bypasses the query decoration to limit DataObject::get*() calls to a specific subsite. Useful for debugging. |
public static
mixed
|
$force_subsite |
#
Allows you to force a specific subsite ID, or comma separated list of IDs. Only works for reading. An object cannot be written to more than 1 subsite. |
public static
boolean
|
$write_hostmap | |
public static
string
|
$default_sort |
#
The default sort expression. This will be inserted in the ORDER BY clause of a SQL query if no other sort expression is provided. |
public static
array
|
$db |
#
Database field definitions. This is a map from field names to field type. The field type should be a class that extends . |
public static
array
|
$has_one |
#
One-to-zero relationship defintion. This is a map of component name to data
type. In order to turn this into a true one-to-one relationship you can add a
|
public static
array
|
$has_many |
#
This defines a one-to-many relationship. It is a map of component name to the remote data class. |
public static
array
|
$belongs_many_many |
#
The inverse side of a many-many relationship. This is a map from component name to data type. |
public static
array
|
$defaults |
#
Inserts standard column-values when a DataObject is instanciated. Does not
insert default records |
public static
array
|
$searchable_fields |
#
Default list of fields that can be scaffolded by the ModelAdmin search interface. |
public static
array
|
$summary_fields |
#
Provides a default list of fields to be used by a 'summary' view of this object. |
protected static
string
|
$mainsite_language | |
protected static
array
|
$allowed_themes |
#
$allowed_themes Numeric array of all themes which are allowed to be selected for all subsites. Corresponds to subfolder names within the /themes folder. By default, all themes contained in this folder are listed. |
public static
string
|
$mainsite_domain |
Properties inherited from DataObject
$allowed_actions,
$ancestry,
$api_access,
$belongs_to,
$brokenOnDelete,
$brokenOnWrite,
$cache_get_one,
$cache_has_own_table,
$cache_has_own_table_field,
$casting,
$componentCache,
$components,
$create_table_options,
$default_records,
$destroyed,
$field_labels,
$indexes,
$many_many,
$many_many_extraFields,
$original,
$plural_name,
$record,
$singular_name
Properties inherited from ViewableData
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems