EModal_Model::__construct( $id = null, $limit = 1 )
Description Description
Source Source
File: includes/importer/easy-modal-v2/model.php
public function __construct( $id = null, $limit = 1 ) { global $wpdb; $table_name = $wpdb->prefix . $this->_table_name; $class_name = strtolower( $this->_class_name ); $this->_data = apply_filters( "{$class_name}_fields", $this->_default_fields ); if ( $id && is_numeric( $id ) ) { $row = $wpdb->get_row( "SELECT * FROM $table_name WHERE $this->_pk = $id LIMIT 1", ARRAY_A ); if ( $row[ $this->_pk ] ) { $this->process_load( $row ); } } else { $this->set_fields( apply_filters( "{$class_name}_defaults", array() ) ); } return $this; }
Expand full source code Collapse full source code View on Trac