Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
demorm-publique
Commits
0eb11201
Verified
Commit
0eb11201
authored
Feb 27, 2018
by
Alexis Ragot
Browse files
fixed modification of message reference
parent
8ff3e6e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
bundle/seda/Controller/ArchiveTransferComposition.php
0 → 100644
View file @
0eb11201
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda.
*
* Bundle seda is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda. If not, see <http://www.gnu.org/licenses/>.
*/
namespace
ext\demorm_publique\bundle\seda\Controller
;
class
ArchiveTransferComposition
extends
\
ext\archivesPubliques\bundle\seda\Controller\ArchiveTransferComposition
{
/**
* Receive message with all contents embedded
* @param object $messageObject The message
* @param bool $isTemplate True if the message is a template
*
* @return string The new message identifier
*/
public
function
create
(
$messageObject
,
$isTemplate
=
false
)
{
$message
=
$this
->
composeMessage
(
$messageObject
);
$message
->
messageId
=
\
laabs
::
newId
();
if
(
$isTemplate
)
{
$message
->
status
=
'template'
;
}
$message
->
reference
=
$message
->
reference
.
"_"
.
\
laabs
::
newTimestamp
()
->
getTimestamp
()
if
(
$this
->
sdoFactory
->
exists
(
'medona/message'
,
array
(
'type'
=>
$message
->
type
,
'senderOrgRegNumber'
=>
$message
->
senderOrgRegNumber
,
'reference'
=>
$message
->
reference
)))
{
throw
\
laabs
::
newException
(
"seda/invalidMessageException"
,
"L'identifiant du message existe déjà."
);
}
$messageDir
=
$this
->
messageDirectory
.
DIRECTORY_SEPARATOR
.
(
string
)
$message
->
messageId
;
if
(
!
is_dir
(
$messageDir
))
{
mkdir
(
$messageDir
,
0777
,
true
);
}
$this
->
sdoFactory
->
create
(
$message
,
'medona/message'
);
return
$message
->
messageId
;
}
}
\ No newline at end of file
bundle/seda2/Controller/ArchiveTransferComposition.php
0 → 100644
View file @
0eb11201
<?php
/*
* Copyright (C) 2015 Maarch
*
* This file is part of bundle seda.
*
* Bundle seda is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Bundle seda is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with bundle seda. If not, see <http://www.gnu.org/licenses/>.
*/
namespace
ext\demorm_publique\bundle\seda\Controller
;
class
ArchiveTransferComposition
extends
\
ext\archivesPubliques\bundle\seda2\Controller\ArchiveTransferComposition
{
/**
* Receive message with all contents embedded
* @param object $messageObject The message
* @param bool $isTemplate True if the message is a template
*
* @return string The new message identifier
*/
public
function
create
(
$messageObject
,
$isTemplate
=
false
)
{
$message
=
$this
->
composeMessage
(
$messageObject
);
$message
->
messageId
=
\
laabs
::
newId
();
if
(
$isTemplate
)
{
$message
->
status
=
'template'
;
}
$message
->
reference
=
$message
->
reference
.
"_"
.
\
laabs
::
newTimestamp
()
->
getTimestamp
()
if
(
$this
->
sdoFactory
->
exists
(
'medona/message'
,
array
(
'type'
=>
$message
->
type
,
'senderOrgRegNumber'
=>
$message
->
senderOrgRegNumber
,
'reference'
=>
$message
->
reference
)))
{
throw
\
laabs
::
newException
(
"seda/invalidMessageException"
,
"L'identifiant du message existe déjà."
);
}
$messageDir
=
$this
->
messageDirectory
.
DIRECTORY_SEPARATOR
.
(
string
)
$message
->
messageId
;
if
(
!
is_dir
(
$messageDir
))
{
mkdir
(
$messageDir
,
0777
,
true
);
}
$this
->
sdoFactory
->
create
(
$message
,
'medona/message'
);
return
$message
->
messageId
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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