Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/vendors/Textpattern/Skin/CommonInterface.php - 221 lines - 6977 bytes - Summary - Text - Print

Description: Common Interface

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * https://textpattern.com/
   6   *
   7   * Copyright (C) 2020 The Textpattern Development Team
   8   *
   9   * This file is part of Textpattern.
  10   *
  11   * Textpattern is free software; you can redistribute it and/or
  12   * modify it under the terms of the GNU General Public License
  13   * as published by the Free Software Foundation, version 2.
  14   *
  15   * Textpattern is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with Textpattern. If not, see <https://www.gnu.org/licenses/>.
  22   */
  23  
  24  /**
  25   * Common Interface
  26   *
  27   * Implemented by CommonBase.
  28   *
  29   * @since   4.7.0
  30   * @package Skin
  31   */
  32  
  33  namespace Textpattern\Skin;
  34  
  35  interface CommonInterface
  36  {
  37      /**
  38       * $event property getter.
  39       *
  40       * @return string $this->event Class related textpack string (usually the event name).
  41       */
  42  
  43      public function getEvent();
  44  
  45      /**
  46       * $mimeTypes property getter.
  47       *
  48       * @return $this->mimeTypes The asset related mimeTypes array.
  49       */
  50  
  51      public function getMimeTypes();
  52  
  53      /**
  54       * $names property setter/sanitizer.
  55       *
  56       * @param  array $names Multiple skin or template names to work with related methods.
  57       * @return object $this  The current object (chainable).
  58       */
  59  
  60      public function setNames($names = null);
  61  
  62      /**
  63       * $name property setter.
  64       *
  65       * @param  array $name Single skin or template name to work with related methods.
  66       *                     Takes the '_last_saved' or '_editing' related preference
  67       *                     value if null.
  68       * @return object $this The current object (chainable).
  69       */
  70  
  71      public function setName($name = null);
  72  
  73      /**
  74       * $base property setter.
  75       *
  76       * @param object $this The current object (chainable).
  77       */
  78  
  79      public function setBase($name);
  80  
  81      /**
  82       * Get the current 'skin_editing' or '{asset}_last_saved' pref value.
  83       *
  84       * @return mixed Skin/template name | false on error.
  85       */
  86  
  87      public function getEditing();
  88  
  89      /**
  90       * Set the 'skin_editing' or '{asset}_last_saved' pref value
  91       * to the $name property value.
  92       *
  93       * @return bool false on error.
  94       */
  95  
  96      public function setEditing();
  97  
  98      /**
  99       * Get the $results property value as a message to display in the admin tabs.
 100       *
 101       * @return mixed Message or array containing the message
 102       *               and its related user notice constant.
 103       */
 104  
 105      public function getMessage();
 106  
 107      /**
 108       * Import/Override (and clean) multiple skins (and their related $assets)
 109       * or multiple templates from the $names (+ $skin) property value(s).
 110       * Merges results in the related property.
 111       *
 112       * @param  bool $sync     Whether to removes extra skin template rows or not;
 113       * @param  bool $override Whether to insert or update the skins.
 114       * @return object $this     The current object (chainable).
 115       */
 116  
 117      public function import($sync = false, $override = false);
 118  
 119      /**
 120       * Export (and clean) multiple skins (and their related $assets)
 121       * or multiple templates from the $names (+ $skin) property value(s).
 122       * Merges results in the related property.
 123       *
 124       * @param  bool $sync Whether to removes extra skin template files or not;
 125       * @return object $this The current object (chainable).
 126       */
 127  
 128      public function export($sync = false, $override = false);
 129  
 130      /**
 131       * Insert a row into the $table property value related table.
 132       *
 133       * @param  string $set   Optional SET clause.
 134       *                       Builds the clause from the $infos (+ $skin) property value(s) if null.
 135       * @param  bool   $debug Dump query
 136       * @return bool          FALSE on error.
 137       */
 138  
 139      public function createRow($set = null, $debug = false);
 140  
 141      /**
 142       * Update the $table property value related table.
 143       *
 144       * @param  string $set   Optional SET clause.
 145       *                       Builds the clause from the $infos property value if null.
 146       * @param  string $where Optional WHERE clause.
 147       *                       Builds the clause from the $base (+ $skin) property value(s) if null.
 148       * @param  bool   $debug Dump query
 149       * @return bool          FALSE on error.
 150       */
 151  
 152      public function updateRow($set = null, $where = null, $debug = false);
 153  
 154      /**
 155       * Get a row field from the $table property value related table.
 156       *
 157       * @param  string $thing Optional SELECT clause.
 158       *                       Uses 'name' if null.
 159       * @param  string $where Optional WHERE clause.
 160       *                       Builds the clause from the $name (+ $skin) property value(s) if null.
 161       * @param  bool   $debug Dump query
 162       * @return mixed         The Field or FALSE on error.
 163       */
 164  
 165      public function getField($thing = null, $where = null, $debug = false);
 166  
 167      /**
 168       * Delete rows from the $table property value related table.
 169       *
 170       * @param  string $where Optional WHERE clause.
 171       *                       Builds the clause from the $names (+ $skin) property value(s) if null.
 172       * @param  bool   $debug Dump query
 173       * @return bool          false on error.
 174       */
 175  
 176      public function deleteRows($where = null, $debug = false);
 177  
 178      /**
 179       * Count rows in the $table property value related table.
 180       *
 181       * @param  string $where The where clause.
 182       * @param  bool   $debug Dump query
 183       * @return mixed         Number of rows or FALSE on error
 184       */
 185  
 186      public function countRows($where = null, $debug = false);
 187  
 188      /**
 189       * Get a row from the $table property value related table as an associative array.
 190       *
 191       * @param  string $things Optional SELECT clause.
 192       *                        Uses '*' (all) if null.
 193       * @param  string $where  Optional WHERE clause.
 194       *                        Builds the clause from the $name (+ $skin) property value(s) if null.
 195       * @param  bool   $debug  Dump query
 196       * @return bool           Array.
 197       */
 198  
 199      public function getRow($things = null, $where = null, $debug = false);
 200  
 201      /**
 202       * Get rows from the $table property value related table as an associative array.
 203       *
 204       * @param  string $thing Optional SELECT clause.
 205       *                       Uses '*' (all) if null.
 206       * @param  string $where Optional WHERE clause (default: "name = '".doSlash($this->getName())."'")
 207       *                       Builds the clause from the $names (+ $skin) property value(s) if null.
 208       * @param  bool   $debug Dump query
 209       * @return array         (Empty on error)
 210       */
 211  
 212      public function getRows($things = null, $where = null, $debug = false);
 213  
 214      /**
 215       * $installed property getter.
 216       *
 217       * @return array $this->installed.
 218       */
 219  
 220      public function getInstalled();
 221  }

title

Description

title

Description

title

Description

title

title

Body