@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function updateCMSFields(FieldList $fields) |
| 31 | 31 | { |
| 32 | 32 | $name = ''; |
| 33 | - if(class_exists($this->getOwner()->ClassNameLastEdited)) { |
|
| 33 | + if (class_exists($this->getOwner()->ClassNameLastEdited)) { |
|
| 34 | 34 | $name = Injector::inst()->get($this->getOwner()->ClassNameLastEdited)->i18n_singular_name(); |
| 35 | 35 | } |
| 36 | 36 | $fields->addFieldsToTab( |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | DatetimeField::create('CacheKeyLastEdited', 'Content Last Edited') |
| 42 | 42 | ->setRightTitle('The frontend template cache will be invalidated every time this value changes. It changes every time anything is changed in the database.'), |
| 43 | 43 | ReadonlyField::create('ClassNameLastEdited', 'Last class updated') |
| 44 | - ->setRightTitle('Last object updated. The name of this object is: '.$name), |
|
| 44 | + ->setRightTitle('Last object updated. The name of this object is: ' . $name), |
|
| 45 | 45 | ] |
| 46 | 46 | ); |
| 47 | - if($this->getOwner()->RecordCacheUpdates) { |
|
| 47 | + if ($this->getOwner()->RecordCacheUpdates) { |
|
| 48 | 48 | $fields->addFieldsToTab( |
| 49 | 49 | 'Root.Caching', |
| 50 | 50 | [ |
@@ -62,28 +62,28 @@ discard block |
||
| 62 | 62 | public static function site_cache_key(): string |
| 63 | 63 | { |
| 64 | 64 | $obj = SiteConfig::current_site_config(); |
| 65 | - if($obj->HasCaching) { |
|
| 66 | - return (string) 'ts_'.strtotime($obj->CacheKeyLastEdited); |
|
| 65 | + if ($obj->HasCaching) { |
|
| 66 | + return (string) 'ts_' . strtotime($obj->CacheKeyLastEdited); |
|
| 67 | 67 | } else { |
| 68 | - return (string) 'ts_'.time(); |
|
| 68 | + return (string) 'ts_' . time(); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public static function update_cache_key(?string $className = '') |
| 73 | 73 | { |
| 74 | 74 | $obj = SiteConfig::current_site_config(); |
| 75 | - if($obj->HasCaching) { |
|
| 75 | + if ($obj->HasCaching) { |
|
| 76 | 76 | DB::query(' |
| 77 | 77 | UPDATE "SiteConfig" |
| 78 | 78 | SET |
| 79 | 79 | "CacheKeyLastEdited" = \'' . DBDatetime::now()->Rfc2822() . '\', |
| 80 | - "ClassNameLastEdited" = \'' . addslashes($className). '\' |
|
| 81 | - WHERE ID = '.$obj->ID.' |
|
| 80 | + "ClassNameLastEdited" = \'' . addslashes($className) . '\' |
|
| 81 | + WHERE ID = '.$obj->ID . ' |
|
| 82 | 82 | ;'); |
| 83 | 83 | } |
| 84 | - if($obj->RecordCacheUpdates) { |
|
| 84 | + if ($obj->RecordCacheUpdates) { |
|
| 85 | 85 | $record = Injector::inst() |
| 86 | - ->create(ObjectsUpdated::class, ['ClassNameLastEdited' => $className]) |
|
| 86 | + ->create(ObjectsUpdated::class, [ 'ClassNameLastEdited' => $className ]) |
|
| 87 | 87 | ->write(); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | public function getClassNameTitle() : string |
| 64 | 64 | { |
| 65 | - if(class_exists($this->getOwner()->ClassNameLastEdited)) { |
|
| 65 | + if (class_exists($this->getOwner()->ClassNameLastEdited)) { |
|
| 66 | 66 | return Injector::inst()->get($this->getOwner()->ClassNameLastEdited)->i18n_singular_name(); |
| 67 | 67 | } |
| 68 | 68 | return 'class not found'; |