You are here

public function Skin::getStorage in Skinr 8.2

File

src/Entity/Skin.php, line 179
Contains \Drupal\skinr\Entity\Skin.

Class

Skin
Defines the Skin entity.

Namespace

Drupal\skinr\Entity

Code

public function getStorage() {

  // @todo Do we still need this?
  $default_skins = _skinr_skin_get_defaults();
  $storage = SKINR_STORAGE_IN_DATABASE;
  if (isset($default_skins[$this->uuid])) {
    $default_skin = clone $default_skins[$this->uuid];

    // Make sure skin has same processing as import.
    _skinr_skin_import($default_skin);

    // API version is only used for export.
    unset($default_skin->api_version);

    // Status shouldn't influence overridden.
    $default_skin->status = $this->status;
    $storage = SKINR_STORAGE_IN_CODE;
    if ($default_skin != $this) {

      // Default was overridden.
      $storage = SKINR_STORAGE_IN_CODE_OVERRIDDEN;
    }
  }
  return $storage;
}