PluginProbe
Depicter — Popup & Slider Builder / 1.5.2
Depicter — Popup & Slider Builder v1.5.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / DataSources / Manager.php

Manager.php in Depicter — Popup & Slider Builder 1.5.2, at app/src/DataSources/Manager.php

61 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\DataSources;
3
4 /**
5 * Chained api to access all data sources
6 */
7 class Manager {
8
9 /**
10 * Returns the instance of posts class
11 *
12 * @return Posts
13 */
14 public function posts()
15 {
16 return \Depicter::resolve('depicter.dataSources.posts');
17 }
18
19 /**
20 * Returns the instance of products class
21 *
22 * @return Products
23 */
24 public function products()
25 {
26 return \Depicter::resolve('depicter.dataSources.products');
27 }
28
29 /**
30 * Returns the instance of hand picked products class
31 *
32 * @return HandPickedProducts
33 */
34 public function handPickedProducts()
35 {
36 return \Depicter::resolve('depicter.dataSources.handPickedProducts');
37 }
38
39 /**
40 * @param string $type
41 *
42 * @return Posts|Products|HandPickedProducts|bool
43 */
44 public function getByType( $type ){
45 if( 'wpPost' === $type || 'wpPage' === $type || 'wpPageHandpicked' == $type ){
46 return $this->posts();
47 }
48
49 if( 'wooProducts' === $type ){
50 return $this->products();
51 }
52
53 if( 'wooHandpicks' === $type ){
54 return $this->handPickedProducts();
55 }
56
57 return false;
58 }
59
60 }
61