public static function findBy($criteria = [], $single = false)
    {
        global $wpdb;
        $return = [];
        $query = static::getQueryByCriteria($criteria);
        $dbResults = $wpdb->get_results($query);

        if ($single && isset($dbResults[0])) {
            return static::getModelFromDBObject($dbResults[0]);
        }

        foreach ($dbResults as $object) {
            $return[] = static::getModelFromDBObject($object);
        }

        return $return;
    }