PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.3.1
Subscriptions for WooCommerce with Stripe Recurring Payments v1.3.1
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / includes / Traits / Form_Error.php

Form_Error.php in Subscriptions for WooCommerce with Stripe Recurring Payments 1.3.1, at includes/Traits/Form_Error.php

44 lines 600 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SpringDevs\Subscription\Traits;
4
5 /**
6 * Error handler trait
7 */
8 trait Form_Error {
9
10
11 /**
12 * Holds the errors
13 *
14 * @var array
15 */
16 public $errors = array();
17
18 /**
19 * Check if the form has error
20 *
21 * @param string $key
22 *
23 * @return boolean
24 */
25 public function has_error( $key ) {
26 return isset( $this->errors[ $key ] ) ? true : false;
27 }
28
29 /**
30 * Get the error by key
31 *
32 * @param key $key
33 *
34 * @return string | false
35 */
36 public function get_error( $key ) {
37 if ( isset( $this->errors[ $key ] ) ) {
38 return $this->errors[ $key ];
39 }
40
41 return false;
42 }
43 }
44