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 | |
namespace Foo\Bar\Baz; | |
/** | |
* url_handlers/routing would be required for this, could do a page class to reduce that portion of the code | |
*/ | |
class InvitationRedemptionController extends Controller | |
{ | |
public function index($request){ |
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 FileDataExtension | |
*/ | |
class FileDataExtension extends DataExtension | |
{ | |
/** | |
* @param FieldList $fields |
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 | |
\SilverStripe\View\Parsers\ShortcodeParser::get('default')->unregister('embed'); | |
\SilverStripe\View\Parsers\ShortcodeParser::get('default')->register( | |
'embed', | |
function ($arguments, $content = null, $parser = null, $tagName) { | |
return \Your\Namespace\Here\MyEmbedShortcodeProvider::handle_shortcode( | |
$arguments, | |
$content, | |
$parser, |
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 | |
namespace Your\Namespace\Here; | |
use SilverStripe\Core\Convert; | |
use SilverStripe\View\HTML; | |
use SilverStripe\View\Shortcodes\EmbedShortcodeProvider as SSEmbedShortcodeProvider; | |
class MyEmbedShortcodeProvider extends SSEmbedShortcodeProvider | |
{ |
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 DynamicManyManyList | |
*/ | |
class DynamicManyManyList extends ManyManyList { | |
/** | |
* Remove the given item from this list. | |
* |
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 | |
namespace MySite\Tests; | |
use SilverStripe\Dev\SapphireTest; | |
/** | |
* Class PageTest | |
* @package MySite\Tests | |
*/ |
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 | |
public function getRandom($count = 2) | |
{ | |
$records = self::get()->column(); | |
$filter = array(); | |
$have = 0; | |
while(count($filter) < 2){ | |
$rand = array_rand($records); |
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 CalendarSiteConfigExtension | |
*/ | |
class CalendarSiteConfigExtension extends DataExtension | |
{ | |
/** | |
* @var array |
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 MyDealer | |
* | |
* @property string $Title | |
* @method Configurations|HasManyList $Configurations | |
*/ | |
class MyDealer extends DataObject implements PermissionProvider | |
{ |
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 DealerAdmin | |
*/ | |
class DealerAdmin extends ModelAdmin | |
{ | |
/** | |
* @var array |