public static function all()
    {
        global $wpdb;

        $dbResults = $wpdb->get_results('SELECT * FROM ' . static::getTableName());
        $result = [];
        $model = get_called_class();
        foreach ($dbResults as $dbResult) {
            $modelObject = new $model();
            foreach (self::$columns as $column) {
                $modelObject->$column = $dbResult->$column;
            }
            $result[] = $modelObject;
        }

        return $result;
    }
public static function all()
    {
        global $wpdb;

        $dbResults = $wpdb->get_results('SELECT * FROM ' . static::getTableName());
        $result = [];
        $model = get_called_class();
        foreach ($dbResults as $dbResult) {
            $modelObject = new $model();
            foreach (self::$columns as $column) {
                $modelObject->$column = $dbResult->$column;
            }
            $result[] = $modelObject;
        }

        return $result;
    }
public static function all ( ) { global $ wpdb ; $ dbResults = $ wpdb -> get_results ( 'SELECT * FROM ' . static :: getTableName ( ) ) ; $ result = [ ] ; $ model = get_called_class ( ) ; foreach ( $ dbResults as $ dbResult ) { $ modelObject = new $ model ( ) ; foreach ( self :: $ columns as $ column ) { $ modelObject -> $ column = $ dbResult -> $ column ; } $ result [ ] = $ modelObject ; } return $ result ; }
Return all objects

@return array
Return all objects