Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • 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
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • ControllerSubsites
  • FileSubsites
  • GroupSubsites
  • LeftAndMainSubsites
  • MemberSubsites
  • Subsite
  • Subsite_Template
  • SubsiteAdmin
  • SubsitesTreeDropdownField

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
Extended by ViewableData implements IteratorAggregate
Extended by DataObject implements DataObjectInterface, i18nEntityProvider
Extended by Subsite implements PermissionProvider

Direct known subclasses

Subsite_Template

Package: subsites
Located at subsites/code/Subsite.php

Methods summary

public static
# set_mainsite_language( mixed $val )
public static
# get_mainsite_language( )
public static
# set_mainsite_domain( mixed $domain )
public static
# get_mainsite_domain( )
public static
# set_allowed_domains( mixed $domain )
public static
# set_allowed_themes( mixed $themes )
public
# allowedThemes( )

Return the themes that can be used with this subsite, as an array of themecode => description

Return the themes that can be used with this subsite, as an array of themecode => description

public
# getLanguage( )
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!

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!

Uses

DataObjectDecorator::onBeforeDelete()

Overrides

DataObject::onBeforeDelete
public
# onAfterWrite( )

Whenever a Subsite is written, rewrite the hostmap

Whenever a Subsite is written, rewrite the hostmap

Overrides

DataObject::onAfterWrite
public string
# domain( )

Return the domain of this site

Return the domain of this site

Returns

string
The full domain name of this subsite (without protocol prefix)
public
# getPrimaryDomain( )
public
# absoluteBaseURL( )
public FieldSet
# getCMSFields( )

Show the configuration fields for each subsite

Show the configuration fields for each subsite

Returns

FieldSet
Returns a TabSet for usage within the CMS - don't use for frontend forms.

Overrides

DataObject::getCMSFields
public
# getClassName( )
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.

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.

Returns

an
Empty FieldSet(); need to be overload by solid subclass

Overrides

DataObject::getCMSActions
public
# adminDuplicate( )
public static Subsite
# currentSubsite( )

Gets the subsite currently set in the session.

Gets the subsite currently set in the session.

Returns

Subsite
Subsite

Uses

ControllerSubsites::controllerAugmentInit()
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.

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.

You can simulate subsite access without creating virtual hosts by appending ?SubsiteID=<ID> to the request.

Returns

integer
ID of the current subsite instance
public static
# changeSubsite( integer|Subsite $subsite )

Switch to another subsite.

Switch to another subsite.

Parameters

$subsite
int|Subsite $subsite Either the ID of the subsite, or the subsite object itself
public
# activate( )

Make this subsite the current one

Make this subsite the current one

public boolean
# canEdit( )

Returns

boolean
boolean

Overrides

DataObject::canEdit
public
# Lang( )
public static integer
# getSubsiteIDForDomain( mixed $host = null, mixed $returnMainIfNotFound = true )

Get a matching subsite for the given host, or for the current HTTP_HOST.

Get a matching subsite for the given host, or for the current HTTP_HOST.

Parameters

$host
$host The host to find the subsite for. If not specified, $_SERVER['HTTP_HOST'] is used.
$returnMainIfNotFound

Returns

integer
Subsite ID
public
# getMembersByPermission( mixed $permissionCodes = array('ADMIN') )
public static
# hasMainSitePermission( mixed $member = null, mixed $permissionCodes = array('ADMIN') )
public DataObject
# duplicate( )

Duplicate this subsite

Duplicate this subsite

Returns

DataObject
A duplicate of this node. The exact type will be the type of this node.

Overrides

DataObject::duplicate
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.

Return the subsites that the current user can access. Look for one of the given permission codes on the site.

Sites and Templates will only be included if they have a Title

Parameters

$permCode
$permCode array|string Either a single permission code or an array of permission codes.
$includeMainSite
$includeMainSite If true, the main site will be included if appropriate.
$mainSiteTitle
$mainSiteTitle The label to give to the main site
$member
public static
# writeHostMap( mixed $file = null )

Write a host->domain map to assets/_host-map.php

Write a host->domain map to assets/_host-map.php

This is used primarily when using subsites in conjunction with StaticPublisher

public
# adminSearchFields( )

Return the FieldSet that will build the search form in the CMS

Return the FieldSet that will build the search form in the CMS

public
# providePermissions( )

Return a map of permission codes to add to the dropdown shown in the Security section of the CMS. array(
'VIEW_SITE' => 'View the site', );

Return a map of permission codes to add to the dropdown shown in the Security section of the CMS. array( 'VIEW_SITE' => 'View the site', );

Implementation of

PermissionProvider::providePermissions()
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

Disable the sub-site filtering; queries will select from all subsites

public
# importDomain( mixed $domain, mixed $record )

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.

$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.

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.

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 .

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 DataObject::$belongs_to relationship on the child class.

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 DataObject::$belongs_to relationship on the child class.

Note that you cannot have a has_one and belongs_to relationship with the same name.

public static array $has_many
#

This defines a one-to-many relationship. It is a map of component name to the remote data class.

This defines a one-to-many relationship. It is a map of component name to the remote data class.

This relationship type does not actually create a data structure itself - you need to define a matching $has_one relationship on the child class. Also, if the $has_one relationship on the child class has multiple links to this class you can use the syntax "ClassName.HasOneRelationshipName" in the remote data class definition to show which foreign key to use.

public static array $belongs_many_many
#

The inverse side of a many-many relationship. This is a map from component name to data type.

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 DataObject::$default_records. This is a map from fieldname to default value.

Inserts standard column-values when a DataObject is instanciated. Does not insert default records DataObject::$default_records. This is a map from fieldname to default value.

  • If you would like to change a default value in a sub-class, just specify it. - If you would like to disable the default value given by a parent class, set the default value to 0,'',or false in your subclass. Setting it to null won't work.
public static array $searchable_fields
#

Default list of fields that can be scaffolded by the ModelAdmin search interface.

Default list of fields that can be scaffolded by the ModelAdmin search interface.

Overriding the default filter, with a custom defined filter:

       static $searchable_fields = array(
          "Name" => "PartialMatchFilter"
);

Overriding the default form fields, with a custom defined field. The 'filter' parameter will be generated from DBField::$default_search_filter_class. The 'title' parameter will be generated from DataObject->fieldLabels().

       static $searchable_fields = array(
          "Name" => array(
                       "field" => "TextField"
               )
);

Overriding the default form field, filter and title:

       static $searchable_fields = array(
          "Organisation.ZipCode" => array(
                       "field" => "TextField",
                       "filter" => "PartialMatchFilter",
                       "title" => 'Organisation ZIP'
               )
);
public static array $summary_fields
#

Provides a default list of fields to be used by a 'summary' view of this object.

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.

$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

Properties inherited from Object

$class, $extension_instances, $extensions

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0