Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
Tourinsoft
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bolt Extensions
Tourinsoft
Commits
8482d419
Commit
8482d419
authored
May 09, 2018
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB
parent
545e1315
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
0 deletions
+88
-0
FluxRepository.php
src/Storage/Repository/FluxRepository.php
+11
-0
Flux.php
src/Storage/Schema/Table/Flux.php
+40
-0
TourinsoftExtension.php
src/TourinsoftExtension.php
+37
-0
No files found.
src/Storage/Repository/FluxRepository.php
0 → 100644
View file @
8482d419
<?php
namespace
Bolt\Extension\Appolo\Tourinsoft\Storage\Repository
;
use
Bolt\Storage\Repository
;
class
FluxRepository
extends
repository
{
}
\ No newline at end of file
src/Storage/Schema/Table/Flux.php
0 → 100644
View file @
8482d419
<?php
namespace
Bolt\Extension\Appolo\Tourinsoft\Storage\Schema\Table
;
use
Bolt\Storage\Database\Schema\Table\BaseTable
;
class
Flux
extends
BaseTable
{
/**
* Add columns to the table.
*/
protected
function
addColumns
()
{
$this
->
table
->
addColumn
(
'id'
,
'integer'
,
[
'autoincrement'
=>
true
]);
$this
->
table
->
addColumn
(
'title'
,
'string'
,
[
'notnull'
=>
true
]);
$this
->
table
->
addColumn
(
'code'
,
'string'
,
[
'notnull'
=>
true
]);
$this
->
table
->
addColumn
(
'key'
,
'string'
,
[
'notnull'
=>
true
]);
$this
->
table
->
addColumn
(
'contentType'
,
'string'
,
[
'notnull'
=>
true
]);
$this
->
table
->
addColumn
(
'enabled'
,
'boolean'
,
[
'default'
=>
false
]);
$this
->
table
->
addColumn
(
'createdAt'
,
'datetime'
,
[
'notnull'
=>
true
]);
$this
->
table
->
addColumn
(
'updateAt'
,
'datetime'
,
[
'notnull'
=>
true
]);
}
/**
* Define the columns that require indexing.
*/
protected
function
addIndexes
()
{
$this
->
table
->
addIndex
([
'enabled'
]);
}
/**
* Set the table's primary key.
*/
protected
function
setPrimaryKey
()
{
$this
->
table
->
setPrimaryKey
([
'id'
]);
}
}
src/TourinsoftExtension.php
View file @
8482d419
...
@@ -3,8 +3,11 @@
...
@@ -3,8 +3,11 @@
namespace
Bolt\Extension\Appolo\Tourinsoft
;
namespace
Bolt\Extension\Appolo\Tourinsoft
;
use
Bolt\Extension\Appolo\Tourinsoft\Controller\Backend\FluxController
;
use
Bolt\Extension\Appolo\Tourinsoft\Controller\Backend\FluxController
;
use
Bolt\Extension\DatabaseSchemaTrait
;
use
Bolt\Extension\SimpleExtension
;
use
Bolt\Extension\SimpleExtension
;
use
Bolt\Extension\StorageTrait
;
use
Bolt\Menu\MenuEntry
;
use
Bolt\Menu\MenuEntry
;
use
Silex\Application
;
/**
/**
* Tourinsoft extension class.
* Tourinsoft extension class.
...
@@ -13,6 +16,9 @@ use Bolt\Menu\MenuEntry;
...
@@ -13,6 +16,9 @@ use Bolt\Menu\MenuEntry;
*/
*/
class
TourinsoftExtension
extends
SimpleExtension
class
TourinsoftExtension
extends
SimpleExtension
{
{
use
StorageTrait
;
use
DatabaseSchemaTrait
;
/**
/**
* @return array
* @return array
*/
*/
...
@@ -49,5 +55,35 @@ class TourinsoftExtension extends SimpleExtension
...
@@ -49,5 +55,35 @@ class TourinsoftExtension extends SimpleExtension
];
];
}
}
/**
* @param Application $app
*/
protected
function
registerServices
(
Application
$app
)
{
$this
->
extendDatabaseSchemaServices
();
$this
->
extendRepositoryMapping
();
parent
::
registerServices
(
$app
);
// TODO: Change the autogenerated stub
}
/**
* @return array
*/
protected
function
registerExtensionTables
()
{
return
[
'tourinsoft_flux'
=>
Storage\Schema\Table\Flux
::
class
,
];
}
/**
* @return array
*/
protected
function
registerRepositoryMappings
()
{
return
[
'tourinsoft_flux'
=>
[
Storage\Entity\Flux
::
class
=>
Storage\Repository\FluxRepository
::
class
],
];
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment