PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.13.1
GiveWP – Donation Plugin and Fundraising Platform v2.13.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / MigrationLog / MigrationLogStatus.php
MigrationLogStatus.php
49 lines 910 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\MigrationLog;
4
5 /**
6 * Class MigrationLogStatus
7 * @package Give\MigrationLog
8 *
9 * @since 2.10.0
10 */
11 class MigrationLogStatus {
12 const SUCCESS = 'success';
13 const FAILED = 'failed';
14 const PENDING = 'pending';
15
16 /**
17 * Get default migration status
18 *
19 * @return string
20 */
21 public static function getDefault() {
22 return MigrationLogStatus::FAILED;
23 }
24
25 /**
26 * Get all migration statuses
27 *
28 * @return array
29 */
30 public static function getAll() {
31 return [
32 MigrationLogStatus::SUCCESS => esc_html__( 'Success', 'give' ),
33 MigrationLogStatus::FAILED => esc_html__( 'Failed', 'give' ),
34 MigrationLogStatus::PENDING => esc_html__( 'Pending', 'give' ),
35 ];
36 }
37
38 /**
39 * Check if value is a valid migration status
40 *
41 * @param string $status
42 *
43 * @return bool
44 */
45 public static function isValid( $status ) {
46 return array_key_exists( $status, self::getAll() );
47 }
48 }
49