-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.php
73 lines (64 loc) · 1.66 KB
/
Table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* @package vdm/data
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git VDM Data Library <https://git.vdm.dev/joomla/vdm-data>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VastDevelopmentMethod\Joomla\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VastDevelopmentMethod\Joomla\Componentbuilder\Table as DataTable;
use VastDevelopmentMethod\Joomla\Componentbuilder\Table\Schema;
/**
* Table Service Provider
*
* @since 3.2.2
*/
class Table implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.2
*/
public function register(Container $container)
{
$container->alias(DataTable::class, 'Table')
->share('Table', [$this, 'getTable'], true);
$container->alias(Schema::class, 'Table.Schema')
->share('Table.Schema', [$this, 'getSchema'], true);
}
/**
* Get The Componentbuilder Data Table Class.
*
* @param Container $container The DI container.
*
* @return DataTable
* @since 3.2.2
*/
public function getTable(Container $container): DataTable
{
return new DataTable();
}
/**
* Get The Schema Class.
*
* @param Container $container The DI container.
*
* @return Schema
* @since 3.2.2
*/
public function getSchema(Container $container): Schema
{
return new Schema(
$container->get('Table')
);
}
}