pm-4.1.x-dev/src/PmContentEntityBaseInterface.php

src/PmContentEntityBaseInterface.php
<?php

namespace Drupal\pm;

use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\Core\Entity\EntityInterface;

/**
 * Base definition for Content Entities.
 */
interface PmContentEntityBaseInterface extends ContentEntityInterface, EntityChangedInterface {

  /**
   * Get list of default base fields enabled for the entity.
   *
   * @return string[]
   *   List of extra fields that can be attached to the content.
   */
  public static function getPmContentEntityBaseFieldNames();

  /**
   * Check if a content is in "done" state.
   *
   * A lot of things can decide if a thing is "done" with a.k.a. completed.
   * Sometimes it is an explicit boolean field that marks the Task/Project
   * as completed.
   * Otherwise, it can be inferred from the "status" of a Ticket. Irrespective
   * of the business logic, we can rely on this method to check if the content
   * has reached its completed state.
   *
   * @return bool
   *   True if content has reached completed state.
   */
  public function isDone(): bool;

  /**
   * Mark a content to be in "done" state.
   *
   * Based on business logic, mark a particular Project Management Entity as
   * "done"/"completed".
   */
  public function setDone();

  /**
   * Check if a content is in "open" state.
   *
   * This is logical opposite state of "Done". A thing is open until it is done.
   *
   * @return bool
   *   True if content has reached completed state.
   */
  public function isOpen(): bool;

  /**
   * Mark a content to be in "open" state.
   *
   * Based on business logic, mark a particular Project Management Entity as
   * "done"/"completed".
   */
  public function setOpen();

  /**
   * Get Project that this entity belongs to.
   *
   * @return \Drupal\Core\Entity\EntityInterface|null
   *   The "PM Project" entity.
   */
  public function getProject(): ?EntityInterface;

}

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

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