This is really ugly:

var $_results_key
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
FileSize
5.2 KB

What about that?

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -38,22 +38,22 @@ abstract class CachePluginBase extends PluginBase {
+   * Stores the cache id used for the results cache, once generateResultsKey() got
    * executed.
...
+   * Stores the cache id used for the output cache, once generateOutputKey() got
    * executed.

This is now over 80, but should be one line. Also, ID, not id.

+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -272,15 +290,13 @@ abstract class CachePluginBase extends PluginBase {
-  function get_results_key() {
+  public function generateResultsKey() {

@@ -303,15 +319,15 @@ abstract class CachePluginBase extends PluginBase {
-  function get_output_key() {
+  function generateOutputKey() {
     global $user;

Might as well add a docblock while we're changing it

dawehner’s picture

Status: Needs work » Needs review
FileSize
5.97 KB

Added the docblocks and some additional cleanup.

aspilicious’s picture

Status: Needs review » Needs work
+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -38,22 +39,22 @@ abstract class CachePluginBase extends PluginBase {
+   * @see Drupal\views\Plugin\views\cache\CachePluginBase::generateResultsKey()
    * @var string
    */

There is a rule we should move @see to the end. I must admit I never saw it when dealing with a property.

+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -72,6 +73,24 @@ abstract class CachePluginBase extends PluginBase {
+   * @return string
+   */

I know its obvious but we need to add a line of documentation. Same for the other functions.

+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -99,7 +118,7 @@ abstract class CachePluginBase extends PluginBase {
   function cache_set_expire($type) {
-    return CACHE_PERMANENT;
+    return CacheBackendInterface::CACHE_PERMANENT;

Why do we need to pass the $type?

dawehner’s picture

Status: Needs work » Needs review
FileSize
6.67 KB

Thanks for the review!

Why do we need to pass the $type?

For example the time example plugin uses the $type parameter...

Fixed the other parts

aspilicious’s picture

Small detail

+++ b/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -38,22 +39,24 @@ abstract class CachePluginBase extends PluginBase {
+   * Stores the cache ID used for the results cache, once generateResultsKey()
+   * got executed.
    *

Srry but this should fit on one line. We can make a more detailed description on a new line.

dawehner’s picture

FileSize
6.7 KB

Don't hesitate to show that.

Rerolled that as well

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

go?

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

go!

Automatically closed -- issue fixed for 2 weeks with no activity.