PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 4.3.21
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v4.3.21
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / framework / Foundation / SetGetAttributesTrait.php

SetGetAttributesTrait.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 4.3.21, at framework/Foundation/SetGetAttributesTrait.php

114 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\Framework\Foundation;
4
5 trait SetGetAttributesTrait
6 {
7 /**
8 * Dynamic getter for application
9 * @param string $key
10 * @return mixed
11 */
12 public function __get($key)
13 {
14 return $this->make($key);
15 }
16
17 /**
18 * Dynamic setter for application
19 * @param string $key
20 * @param mixed $value
21 */
22 public function __set($key, $value)
23 {
24 $this[$key] = $value;
25 }
26
27 /**
28 * Getter for retrieving plugin's base file path
29 * @return string
30 */
31 public function getBaseFile()
32 {
33 return $this->baseFile;
34 }
35
36 /**
37 * Get application's main config
38 * @return array
39 */
40 public function getAppConfig()
41 {
42 return $this->appConfig;
43 }
44
45 /**
46 * Get application's providers
47 * @param string $type [core|plugin]
48 * @return array
49 */
50 public function getProviders($type = null)
51 {
52 $providers = $this->getAppConfig()['providers'];
53
54 return $type ? $providers[$type] : $providers;
55 }
56
57 /**
58 * Get plugin name
59 * @return string
60 */
61 public function getName()
62 {
63 return $this->getAppConfig()['plugin_name'];
64 }
65
66 /**
67 * Get plugin slug
68 * @return string
69 */
70 public function getSlug()
71 {
72 return $this->appConfig['plugin_slug'];
73 }
74
75 /**
76 * Get plugin version
77 * @return string
78 */
79 public function getVersion()
80 {
81 return $this->appConfig['plugin_version'];
82 }
83
84 /**
85 * Get plugin root namespace
86 * @return string
87 */
88 public function getNamespace()
89 {
90 return $this->getAppConfig()['autoload']['namespace'];
91 }
92
93 /**
94 * Get plugin text domain
95 * @return string
96 */
97 public function getTextDomain()
98 {
99 return $this->appConfig['plugin_text_domain']
100 ? $this->appConfig['plugin_text_domain']
101 : $this->appConfig['plugin_slug'];
102 }
103
104 /**
105 * Get application evironment
106 * @return string
107 */
108 public function getEnv()
109 {
110 if (isset($this->getAppConfig()['env'])) {
111 return $this->getAppConfig()['env'];
112 }
113 }
114 }