[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_actionlogs/src/Model/ -> ActionlogConfigModel.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_actionlogs
   6   *
   7   * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Actionlogs\Administrator\Model;
  12  
  13  use Joomla\CMS\MVC\Model\BaseDatabaseModel;
  14  use stdClass;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('_JEXEC') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Model to interact with the action log configuration.
  22   *
  23   * @since  4.2.0
  24   */
  25  class ActionlogConfigModel extends BaseDatabaseModel
  26  {
  27      /**
  28       * Returns the action logs config for the given context.
  29       *
  30       * @param   string    $context  The context of the content
  31       *
  32       * @return  stdClass|null  An object contains content type parameters, or null if not found
  33       *
  34       * @since   4.2.0
  35       */
  36      public function getLogContentTypeParams(string $context): ?stdClass
  37      {
  38          $db    = $this->getDatabase();
  39          $query = $db->getQuery(true)
  40              ->select('a.*')
  41              ->from($db->quoteName('#__action_log_config', 'a'))
  42              ->where($db->quoteName('a.type_alias') . ' = :context')
  43              ->bind(':context', $context);
  44  
  45          $db->setQuery($query);
  46  
  47          return $db->loadObject();
  48      }
  49  }


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