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
# Assumes the first non-zero ElementalAreaID in the versions table is the correct one to use | |
# (because they basically never change). Swap out table names as appropriate for your class. | |
# Don't forget to update Page_Live too! | |
UPDATE Page p | |
INNER JOIN | |
( | |
SELECT RecordID, ElementalAreaID | |
FROM CaseStudyPage_Versions | |
WHERE ElementalAreaID > 0 |
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
<% cache 'ElementFeatureBoxes', 'PerDataObjectCacheKeyCreator', 'CacheInclude', $ClassName, $ID %> | |
loop elements etc | |
<% end_cache %> |
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 App\Forms\GridField; | |
use Exception; | |
use SilverStripe\ORM\DataObject; | |
use SilverStripe\ORM\DB; | |
use SilverStripe\ORM\FieldType\DBDatetime; | |
use SilverStripe\ORM\ManyManyList; | |
use SilverStripe\ORM\ManyManyThroughList; |
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 App\ORM\FieldType; | |
use SilverStripe\Forms\DropdownField; | |
use SilverStripe\Forms\OptionsetField; | |
use SilverStripe\ORM\DB; | |
use SilverStripe\ORM\FieldType\DBBoolean; | |
class DBNullableBoolean extends DBBoolean |
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 App\View\Shortcodes; | |
use SilverStripe\Core\Convert; | |
use SilverStripe\View\HTML; | |
use SilverStripe\View\Parsers\ShortcodeHandler; | |
use SilverStripe\View\Shortcodes\EmbedShortcodeProvider as SilverStripeEmbedShortcodeProvider; | |
/** |
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 | |
/** | |
* Only show blog posts which are either: | |
* | |
* A) in the list of categories returned by getApplicableBlogCategories() or; | |
* B) do not have any categories assigned | |
*/ | |
class BlogExtension extends Extension | |
{ |
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 PaymentExtension extends DataExtension | |
{ | |
private static $db = [ | |
'StripePaymentIntentReference' => 'Varchar(255)' | |
]; | |
} |
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
diff --git a/src/InterventionBackend.php b/src/InterventionBackend.php | |
index 81bcd97..dc251bc 100644 | |
--- a/src/InterventionBackend.php | |
+++ b/src/InterventionBackend.php | |
@@ -13,6 +13,7 @@ use Intervention\Image\Size; | |
use InvalidArgumentException; | |
use LogicException; | |
use Psr\Http\Message\StreamInterface; | |
+use Psr\Log\LoggerInterface; | |
use Psr\SimpleCache\CacheInterface; |
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 App\Control\Middleware; | |
use SilverStripe\Control\HTTPRequest; | |
use SilverStripe\Control\Middleware\HTTPMiddleware; | |
use SilverStripe\ORM\DB; | |
use SilverStripe\Security\Security; | |
class LastVisitedMiddleware implements HTTPMiddleware |
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 App\Extensions; | |
class BaseElementExtension extends Extension | |
{ | |
/** | |
* Flag to indiciate if this element is a new element. Used because isChanged('ID') seems to be unreliable | |
* | |
* @var bool |
NewerOlder