MaskContentEntityStorage.php

Same filename in other branches
  1. 8.x-3.x modules/ctools_entity_mask/src/MaskContentEntityStorage.php

Namespace

Drupal\ctools_entity_mask

File

modules/ctools_entity_mask/src/MaskContentEntityStorage.php

View source
<?php

namespace Drupal\ctools_entity_mask;

use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\ContentEntityStorageBase;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldDefinitionInterface;

/**
 * Storage handler that simulates a full save, without writing to the database.
 */
class MaskContentEntityStorage extends ContentEntityStorageBase {
    
    /**
     * {@inheritdoc}
     */
    protected function readFieldItemsToPurge(FieldDefinitionInterface $field_definition, $batch_size) {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    protected function purgeFieldItems(ContentEntityInterface $entity, FieldDefinitionInterface $field_definition) {
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doLoadRevisionFieldItems($revision_id) {
        return NULL;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doSaveFieldItems(ContentEntityInterface $entity, array $names = []) {
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doDeleteFieldItems($entities) {
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doDeleteRevisionFieldItems(ContentEntityInterface $revision) {
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doLoadMultiple(array $ids = NULL) {
        return [];
    }
    
    /**
     * {@inheritdoc}
     */
    protected function has($id, EntityInterface $entity) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getQueryServiceName() {
        return 'entity.query.null';
    }
    
    /**
     * {@inheritdoc}
     */
    public function countFieldData($storage_definition, $as_bool = FALSE) {
        return $as_bool ? FALSE : 0;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function doLoadMultipleRevisionsFieldItems($revision_ids) {
        return [];
    }

}

Classes

Title Deprecated Summary
MaskContentEntityStorage Storage handler that simulates a full save, without writing to the database.