Pod

Include and Init the Pods class.

Defined (1)

The class is defined in the following location(s).

/deprecated/deprecated.php  
  1. class Pod 
  2. private $new; 
  3.  
  4. public static $deprecated_notice = true; 
  5.  
  6. public $body_classes; 
  7.  
  8. public $ui = array(); 
  9.  
  10. public $meta = array(); 
  11.  
  12. public $meta_properties = array(); 
  13.  
  14. public $meta_extra = ''; 
  15.  
  16. function __construct ($type = null, $id = null) { 
  17. if ( self::$deprecated_notice ) { 
  18. pods_deprecated( 'PodAPI (class)', '2.0', 'pods_api (function)' ); 
  19.  
  20. pods_deprecated('Pod (class)', '2.0', 'pods (function)'); 
  21.  
  22. $this->new = pods( $type, $id ); 
  23.  
  24. /** 
  25. * Handle variables that have been deprecated 
  26. * @since 2.0 
  27. */ 
  28. public function __get ( $name ) { 
  29. $name = (string) $name; 
  30.  
  31. if ( 'data' == $name ) { 
  32. if ( self::$deprecated_notice ) { 
  33. pods_deprecated( "Pods->{$name}", '2.0', "Pods->row()" ); 
  34.  
  35. $var = $this->new->row(); 
  36. elseif ( '_data' == $name ) 
  37. $var = $this->new->data; 
  38. elseif ( 'total' == $name ) { 
  39. if ( self::$deprecated_notice ) { 
  40. pods_deprecated( "Pods->{$name}", '2.0', "Pods->total()" ); 
  41.  
  42. $var = $this->new->total(); 
  43. elseif ( 'total_rows' == $name ) { 
  44. if ( self::$deprecated_notice ) { 
  45. pods_deprecated( "Pods->{$name}", '2.0', "Pods->total_found()" ); 
  46.  
  47. $var = $this->new->total_found(); 
  48. elseif ( 'zebra' == $name ) { 
  49. if ( self::$deprecated_notice ) { 
  50. pods_deprecated( "Pods->{$name}", '2.0', "Pods->zebra()" ); 
  51.  
  52. $var = $this->new->zebra(); 
  53. else 
  54. $var = $this->new->{$name}; 
  55.  
  56. return $var; 
  57.  
  58. /** 
  59. * Handle variables that have been deprecated 
  60. * @since 2.0 
  61. */ 
  62. public function __set ( $name, $value ) { 
  63. $name = (string) $name; 
  64.  
  65. $this->new->{$name} = $value; 
  66.  
  67. return $value; 
  68.  
  69. /** 
  70. * Handle methods that have been deprecated 
  71. * @since 2.0 
  72. */ 
  73. public function __call ( $name, $args ) { 
  74. $name = (string) $name; 
  75.  
  76. return call_user_func_array( array( $this->new, $name ), $args ); 
  77.  
  78. /** 
  79. * Handle variables that have been deprecated 
  80. * @since 2.0 
  81. */ 
  82. public function __isset ( $name ) { 
  83. $name = (string) $name; 
  84.  
  85. if ( in_array( $name, array( '_data', 'data', 'total', 'total_rows', 'zebra' ) ) ) 
  86. return true; 
  87. elseif ( in_array( $name, array( 'meta', 'meta_properties', 'meta_extra' ) ) ) 
  88. return true; 
  89. else 
  90. return isset( $this->new->{$name} );