-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
62 lines (57 loc) · 1.34 KB
/
code.power
File metadata and controls
62 lines (57 loc) · 1.34 KB
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
/**
* 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);
$container->alias(Validator::class, 'Table.Validator')
->share('Table.Validator', [$this, 'getValidator'], true);
}
/**
* Get The [[[Component]]] 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')
);
}
/**
* Get The Validator Class.
*
* @param Container $container The DI container.
*
* @return Validator
* @since 3.2.2
*/
public function getValidator(Container $container): Validator
{
return new Validator(
$container->get('Table')
);
}