<?php
/**
 * @package     DOCman
 * @copyright   Copyright (C) 2019 Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.joomlatools.com
 */

namespace Foliolabs\Docman;

use Foliolabs\Library;

class DatabaseTableNodes extends Library\DatabaseTableAbstract
{
    protected function _initialize(Library\ObjectConfig $config)
    {
        $config->append([
            'base' => 'docman_files',
            'name' => 'docman_nodes'
        ]);

        parent::_initialize($config);
    }

    public function getSchema()
    {
        $result = parent::getSchema();

        // Unset the primary key from the base table as the view doesn't have any
        if (is_object($result)){
            unset($result->columns['docman_file_id']);
        }

        return $result;
    }
}
