2018-04-29 11:58:46 +00:00
|
|
|
<?php
|
|
|
|
|
2021-02-18 12:02:25 +00:00
|
|
|
namespace Drupal\opencase_cases;
|
2018-04-29 11:58:46 +00:00
|
|
|
|
|
|
|
use Drupal\Core\Entity\ContentEntityStorageInterface;
|
|
|
|
use Drupal\Core\Session\AccountInterface;
|
|
|
|
use Drupal\Core\Language\LanguageInterface;
|
2021-02-18 12:02:25 +00:00
|
|
|
use Drupal\opencase_cases\Entity\OCCaseInterface;
|
2018-04-29 11:58:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the storage handler class for Case entities.
|
|
|
|
*
|
|
|
|
* This extends the base storage class, adding required special handling for
|
|
|
|
* Case entities.
|
|
|
|
*
|
2021-02-18 12:02:25 +00:00
|
|
|
* @ingroup opencase_cases
|
2018-04-29 11:58:46 +00:00
|
|
|
*/
|
|
|
|
interface OCCaseStorageInterface extends ContentEntityStorageInterface {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of Case revision IDs for a specific Case.
|
|
|
|
*
|
2021-02-18 12:02:25 +00:00
|
|
|
* @param \Drupal\opencase_cases\Entity\OCCaseInterface $entity
|
2018-04-29 11:58:46 +00:00
|
|
|
* The Case entity.
|
|
|
|
*
|
|
|
|
* @return int[]
|
|
|
|
* Case revision IDs (in ascending order).
|
|
|
|
*/
|
|
|
|
public function revisionIds(OCCaseInterface $entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of revision IDs having a given user as Case author.
|
|
|
|
*
|
|
|
|
* @param \Drupal\Core\Session\AccountInterface $account
|
|
|
|
* The user entity.
|
|
|
|
*
|
|
|
|
* @return int[]
|
|
|
|
* Case revision IDs (in ascending order).
|
|
|
|
*/
|
|
|
|
public function userRevisionIds(AccountInterface $account);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Counts the number of revisions in the default language.
|
|
|
|
*
|
2021-02-18 12:02:25 +00:00
|
|
|
* @param \Drupal\opencase_cases\Entity\OCCaseInterface $entity
|
2018-04-29 11:58:46 +00:00
|
|
|
* The Case entity.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
* The number of revisions in the default language.
|
|
|
|
*/
|
|
|
|
public function countDefaultLanguageRevisions(OCCaseInterface $entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unsets the language for all Case with the given language.
|
|
|
|
*
|
|
|
|
* @param \Drupal\Core\Language\LanguageInterface $language
|
|
|
|
* The language object.
|
|
|
|
*/
|
|
|
|
public function clearRevisionsLanguage(LanguageInterface $language);
|
|
|
|
|
|
|
|
}
|