[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/MVC/Model/ -> WorkflowModelInterface.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\MVC\Model;
  11  
  12  use Joomla\CMS\Form\Form;
  13  use Joomla\CMS\Table\Table;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('JPATH_PLATFORM') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * Interface for a workflow model.
  21   *
  22   * @since  4.0.0
  23   */
  24  interface WorkflowModelInterface
  25  {
  26      /**
  27       * Set Up the workflow
  28       *
  29       * @param   string  $extension  The option and section separated by.
  30       *
  31       * @return  void
  32       *
  33       * @since   4.0.0
  34       */
  35      public function setUpWorkflow($extension);
  36  
  37      /**
  38       * Method to allow derived classes to preprocess the form.
  39       *
  40       * @param   Form    $form   A Form object.
  41       * @param   mixed   $data   The data expected for the form.
  42       *
  43       * @return  void
  44       *
  45       * @see     FormField
  46       * @since   4.0.0
  47       * @throws  \Exception if there is an error in the form event.
  48       */
  49      public function workflowPreprocessForm(Form $form, $data);
  50  
  51      /**
  52       * Let plugins access stage change events
  53       *
  54       * @return  void
  55       *
  56       * @since   4.0.0
  57       */
  58      public function workflowBeforeStageChange();
  59  
  60      /**
  61       * Preparation of workflow data/plugins
  62       *
  63       * @return  void
  64       *
  65       * @since   4.0.0
  66       */
  67      public function workflowBeforeSave();
  68  
  69      /**
  70       * Executing of relevant workflow methods
  71       *
  72       * @return  void
  73       *
  74       * @since   4.0.0
  75       */
  76      public function workflowAfterSave($data);
  77  
  78      /**
  79       * Batch change workflow stage or current.
  80       *
  81       * @param   integer  $oldId     The ID of the item copied from
  82       * @param   integer  $newId     The ID of the new item
  83       *
  84       * @return  null
  85       *
  86       * @since   4.0.0
  87       */
  88      public function workflowCleanupBatchMove($oldId, $newId);
  89  
  90      /**
  91       * Runs transition for item.
  92       *
  93       * @param   array    $pks           Id of items to execute the transition
  94       * @param   integer  $transitionId  Id of transition
  95       *
  96       * @return  boolean
  97       *
  98       * @since   4.0.0
  99       */
 100      public function executeTransition(array $pks, int $transitionId);
 101  
 102      /**
 103       * Method to get state variables.
 104       *
 105       * @param   string  $property  Optional parameter name
 106       * @param   mixed   $default   Optional default value
 107       *
 108       * @return  mixed  The property where specified, the state object where omitted
 109       *
 110       * @since   4.0.0
 111       */
 112      public function getState($property = null, $default = null);
 113  
 114      /**
 115       * Method to get the model name
 116       *
 117       * The model name. By default parsed using the classname or it can be set
 118       * by passing a $config['name'] in the class constructor
 119       *
 120       * @return  string  The name of the model
 121       *
 122       * @since   4.0.0
 123       * @throws  \Exception
 124       */
 125      public function getName();
 126  
 127  
 128      /**
 129       * Method to get a table object, load it if necessary.
 130       *
 131       * @param   string  $name     The table name. Optional.
 132       * @param   string  $prefix   The class prefix. Optional.
 133       * @param   array   $options  Configuration array for model. Optional.
 134       *
 135       * @return  Table  A Table object
 136       *
 137       * @since   3.0
 138       * @throws  \Exception
 139       */
 140      public function getTable($name = '', $prefix = '', $options = array());
 141  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer