cefrl-1.0.0-beta1/src/CEFRLWeight.php

src/CEFRLWeight.php
<?php

namespace Drupal\cefrl;

use Drupal\Core\TypedData\TypedData;

/**
 * A computed property containing the weight of an item.
 */
class CEFRLWeight extends TypedData {

  /**
   * {@inheritdoc}
   */
  public function getValue() {
    $level = $this->getParent()->get('level')->getValue();

    $weights = CEFRLLevels::weights();

    return $weights[$level] ?? 0;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc