Created
March 24, 2016 02:47
-
-
Save hectorlorenzo/68d2ff8b013ff73a1380 to your computer and use it in GitHub Desktop.
SilverStripe blank Strip object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ExampleStrip extends Strip | |
{ | |
//-------------------------------------------- DB model | |
/** | |
* @var array | |
*/ | |
private static $db = [ | |
'Key' => 'Value' | |
]; | |
//-------------------------------------------- Relationships | |
/** | |
* @var array | |
*/ | |
private static $has_one = [ | |
'Item' => 'Item' | |
]; | |
/** | |
* @var array | |
*/ | |
private static $has_many = [ | |
'Items' => 'Item' | |
]; | |
/** | |
* @var array | |
*/ | |
private static $many_many = [ | |
'Items' => 'Items' | |
]; | |
//-------------------------------------------- CMS Fields | |
/** | |
* @return mixed | |
*/ | |
public function getCMSFields() | |
{ | |
$fields = parent::getCMSFields(); | |
//---------------------- Main Tab | |
$fields->addFieldsToTab('Root.Main', | |
[ | |
] | |
); | |
return $fields; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment