Class AssociatedFolderDecorator
Decorate a data object so that it has an associated folder on the file system that lives and dies with this object. You can access this associated folder from the object via myObj->AssociatedFolder() Extend a DataObject class by calling DataObject::add_extension('MyDataObject', 'AssociatedFolderDecorator');
- Extension
-
DataObjectDecorator
-
SiteTreeDecorator
-
AssociatedFolderDecorator
Methods summary
public
array
|
|
public static
|
#
setDefaultRootFolderName( string $folderName )
Set the folder name to use if the decorated object's parent has no associated folder of its own. |
public static
string
|
#
getDefaultRootFolderName( )
Get the folder name to use if the decorated object's parent has no associated folder of its own. |
public
|
#
onAfterWrite( )
Do stuff before the decorated object is written. In this case create the associated folder if it does not already exist. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
Methods inherited from SiteTreeDecorator
canAddChildren(),
canPublish(),
onAfterPublish(),
onAfterUnpublish(),
onBeforePublish(),
onBeforeUnpublish()
Methods inherited from DataObjectDecorator
augmentDatabase(),
augmentSQL(),
augmentWrite(),
can(),
canCreate(),
canDelete(),
canEdit(),
flushCache(),
load_extra_statics(),
onBeforeDelete(),
onBeforeWrite(),
populateDefaults(),
requireDefaultRecords(),
updateCMSActions(),
updateCMSFields(),
updateFieldLabels(),
updateFrontEndFields(),
updateSummaryFields()
Methods inherited from Extension
__construct(),
clearOwner(),
getOwner(),
get_classname_without_arguments(),
setOwner()
Magic methods summary
Properties summary
public static
boolean
|
$createFolders |
#
Флаг - создавать ли прикрепленную папку. По умолчанию true. Можно использовать при импорте - когда не нужно создавать папки сразу. |
protected static
string
|
$defaultRootFolderName |
#
The folder name to use if the decorated object's parent has no associated folder of its own. |