jcb-compiler/src/adfbe68a-6d22-43e5-aee8-278.../code.php

72 lines
1.6 KiB
PHP
Raw Normal View History

2023-03-21 22:52:57 +00:00
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
2023-10-10 09:39:16 +00:00
namespace VDM\Joomla\Componentbuilder\Compiler\Builder;
2023-03-21 22:52:57 +00:00
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
2023-10-10 09:39:16 +00:00
use VDM\Joomla\Interfaces\Registryinterface;
use VDM\Joomla\Abstraction\Registry;
2023-03-21 22:52:57 +00:00
/**
2023-10-10 09:39:16 +00:00
* Compiler Content One
2023-03-21 22:52:57 +00:00
*
* @since 3.2.0
*/
2023-10-10 09:39:16 +00:00
class ContentOne extends Registry implements Registryinterface
2023-03-21 22:52:57 +00:00
{
/**
2023-10-10 09:39:16 +00:00
* Constructor.
2023-03-21 22:52:57 +00:00
*
* @since 3.2.0
*/
2023-10-10 09:39:16 +00:00
public function __construct()
2023-03-21 22:52:57 +00:00
{
2023-10-10 09:39:16 +00:00
$this->setSeparator(null);
2023-03-21 22:52:57 +00:00
}
/**
2023-10-10 09:39:16 +00:00
* Get that the active keys from a path
2023-03-21 22:52:57 +00:00
*
2023-10-10 09:39:16 +00:00
* @param string $path The path to determine the location mapper.
2023-03-21 22:52:57 +00:00
*
2023-10-10 09:39:16 +00:00
* @return array|null The valid array of keys
2023-03-21 22:52:57 +00:00
* @since 3.2.0
*/
2023-10-10 09:39:16 +00:00
protected function getActiveKeys(string $path): ?array
2023-03-21 22:52:57 +00:00
{
2023-10-10 09:39:16 +00:00
// Call the parent class's version of this method
$keys = parent::getActiveKeys($path);
if ($keys === null)
{
return null;
}
return $this->modelActiveKeys($keys);
2023-03-21 22:52:57 +00:00
}
/**
2023-10-10 09:39:16 +00:00
* Model that the active key
2023-03-21 22:52:57 +00:00
*
2023-10-10 09:39:16 +00:00
* @param array $keys The keys to the location mapper.
2023-03-21 22:52:57 +00:00
*
2023-10-10 09:39:16 +00:00
* @return array The valid array of key
2023-03-21 22:52:57 +00:00
* @since 3.2.0
*/
2023-10-10 09:39:16 +00:00
protected function modelActiveKeys(array $keys): array
2023-03-21 22:52:57 +00:00
{
2023-10-10 09:39:16 +00:00
return [Placefix::_h($keys[0])];
2023-03-21 22:52:57 +00:00
}
}