Skip to content

Commit

Permalink
[API] redeclare strict types and simplify projectdicomsrowprovisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
spell00 committed Aug 4, 2020
1 parent d902ad7 commit 66c17ec
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions modules/api/php/provisioners/projectdicomsrowprovisioner.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ class ProjectDicomsRowProvisioner extends DBObjectProvisioner
/**
* Create a RowProvisioner
*
* @param \Project $project The project from which dicoms are requested
* @param \DateTime $since The project from which dicoms are requested
* @param \Project $project The project from which dicoms are requested
* @param \DateTime $since The date from which dicoms are requested
* @param string $classname The class name of the returned objects
*/
function __construct(\Project $project, \DateTime $since)
{
function __construct(
\Project $project,
\DateTime $since,
string $classname='default'
) {
parent::__construct(
'
SELECT
Expand All @@ -54,7 +58,7 @@ class ProjectDicomsRowProvisioner extends DBObjectProvisioner
t.TarchiveID as tarchiveid,
t.DicomArchiveID as DicomArchiveID,
t.ArchiveLocation as Archive,
t.SourceLocation as Source,
t.SourceLocation as Source,
FROM
tarchive t
LEFT JOIN session s
Expand All @@ -66,16 +70,17 @@ class ProjectDicomsRowProvisioner extends DBObjectProvisioner
LEFT JOIN Project project
ON (c.RegistrationProjectID = project.ProjectID)
WHERE
c.Active = \'Y\' AND
s.Active = \'Y\' AND
c.Active = "Y" AND
s.Active = "Y" AND
project.Name = :v_projectname AND
t.DateLastArchived > :v_time
ORDER BY t.DateLastArchived ASC
',
[
'v_projectname' => $project->getName(),
'v_time' => $since->getTimestamp(),
]
],
$classname
);
}

Expand Down

0 comments on commit 66c17ec

Please sign in to comment.