EModal_Model_Modal_Meta::__construct( $id = null )
Description Description
Source Source
File: includes/importer/easy-modal-v2/model/modal/meta.php
public function __construct( $id = null ) { global $wpdb; $table_name = $wpdb->prefix . $this->_table_name; $class_name = strtolower( $this->_class_name ); $this->_default_fields['modal_id'] = $id; $this->_data = apply_filters( "{$class_name}_fields", $this->_default_fields ); if ( $id && is_numeric( $id ) ) { $row = $wpdb->get_row( "SELECT * FROM $table_name WHERE modal_id = $id ORDER BY id DESC 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