Hi guys,
I like to stop pages from being created if there is already an instance of it, and likewise stop it from being deleted.
Up until I started using Silverstripe 3 (last week), I've been using the following code:
public function canCreate() {
return false
}
public function canDelete() {
return false
}
or
public function canCreate() {
return !DataObject::get_one($this->ClassName);
}
public function canDelete() {
return !DataObject::get_one($this->ClassName);
}
However now it doesn't work with SS3. I get the following error:
[Strict Notice] Declaration of HomePage::canCreate() should be compatible with that of SiteTree::canCreate()
Does anyone know how I can get the same functionality in SS3?
Thanks in advance,
Ruth.