public function find($only_count = false)
    {
        global $wpdb;

        $model = $this->model;

        // Query
        if ($only_count) {
            return (int) $wpdb->get_var($this->compose_query(true));
        }

        $results = $wpdb->get_results($this->compose_query(false));

        if ($results) {
            foreach ($results as $index => $result) {
                $results[$index] = $model::create((array) $result);
            }
        }

        return $results;
    }
public function find($only_count = false)
    {
        global $wpdb;

        $model = $this->model;

        // Query
        if ($only_count) {
            return (int) $wpdb->get_var($this->compose_query(true));
        }

        $results = $wpdb->get_results($this->compose_query(false));

        if ($results) {
            foreach ($results as $index => $result) {
                $results[$index] = $model::create((array) $result);
            }
        }

        return $results;
    }
public function find ( $ only_count = false ) { global $ wpdb ; $ model = $ this -> model ; // Query if ( $ only_count ) { return ( int ) $ wpdb -> get_var ( $ this -> compose_query ( true ) ) ; } $ results = $ wpdb -> get_results ( $ this -> compose_query ( false ) ) ; if ( $ results ) { foreach ( $ results as $ index => $ result ) { $ results [ $ index ] = $ model :: create ( ( array ) $ result ) ; } } return $ results ; }
Compose & execute our query.

@param  boolean $only_count Whether to only return the row count
@return array
Compose & execute our query .