-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7172 from Automattic/update/split-progress-models
Split progress models
- Loading branch information
Showing
52 changed files
with
1,989 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...internal/student-progress/course-progress/models/class-comments-based-course-progress.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* File containing the Comments_Based_Course_Progress class. | ||
* | ||
* @package sensei | ||
*/ | ||
|
||
namespace Sensei\Internal\Student_Progress\Course_Progress\Models; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Class Comments_Based_Course_Progress. | ||
* | ||
* @internal | ||
* | ||
* @since $$next-version$$ | ||
*/ | ||
class Comments_Based_Course_Progress extends Course_Progress_Abstract { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
...udes/internal/student-progress/course-progress/models/class-course-progress-interface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?php | ||
/** | ||
* File containing the Course_Progress_Interface. | ||
* | ||
* @package sensei | ||
*/ | ||
|
||
namespace Sensei\Internal\Student_Progress\Course_Progress\Models; | ||
|
||
use DateTimeInterface; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Interfaces Course_Progress_Interface. | ||
* | ||
* @internal | ||
* | ||
* @since $$next-version$$ | ||
*/ | ||
interface Course_Progress_Interface { | ||
/** | ||
* Status course in progress. | ||
* | ||
* @internal | ||
*/ | ||
public const STATUS_IN_PROGRESS = 'in-progress'; | ||
|
||
/** | ||
* Status course complete. | ||
* | ||
* @internal | ||
*/ | ||
public const STATUS_COMPLETE = 'complete'; | ||
|
||
/** | ||
* Set in-progress status and start date. | ||
* | ||
* @internal | ||
* | ||
* @param DateTimeInterface|null $started_at Course start date. | ||
*/ | ||
public function start( DateTimeInterface $started_at = null ): void; | ||
|
||
/** | ||
* Set complete status and completion date. | ||
* | ||
* @internal | ||
* | ||
* @param DateTimeInterface|null $completed_at Course completion date. | ||
*/ | ||
public function complete( DateTimeInterface $completed_at = null ): void; | ||
|
||
/** | ||
* Returns the progress identifier. | ||
* | ||
* @internal | ||
* | ||
* @return int | ||
*/ | ||
public function get_id(): int; | ||
|
||
/** | ||
* Returns the course identifier. | ||
* | ||
* @internal | ||
* | ||
* @return int | ||
*/ | ||
public function get_course_id(): int; | ||
|
||
/** | ||
* Returns the user identifier. | ||
* | ||
* @internal | ||
* | ||
* @return int | ||
*/ | ||
public function get_user_id(): int; | ||
|
||
/** | ||
* Returns the course progress status. | ||
* | ||
* @internal | ||
* | ||
* @return string|null | ||
*/ | ||
public function get_status(): ?string; | ||
|
||
/** | ||
* Returns the course start date. | ||
* | ||
* @internal | ||
* | ||
* @return DateTimeInterface|null | ||
*/ | ||
public function get_started_at(): ?DateTimeInterface; | ||
|
||
/** | ||
* Returns the course completion date. | ||
* | ||
* @internal | ||
* | ||
* @return DateTimeInterface|null | ||
*/ | ||
public function get_completed_at(): ?DateTimeInterface; | ||
|
||
/** | ||
* Returns the course progress updated date. | ||
* | ||
* @internal | ||
* | ||
* @return DateTimeInterface | ||
*/ | ||
public function get_updated_at(): DateTimeInterface; | ||
|
||
/** | ||
* Returns the course progress created date. | ||
* | ||
* @internal | ||
* | ||
* @return DateTimeInterface | ||
*/ | ||
public function get_created_at(): DateTimeInterface; | ||
|
||
/** | ||
* Set the course progress updated date. | ||
* | ||
* @internal | ||
* | ||
* @param DateTimeInterface $updated_at Course progress updated date. | ||
*/ | ||
public function set_updated_at( DateTimeInterface $updated_at ): void; | ||
} |
22 changes: 22 additions & 0 deletions
22
...s/internal/student-progress/course-progress/models/class-tables-based-course-progress.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* File containing the Tables_Based_Course_Progress class. | ||
* | ||
* @package sensei | ||
*/ | ||
|
||
namespace Sensei\Internal\Student_Progress\Course_Progress\Models; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Class Tables_Based_Course_Progress. | ||
* | ||
* @internal | ||
* | ||
* @since $$next-version$$ | ||
*/ | ||
class Tables_Based_Course_Progress extends Course_Progress_Abstract { | ||
} |
Oops, something went wrong.