Carbon_Fields\Datastore\Meta_Datastore::load PHP Method

load() public method

Load the field value(s) from the database.
public load ( Field $field )
$field Carbon_Fields\Field\Field The field to retrieve value for.
    public function load(Field $field)
    {
        global $wpdb;
        $value = $wpdb->get_col('
			SELECT `meta_value`
			FROM ' . $this->get_table_name() . '
			WHERE `' . $this->get_table_field_name() . '`=' . intval($this->get_id()) . '
			AND `meta_key`="' . $this->get_field_name($field) . '"
			LIMIT 1
		');
        if (!is_array($value) || count($value) < 1) {
            $field->set_value(false);
            return;
        }
        $field->set_value($value[0]);
    }