_wpdb = $wpdb; } /** * Returns table name * * @since 1.0.0 * * @return string */ protected function get_table(){ return $this->_wpdb->base_prefix . Hustle_Db::TABLE_HUSTLE_MODULES; } /** * Returns meta table name * * @since 1.0.0 * * @return string */ protected function get_meta_table(){ return $this->_wpdb->base_prefix . Hustle_Db::TABLE_HUSTLE_MODULES_META; } /** * Returns format for optin table * * * @since 1.0.0 * * @return array */ protected function get_format(){ return array( "blog_id" => "%d", "module_name" => "%s", "module_type" => "%s", "active" => "%d", "test_mode" => "%d" ); } /** * Implements setter magic method * * * @since 1.0.0 * * @param $property * @param $val */ function __set($property, $val){ $this->{$property} = $val; } /** * Implements getter magic method * * * @since 1.0.0 * * @param $field * @return mixed */ function __get( $field ){ if( method_exists( $this, "get_" . $field ) ) return $this->{"get_". $field}(); if( !empty( $this->_data ) && isset( $this->_data->{$field} ) ) return $this->_data->{$field}; } }