I'm just learning SilverStripe and I'm having a problem with the lessons on the silverstripe website actually.
I have this class:
namespace SilverStripe\Lessons;
use Page;
class ArticlePage extends Page
{
private static $can_be_root = false;
private static $db = [
'Date' => 'Date',
'Teaser' => 'Text',
'Author' => 'Varchar(255)',
];
// public function getCMSFields(){
// $fields = parent::getCMSFields();
// $fields = addFieldToTab();
// return $fields;
// }
}
Now when I to /dev/build I get this feedback on the build page:
So what I did next was actually comment out the declaration of the $db array. Then I got this feedback from the dev/build:
So a few things I'm not sure about. The red note in the first output from dev/build states that you should define a table_name for all namespaced models. It really doesn't state that I have a table_name that is not defined. But the next note under it says that table_name not set for class SilverStripe\Lessons\ArticlePage. So is defining a table_name and "setting" a table_name the same thing in the context of these messages?
Also, the second output indicates that a table_name was defined for SilverStripe\Lessons\ArticlePage The fact that there are "2"s appended to each table_name results from me experimenting before I started this post I believe. i.e. once I saw this behaviour, i repeated the experiment to try and reproduce the behaviour, and hence more tables were created and deleted and thus their names had to be incremented. So Why is ArticlePage table_name not set? Can anybody help me with this issue? Dave.