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 ManyManyListWithHook extends ManyManyList { | |
/** | |
* @param mixed $item | |
* @param array|null $extraFields | |
*/ | |
public function add($item, $extraFields = null) { | |
parent::add($item, $extraFields); |
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 SomeModelAdmin extends ModelAdmin { | |
private static $managed_models = array( | |
"MyDataObject" | |
); | |
public function getEditForm($id = null, $fields = null) { | |
$form = parent::getEditForm($id, $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
<% loop $Menu(1) %> | |
$RenderLayout | |
<% end_loop %> |
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 | |
$dataColumns = $grid->getConfig()->getComponentByType('GridFieldDataColumns'); | |
$dataColumns->setDisplayFields(array( | |
'Title' => array( | |
'title' => 'Product', | |
'callback' => function($record) { | |
return $record->Title . ' - ' . $record->Variant; | |
} | |
), |
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 SomeModelAdmin extends ModelAdmin { | |
private static $managed_models = array( | |
"MyDataObject" | |
); | |
public function getEditForm($id = null, $fields = null) { | |
$form = parent::getEditForm($id, $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 | |
class LeftAndMainSiteTreeExtension extends Extension { | |
/** | |
* Fix for disappearing SiteTree. | |
* @see https://github.com/silverstripe/silverstripe-framework/issues/4137 | |
* @see https://github.com/silverstripe/silverstripe-cms/issues/1135 | |
* @param &$html | |
*/ |
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 Page extends SiteTree { | |
/** | |
* Return any event pages that are in this section. | |
* @param ArrayList|null $children | |
* @param ArrayList|null &$events | |
* @return ArrayList | |
*/ |
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 CarouselSlide extends DataObject { | |
private static $db = array( | |
'Title' => 'Varchar(255)', | |
'Description' => 'Text' | |
); | |
private static $has_one = 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
File: | |
allowed_extensions: | |
- 'svg' |
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 FixedCurrencyField extends CurrencyField { | |
/** | |
* @param mixed $val | |
* @return $this | |
*/ | |
public function setValue($val) { | |
if( ! $val) $val = 0.00; |