Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 55a6019

Browse files
author
Jamie Snape
committed
Update documentation of progress model
1 parent 35d4400 commit 55a6019

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

core/models/base/ProgressModelBase.php

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@
1919
=========================================================================*/
2020

2121
/**
22-
* Progress model base class
22+
* Producer base model class.
2323
*
24-
* The progress object is used to store a generic representation
25-
* of the progress of some event. It is used within Midas to keep track
26-
* of events that can take a long time to run. As the event is running on the server,
27-
* clients may asynchronously poll the server to request the current progress
28-
* of the event's execution.
24+
* The progress object is used to store a generic representation of the
25+
* progress of some event. It is used within the Midas Server to keep track of
26+
* events that can take a long time to run. As the event is running on the
27+
* server, clients may asynchronously poll the server to request the current
28+
* progress of the event's execution.
2929
*
30-
* If the progress object has a maximum value of 0, that means that the
31-
* progress is indeterminate.
30+
* If the progress object has a maximum value of 0, then the progress is
31+
* indeterminate.
32+
*
33+
* @package Core\Model
3234
*/
3335
abstract class ProgressModelBase extends AppModel
3436
{
35-
/** constructor */
37+
/** Constructor. */
3638
public function __construct()
3739
{
3840
parent::__construct();
@@ -51,11 +53,11 @@ public function __construct()
5153
}
5254

5355
/**
54-
* Create a new progress record beginning with current value 0
56+
* Create a new progress record beginning with the current value equal to 0.
5557
*
56-
* @param max The max (default is 0 for indeterminate)
57-
* @param message The initial progress message (defaults to empty)
58-
* @return The progress dao that was created
58+
* @param int $max maximum value of the progress (default is 0 for indeterminate)
59+
* @param string $message initial progress message (default is empty)
60+
* @return ProgressDao progress DAO
5961
*/
6062
public function createProgress($max = 0, $message = '')
6163
{
@@ -73,10 +75,11 @@ public function createProgress($max = 0, $message = '')
7375
}
7476

7577
/**
76-
* Update a progress record. Touches its update timestamp and sets its value.
78+
* Update a progress record. Touches its update timestamp and sets its value.
7779
*
78-
* @param progressDao The progress record to update
79-
* @param currentValue The current value of the progress
80+
* @param ProgressDao $progressDao progress record to update
81+
* @param int $currentValue current value of the progress
82+
* @param string $message progress message
8083
*/
8184
public function updateProgress($progressDao, $currentValue, $message = '')
8285
{
@@ -88,13 +91,15 @@ public function updateProgress($progressDao, $currentValue, $message = '')
8891
}
8992

9093
/**
91-
* Override default save so that we can unlock the session,
92-
* which is required for concurrent progress polling. See documentation of
93-
* session_write_close for explanation.
94+
* Override the default save so that we can unlock the session, which is
95+
* required for concurrent progress polling. See documentation of
96+
* session_write_close for an explanation.
97+
*
98+
* @param ProgressDao $progressDao
9499
*/
95-
public function save($dao)
100+
public function save($progressDao)
96101
{
97102
session_write_close();
98-
parent::save($dao);
103+
parent::save($progressDao);
99104
}
100105
}

core/models/pdo/ProgressModel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
require_once BASE_PATH.'/core/models/base/ProgressModelBase.php';
2222

2323
/**
24+
* Progress model.
25+
*
26+
* @package Core\Model
2427
*/
2528
class ProgressModel extends ProgressModelBase
2629
{

0 commit comments

Comments
 (0)