<?php
/** 
 * @package     VikRestaurants
 * @subpackage  core
 * @author      E4J s.r.l.
 * @copyright   Copyright (C) 2023 E4J s.r.l. All Rights Reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link        https://vikwp.com
 */

namespace E4J\VikRestaurants\Template;

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

/**
 * Interface used to represent a template tags collection.
 *
 * @since 1.10
 */
interface Taggable
{
    /**
     * Obtains all the template tags with their respective values.
     * 
     * @return  array  The tag-value associative array.
     */
    public function getTemplateData();

    /**
     * Registers new templates tags with their respective values.
     * 
     * @param   array  $data  A tag-value associative array.
     * 
     * @return  void
     */
    public function addTemplateData(array $data);

    /**
     * Injects the registered tags within the provided template.
     * 
     * @param   string  $tmpl  The template to parse.
     * 
     * @return  string
     */
    public function injectTemplateData(string $tmpl);

    /**
     * Registers new templates tags with their respective values.
     * 
     * @param   TagsDecorator  $decorator
     * 
     * @return  seld  This object to support chaining.
     */
    public function attachTemplateDecorator(TagsDecorator $decorator);
}
