mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW Added onAfterBuild (#9545)
* Added onAfterBuild * Remove arbitrary argument
This commit is contained in:
parent
87c041b92d
commit
57d75c89d5
@ -117,6 +117,15 @@ abstract class DataExtension extends Extension
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend the owner's onAfterBuild() logic
|
||||
*
|
||||
* See {@link DataObject::onAfterBuild()} for context.
|
||||
*/
|
||||
public function onAfterBuild()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Influence the owner's can() permission check value to be disallowed (false),
|
||||
* allowed (true) if no other processed results are to disallow, or open (null) to not
|
||||
|
@ -3542,6 +3542,17 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
$this->extend('requireDefaultRecords', $dummy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked after every database build is complete (including after table creation and
|
||||
* default record population).
|
||||
*
|
||||
* See {@link DatabaseAdmin::doBuild()} for context.
|
||||
*/
|
||||
public function onAfterBuild()
|
||||
{
|
||||
$this->extend('onAfterBuild');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default searchable fields for this object, as defined in the
|
||||
* $searchable_fields list. If searchable fields are not defined on the
|
||||
|
@ -401,6 +401,10 @@ class DatabaseAdmin extends Controller
|
||||
echo (Director::is_cli()) ? "\n Database build completed!\n\n" :"<p>Database build completed!</p>";
|
||||
}
|
||||
|
||||
foreach ($dataClasses as $dataClass) {
|
||||
DataObject::singleton($dataClass)->onAfterBuild();
|
||||
}
|
||||
|
||||
ClassInfo::reset_db_cache();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user