Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/Ecombricks/Framework/App/ResourceConnection/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/Ecombricks/Framework/App/ResourceConnection/TableMapper.php
<?php
/**
 * Copyright © eComBricks. All rights reserved.
 * See LICENSE.txt for license details.
 */
namespace Ecombricks\Framework\App\ResourceConnection;

/**
 * Table mapper
 */
class TableMapper implements \Ecombricks\Framework\App\ResourceConnection\TableMapperInterface
{
    
    /**
     * Is enabled
     * 
     * @var boolean
     */
    protected $isEnabled = true;
    
    /**
     * Map
     * 
     * @var array
     */
    protected $map = [];
    
    /**
     * Constructor
     * 
     * @param array $map
     * @return void
     */
    public function __construct($map = [])
    {
        $this->map = $map;
    }
    
    /**
     * Is enabled
     * 
     * @return bool
     */
    public function isEnabled()
    {
        return $this->isEnabled;
    }
    
    /**
     * Set is enabled
     * 
     * @param boolean $isEnabled
     * @return $this
     */
    public function setIsEnabled($isEnabled)
    {
        $this->isEnabled = $isEnabled;
        return $this;
    }
    
    /**
     * Get table name
     * 
     * @param string $tableName
     * @return $this
     */
    public function getTableName($tableName)
    {
        if (!$this->isEnabled()) {
            return $tableName;
        }
        if (!isset($this->map[$tableName])) {
            return $tableName;
        }
        return $this->map[$tableName];
    }
    
}

Spamworldpro Mini