"Fossies" - the Fresh Open Source Software Archive

Member "papayacms-core-6.9.4/src/system/Papaya/Plugin/Filter/Aggregation.php" (13 Dec 2019, 1601 Bytes) of package /linux/www/papayacms-core-6.9.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Aggregation.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 6.8.0_vs_6.9.0.

    1 <?php
    2 /**
    3  * papaya CMS
    4  *
    5  * @copyright 2000-2018 by papayaCMS project - All rights reserved.
    6  * @link http://www.papaya-cms.com/
    7  * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, version 2
    8  *
    9  *  You can redistribute and/or modify this script under the terms of the GNU General Public
   10  *  License (GPL) version 2, provided that the copyright and license notes, including these
   11  *  lines, remain unmodified. papaya is distributed in the hope that it will be useful, but
   12  *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13  *  FOR A PARTICULAR PURPOSE.
   14  */
   15 namespace Papaya\Plugin\Filter {
   16 
   17   /**
   18    * This a standard implementation for content/data filters usage in a plugin.
   19    *
   20    * It provides access to a filters() methods that returns a \Papaya\Plugin\Filter\Content
   21    * instance.
   22    *
   23    * To use the filters call prepare()/applyTo()/appendTo() in the
   24    * your \Papaya\Plugin\Appendable::appendTo() method.
   25    *
   26    * @package Papaya-Library
   27    * @subpackage Plugins
   28    */
   29   trait Aggregation {
   30 
   31     use \Papaya\Plugin\PageModule\Aggregation;
   32 
   33     /**
   34      * @var Content\Records
   35      */
   36     private $_contentFilters;
   37 
   38     /**
   39      * @param Content|null $filters
   40      *
   41      * @return Content
   42      */
   43     public function filters(Content $filters = NULL) {
   44       if (NULL !== $filters) {
   45         $this->_contentFilters = $filters;
   46       } elseif (NULL === $this->_contentFilters) {
   47         $this->_contentFilters = new Content\Records($this->getPage());
   48       }
   49       return $this->_contentFilters;
   50     }
   51   }
   52 }