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
3ccaf0ca
Commit
3ccaf0ca
authored
Nov 13, 2018
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(all): update fields
parent
8627ee38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ContentTypeFile.php
src/Utils/ContentTypeFile.php
+5
-5
No files found.
src/Utils/ContentTypeFile.php
View file @
3ccaf0ca
...
@@ -36,7 +36,7 @@ class ContentTypeFile
...
@@ -36,7 +36,7 @@ class ContentTypeFile
*/
*/
public
function
__construct
(
Application
$application
,
Flux
$flux
,
array
$keys
=
[],
array
$options
=
[])
public
function
__construct
(
Application
$application
,
Flux
$flux
,
array
$keys
=
[],
array
$options
=
[])
{
{
if
(
empty
(
$flux
->
getCode
())
||
empty
(
$flux
->
getContentType
()))
{
if
(
empty
(
$flux
->
get
Flux
Code
())
||
empty
(
$flux
->
getContentType
()))
{
throw
new
\Exception
(
'Le flux est invalide.'
);
throw
new
\Exception
(
'Le flux est invalide.'
);
}
}
$this
->
keys
=
$keys
;
$this
->
keys
=
$keys
;
...
@@ -50,7 +50,7 @@ class ContentTypeFile
...
@@ -50,7 +50,7 @@ class ContentTypeFile
*/
*/
public
function
updateInFile
()
{
public
function
updateInFile
()
{
$data
=
[
$data
=
[
$this
->
flux
->
getCode
()
=>
[
$this
->
flux
->
get
Flux
Code
()
=>
[
'name'
=>
ucfirst
(
$this
->
flux
->
getTitle
()),
'name'
=>
ucfirst
(
$this
->
flux
->
getTitle
()),
'slug'
=>
strtolower
(
$this
->
flux
->
getTitle
()),
'slug'
=>
strtolower
(
$this
->
flux
->
getTitle
()),
'singular_name'
=>
ucfirst
(
$this
->
flux
->
getContentType
()),
'singular_name'
=>
ucfirst
(
$this
->
flux
->
getContentType
()),
...
@@ -141,10 +141,10 @@ class ContentTypeFile
...
@@ -141,10 +141,10 @@ class ContentTypeFile
if
(
$file
->
exists
())
{
if
(
$file
->
exists
())
{
$yamlData
=
$file
->
parse
();
$yamlData
=
$file
->
parse
();
if
(
$delete
)
{
if
(
$delete
)
{
unset
(
$yamlData
[
$this
->
flux
->
getCode
()]);
unset
(
$yamlData
[
$this
->
flux
->
get
Flux
Code
()]);
}
else
{
}
else
{
if
(
!
empty
(
$yamlData
[
$this
->
flux
->
getCode
()]))
{
if
(
!
empty
(
$yamlData
[
$this
->
flux
->
get
Flux
Code
()]))
{
unset
(
$yamlData
[
$this
->
flux
->
getCode
()]);
unset
(
$yamlData
[
$this
->
flux
->
get
Flux
Code
()]);
}
}
$yamlData
+=
$data
;
$yamlData
+=
$data
;
}
}
...
...
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