silverstripe-frameworktest/code/TestTag.php
2010-09-25 01:09:22 +00:00

23 lines
409 B
PHP

<?php
class TestTag extends DataObject {
static $db = array(
'Title' => 'Text'
);
static $belongs_many_many = array(
'Pages' => 'TestTagFieldPage'
);
function requireDefaultRecords(){
$class = $this->class;
if(!DataObject::get_one($class)) {
foreach(array('one', 'two', 'three', 'four') as $title) {
$tag = new $class();
$tag->Title = $title;
$tag->write();
}
}
}
}