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 My\Custom\Namespace; | |
class MyAdmin extends ModelAdmin | |
{ | |
private static $managed_models = [ | |
'myModelKey' => [ | |
'dataClass' => MyClass::class, | |
'title' => 'My Class Title', |
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 | |
$groupings = [ | |
[ | |
'Title' => 'Hoodies', | |
'Class' => 'hoodies', | |
'Items' => [ | |
[ | |
'Href' => 'foo.php', | |
'Image' => 'img/myimage.jpg', |
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 | |
$albumData = [ | |
[ | |
'Title' => 'Album 1 Title', | |
'Image' => 'img/foo-bar.jpg', | |
], | |
[ | |
'Title' => 'Album 2 Title', | |
'Image' => 'img/foo-bar-2.jpg', |
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 Foo extends DataObject | |
{ | |
private static $has_many = [ | |
'Bars' => Bar::class, | |
]; | |
} | |
class Bar extends DataObject |
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 MyApp\Extension; | |
use MyApp\Model\Reservation; | |
use SilverStripe\Control\Controller; | |
use SilverStripe\Control\HTTPResponse; | |
use SilverStripe\Core\Extension; | |
use SilverStripe\Forms\FieldList; | |
use SilverStripe\Forms\FormAction; |
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 | |
/** DataList $myList */ | |
$myList = Something::get(); | |
$withinRangeFilter = new WithinRangeFilter('ColumnName');//in this case I had a Date column | |
$withinRangeFilter->setMin('YYYY-MM-DD');//low end date | |
$withinRangeFilter->setMax('YYYY-MM-DD');//high end date | |
$myList = $myList->alterDataQuery([$withinRangeFitler, 'apply']); |
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; | |
use SilverStripe\Core\Config\Configurable; | |
use SilverStripe\ORM\DB; | |
/** | |
* Class ConnectionManager | |
* @package Your\Namespace |
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 | |
/** | |
* Action that takes the user back to a given link rather than submitting | |
* the form. | |
* | |
* @package cancelformaction | |
*/ | |
class CancelFormAction extends FormAction | |
{ |
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\Tasks; | |
use SilverStripe\Assets\File; | |
use SilverStripe\Core\ClassInfo; | |
use SilverStripe\Dev\BuildTask; | |
use SilverStripe\Dev\Debug; | |
use SilverStripe\ORM\DataObject; | |
use SilverStripe\ORM\DB; |
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; | |
use SilverStripe\Dev\BuildTask; | |
use SilverStripe\ORM\DB; | |
/** | |
* Class CountryCodeUpdateTask | |
* @package Dynamic\Jasna\Tasks |
NewerOlder