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

  • Catalog
  • CatalogAdmin
  • CatalogCMSActionDecorator
  • CatalogMemberDecorator
  • CatalogPrice
  • CMSSiteTreeFilter_Catalog
  • Monument
  • MonumentCatalog
  • MonumentForm
  • Orders1CExchange_SiteConfig
  • PaymentType
  • Product
  • ProductCatalogSiteConfig
  • ProductSearchPage
  • SimpleOrderButton
  • SimpleOrderData
  • SimpleOrderForm
  • SimpleOrderPage
  • StartCatalog
  • VirtualProduct

Interfaces

  • OrderButtonInterface

Class Product

Запчасть в каталоге

Object
Extended by ViewableData implements IteratorAggregate
Extended by DataObject implements DataObjectInterface, i18nEntityProvider
Extended by SiteTree implements PermissionProvider, i18nEntityProvider
Extended by Page
Extended by MediawebPage
Extended by Product

Direct known subclasses

Monument, SocleSize

Package: Catalog
Author: inxo, dvp, menedem
Located at catalog/code/Product.php

Methods summary

public static
# get_possible_filter_fields( )
public static
# set_searchable_fields( array $data )

Позволяет задать поля для фильтра товаров Фильтр исопльзуется в админке и при фильтрации товаров в каталоге

Позволяет задать поля для фильтра товаров Фильтр исопльзуется в админке и при фильтрации товаров в каталоге

Parameters

$data
array $data
public static array
# get_searchable_fields( )

Возвращает текущие настроки полей для фильтрации

Возвращает текущие настроки полей для фильтрации

Returns

array
array
public static
# set_sort_options( array $data )

Изменяет список сортировок товаров. Используется в _config.php для настройки параметров каталога

Изменяет список сортировок товаров. Используется в _config.php для настройки параметров каталога

Parameters

$data
array $data - новый список сортировок
public static array
# get_sort_options( )

Возвращает текущий список сортировок товаров

Возвращает текущий список сортировок товаров

Returns

array
- текущий список сортировок
public static string
# sort_options_orderby( mixed $sort )

Возвращает выражение order by для выбранной сортировки

Возвращает выражение order by для выбранной сортировки

Returns

string
string
public static array
# sort_options_dropdown_map( boolean $addDefault = false )

Возвращает локализованный список сортировок для использования в селектах

Возвращает локализованный список сортировок для использования в селектах

Parameters

$addDefault
bool $addDefault - добавлять ли пункт "по-умолчанию"

Returns

array
- список для селектов
public static
# allow_order_empty_price( mixed $val = true )
public static
# set_order_button_class( mixed $value )
public static
# set_empty_order_button_class( mixed $value )
public static array
# get_simple_order_additional_fields( )

Получить список дополнительных полей для формы простого заказа

Получить список дополнительных полей для формы простого заказа

Returns

array
array
public static
# add_simple_order_additional_field( string $name, array $params )

Добавить дополнительное поле в форму простого заказа

Добавить дополнительное поле в форму простого заказа

Parameters

$name
string $name - название
$params
array $params - параметры
public static
# set_simple_order_additional_fields( array $fields )

Задать дополнительные поля формы простого заказа

Задать дополнительные поля формы простого заказа

Parameters

$fields
array $fields - поля формы
public
# WeightNice( )
public
# getKilosWeight( )
public Image
# MainPhoto( )

Возвращаем основное фото товара Если есть has_one Photo, то его, иначе первое из прикрепленной галереи

Возвращаем основное фото товара Если есть has_one Photo, то его, иначе первое из прикрепленной галереи

Returns

Image
Image
public ComponentSet
# AllPhotos( )

Список всех фото товара Если есть has_one Photo, то вставляем его первым

Список всех фото товара Если есть has_one Photo, то вставляем его первым

Returns

ComponentSet
ComponentSet
public
# ListParamValues( )
public
# ViewParamValues( )
public
# ParamValue( mixed $title )
public
# GroupedProducts( )
public
# AvailableTitle( )
public
# defaultSearchColumns( )
public
# __construct( array|null $record = null, boolean $isSingleton = false )

Construct a new DataObject.

Construct a new DataObject.

Parameters

$record
array|null $record This will be null for a new database record. Alternatively, you can pass an array of field values. Normally this contructor is only used by the internal systems that get objects from the database.
$isSingleton
boolean $isSingleton This this to true if this is a singleton() object, a stub for calling methods. Singletons don't have their defaults set.

Overrides

DataObject::__construct
public static
# import_find( mixed $importID )
public static
# addPossibleFields( array $fields )

Добавление полей, которые могут быть в данных импорта

Добавление полей, которые могут быть в данных импорта

Parameters

$fields
array $fields
public
# getProductAdminLink( )
public boolean
# importUpdate( mixed $importLog, mixed $data )

Обновляет объект,

Обновляет объект,

Parameters

$importLog
$importLog - объект для протоколиорвания импорта (или сама задача), для возможности записать сообщения об ошибках
$data
$data - массив с данными для импорта

Returns

boolean
- флаг можно ли продолжать импорт
public static
# import_parse_bool_value( mixed $value )
public boolean
# importValidate( mixed $importLog, mixed & $data )

Проверяет данные полей объекта на соответствие типам

Проверяет данные полей объекта на соответствие типам

Parameters

$importLog
$importLog - объект для протоколиорвания импорта (или сама задача), для возможности записать сообщения об ошибках
$data

Returns

boolean
- флаг можно ли продолжать импорт
public
# importClearAll( mixed $importLog )

Выполняет удаление всех объектов перед импортом

Выполняет удаление всех объектов перед импортом

public FieldSet
# getCMSFields( )

Returns a FieldSet with which to create the CMS editing form.

Returns a FieldSet with which to create the CMS editing form.

You can override this in your child classes to add extra fields - first get the parent fields using parent::getCMSFields(), then use addFieldToTab() on the FieldSet.

Returns

FieldSet
The fields to be displayed in the CMS.

Overrides

MediawebPage::getCMSFields
public
# getVariationsTable( )
public FieldSet
# getCMSActions( )

Get the actions available in the CMS for this page - eg Save, Publish.

Get the actions available in the CMS for this page - eg Save, Publish.

Returns

FieldSet
The available actions for this page.

Overrides

SiteTree::getCMSActions
public
# populateDefaults( )

Load the default values in from the self::$defaults array. Will traverse the defaults of the current class and all its parent classes. Called by the constructor when creating new records.

Load the default values in from the self::$defaults array. Will traverse the defaults of the current class and all its parent classes. Called by the constructor when creating new records.

Uses

DataObjectDecorator::populateDefaults()

Overrides

Page::populateDefaults
public
# onBeforeWrite( )

Event handler called before writing to the database. You can overload this to clean up or otherwise process data before writing it to the database. Don't forget to call parent::onBeforeWrite(), though!

Event handler called before writing to the database. You can overload this to clean up or otherwise process data before writing it to the database. Don't forget to call parent::onBeforeWrite(), though!

This called after $this->validate(), so you can be sure that your data is valid.

Uses

DataObjectDecorator::onBeforeWrite()

Overrides

Page::onBeforeWrite
public
# onAfterDelete( )

Overrides

MediawebPage::onAfterDelete
public
# getVAT( )
public DataObjectSet
# VirtualPages( )

Список виртуальных товаров связанных с текущим

Список виртуальных товаров связанных с текущим

Returns

DataObjectSet
DataObjectSet

Overrides

SiteTree::VirtualPages
public boolean
# canCreate( Member $member = null )

This function should return true if the current user can create new pages of this class. It can be overloaded to customise the security model for an application.

This function should return true if the current user can create new pages of this class. It can be overloaded to customise the security model for an application.

Denies permission if any of the following conditions is TRUE:

  • canCreate() returns FALSE on any decorator
  • $can_create is set to FALSE and the site is not in "dev mode"

Use Page::canAddChildren() to control behaviour of creating children under this page.

Parameters

$member
Member $member

Returns

boolean
True if the current user can create pages on this class.

Uses

mixed
DataObjectDecorator::canCreate()

Overrides

SiteTree::canCreate
public array|string
# fieldLabels( boolean $includerelations = true )

Parameters

$includerelations
boolean $includerelations a boolean value to indicate if the labels returned include relation fields

Returns

array|string
Array of all element labels if no argument given, otherwise the label of the field

Overrides

SiteTree::fieldLabels
public string
# orderButtonClass( )

Возвращает класс для кнопки заказа товара в зависимости от цены и значений Product::$empty_order_button_class и Product::$order_button_class

Возвращает класс для кнопки заказа товара в зависимости от цены и значений Product::$empty_order_button_class и Product::$order_button_class

Returns

string
string
public OrderButtonInterface
# OrderButton( )

Возвращает объект для генерации кнопки заказа

Возвращает объект для генерации кнопки заказа

Returns

OrderButtonInterface
OrderButtonInterface
public string
# OrderButtonOne( )

Возвращает html для кнопки заказа 1 товара

Возвращает html для кнопки заказа 1 товара

Returns

string
string
public string
# OrderButtonWithNum( )

Возвращает html для кнопки заказа товара с оплем для кол-ва

Возвращает html для кнопки заказа товара с оплем для кол-ва

Returns

string
string
public CatalogPrice
# getRealPrice( )

возвращает цену товара без скидок

возвращает цену товара без скидок

Returns

CatalogPrice
CatalogPrice
public mixed
# Price( boolean $onlyreal = false )

Возвращает центу товара с учетом скидок

Возвращает центу товара с учетом скидок

Parameters

$onlyreal
bool $onlyreal - вернуть только 1 цену

Returns

mixed
mixed
public
# OldPrice( )
public
# HasDiscount( )
public
# Currency( )
public
# getOrderItem( )
public
# AvailableVariations( )
public
# AllowPurchaseVariations( )
public ComponentSet
# AllVariations( )

Вариации товара В зависимости от настроек либо все вариации, либо только доступные (Available = 1)

Вариации товара В зависимости от настроек либо все вариации, либо только доступные (Available = 1)

Returns

ComponentSet
ComponentSet
public
# MinPriceVariation( )
public
# MaxPriceVariation( )
public
# HasSomePrices( )
public html
# VariationsSelector( )

Селектор для выбора вариации

Селектор для выбора вариации

Returns

html
html
public
# VariationsParamValues( )
public static
# combine_variations( mixed $variations )
public
# VariationOrderButtonLink( mixed $ID = '' )
public
# PurchaseStatus( )
public
# PurchaseStatusTitle( )
public
# canOrder( )

Methods inherited from MediawebPage

FileCount(), Identify(), ImageCount(), duplicate()

Methods inherited from Page

AdminEmail(), DevMode(), FinalParent(), Lang(), Locale(), MetaTags(), NestedValue(), allowComments(), canAddChildren(), canDelete(), canDeleteFromLive(), canEdit(), canPublish(), checkDevPermisson(), hiddenCMSFields(), hide_cms_fields(), onAfterWrite(), set_hidden_cms_fields()

Methods inherited from SiteTree

AbsoluteLink(), Breadcrumbs(), CMSTreeClasses(), Comments(), ContentSource(), DependentPages(), DependentPagesCount(), ElementName(), InSection(), Level(), Link(), LinkOrCurrent(), LinkOrSection(), LinkingMode(), NestedTitle(), RelativeLink(), TreeTitle(), allowedChildren(), batch_permission_check(), can(), canView(), can_delete_multiple(), can_edit_multiple(), cmsCleanup_parentChanged(), collateDescendants(), defaultChild(), defaultParent(), disableCMSFieldsExtensions(), disable_nested_urls(), doDeleteFromLive(), doPublish(), doRestoreToStage(), doRevertToLive(), doRollbackTo(), doUnpublish(), duplicateAsChild(), duplicateWithChildren(), enableCMSFieldsExtensions(), enable_nested_urls(), generateURLSegment(), generate_homepage_domain_map(), getAbsoluteLiveLink(), getClassDropdown(), getExistsOnLive(), getIsAddedToStage(), getIsDeletedFromStage(), getIsModifiedOnStage(), getMenuTitle(), getParent(), getParentType(), getSiteConfig(), get_by_link(), get_enforce_strict_hierarchy(), i18n_singular_name(), isCurrent(), isNew(), isPublished(), isSection(), link_shortcode_handler(), nested_urls(), onBeforeDelete(), page_type_classes(), prepopuplate_permission_cache(), provideI18nEntities(), providePermissions(), requireDefaultRecords(), reset(), rewriteFileURL(), setMenuTitle(), setParent(), set_enforce_strict_hierarchy(), syncLinkTracking(), validURLSegment()

Methods inherited from DataObject

Aggregate(), RelationshipAggregate(), baseTable(), belongs_to(), buildDataObjectSet(), buildSQL(), 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(), disable_subclass_access(), enable_subclass_access(), exists(), extendedSQL(), fieldLabel(), 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(), inheritedDatabaseFields(), instance_get(), instance_get_one(), isChanged(), isEmpty(), isInDB(), is_composite_field(), many_many(), many_many_extraFields(), merge(), newClassInstance(), plural_name(), relObject(), requireTable(), 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 $can_be_root
#

Controls whether a page can be in the root of the site tree.

Controls whether a page can be in the root of the site tree.

public static array $allowed_children
#

Indicates what kind of children this page type can have. This can be an array of allowed child classes, or the string "none" - indicating that this page type can't have children. If a classname is prefixed by "*", such as "*Page", then only that class is allowed - no subclasses. Otherwise, the class and all its subclasses are allowed.

Indicates what kind of children this page type can have. This can be an array of allowed child classes, or the string "none" - indicating that this page type can't have children. If a classname is prefixed by "*", such as "*Page", then only that class is allowed - no subclasses. Otherwise, the class and all its subclasses are allowed.

public static string $default_parent
#

The default parent class for this page.

The default parent class for this page.

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 $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 $casting
#

Use a casting object for a field. This is a map from field name to class name of the casting object.

Use a casting object for a field. This is a map from field name to class name of the casting object.

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 $indexes
#

If a field is in this array, then create a database index on that field. This is a map from fieldname to index type. See SS_Database->requireIndex() and custom subclasses for details on the array notation.

If a field is in this array, then create a database index on that field. This is a map from fieldname to index type. See SS_Database->requireIndex() and custom subclasses for details on the array notation.

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.

public static array $fulltext_fields
#
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 $possible_filter_fields
#
public static boolean $order_empty_price
#

устанавливает поведение при нулевой (0) цене продукта если false, то не добавлять в корзину если true, то перенаправлять на

устанавливает поведение при нулевой (0) цене продукта если false, то не добавлять в корзину если true, то перенаправлять на

public static string $order_button_class
#

Класс кнопки заказа, класс должен реализовать OrderButtonInterface

Класс кнопки заказа, класс должен реализовать OrderButtonInterface

public static string $empty_order_button_class
#

Класс кнопки заказа для товаров без цены, класс должен реализовать OrderButtonInterface

Класс кнопки заказа для товаров без цены, класс должен реализовать OrderButtonInterface

protected static array $simple_order_additional_fields
#
public static array $possibleFields
#

Список полей, которые могут быть в данных импорта !!!!! У текущего Product нет поля SKU!!!!!

Список полей, которые могут быть в данных импорта !!!!! У текущего Product нет поля SKU!!!!!

Properties inherited from MediawebPage

$hide_ancestor, $icon

Properties inherited from Page

$default_child, $hidden_cms_fields

Properties inherited from SiteTree

$belongs_many_many, $breadcrumbs_delimiter, $cache_permissions, $can_create, $default_sort, $extensions, $many_many, $many_many_extraFields, $need_permission, $versioning, $write_homepage_map

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, $componentCache, $components, $create_table_options, $default_records, $destroyed, $field_labels, $original, $plural_name, $record, $singular_name

Properties inherited from ViewableData

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

Properties inherited from Object

$class, $extension_instances

[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