You are here

final class ScheduledChange in Commerce Recurring Framework 8

Represents a scheduled change.

Hierarchy

Expanded class hierarchy of ScheduledChange

7 files declare their use of ScheduledChange
ScheduledChangeItem.php in src/Plugin/Field/FieldType/ScheduledChangeItem.php
ScheduledChangeItemList.php in src/Plugin/Field/FieldType/ScheduledChangeItemList.php
ScheduledChangeItemListInterface.php in src/Plugin/Field/FieldType/ScheduledChangeItemListInterface.php
ScheduledChangeItemTest.php in tests/src/Kernel/ScheduledChangeItemTest.php
ScheduledChangeTest.php in tests/src/Kernel/ScheduledChangeTest.php

... See full list

File

src/ScheduledChange.php, line 8

Namespace

Drupal\commerce_recurring
View source
final class ScheduledChange {

  /**
   * The field name.
   *
   * @var string
   */
  protected $fieldName;

  /**
   * The value.
   *
   * @var string
   */
  protected $value;

  /**
   * The created time.
   *
   * @var int
   */
  protected $created;

  /**
   * Constructs a new ScheduledChange object.
   *
   * @param string $field_name
   *   The field name.
   * @param string $value
   *   The value.
   * @param int $created
   *   The created timestamp.
   */
  public function __construct($field_name, $value, $created) {
    $this->fieldName = $field_name;
    $this->value = $value;
    $this->created = $created;
  }

  /**
   * Gets the field name.
   *
   * @return string
   *   The field name.
   */
  public function getFieldName() {
    return $this->fieldName;
  }

  /**
   * Gets the value.
   *
   * @return string
   *   The value.
   */
  public function getValue() {
    return $this->value;
  }

  /**
   * Gets the created time.
   *
   * @return string
   *   The created time.
   */
  public function getCreatedTime() {
    return $this->created;
  }

  /**
   * Gets the array representation of the scheduled change.
   *
   * @return array
   *   The array representation of the scheduled change.
   */
  public function toArray() {
    return [
      'field_name' => $this->fieldName,
      'value' => $this->value,
      'created' => $this->created,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScheduledChange::$created protected property The created time.
ScheduledChange::$fieldName protected property The field name.
ScheduledChange::$value protected property The value.
ScheduledChange::getCreatedTime public function Gets the created time.
ScheduledChange::getFieldName public function Gets the field name.
ScheduledChange::getValue public function Gets the value.
ScheduledChange::toArray public function Gets the array representation of the scheduled change.
ScheduledChange::__construct public function Constructs a new ScheduledChange object.