src/Ouzo/Core/Model.php
public static function findBySql($nativeSql, $params = [])
    {
        $meta = static::metaInstance();
        $results = $meta->modelDefinition->db->query($nativeSql, Arrays::toArray($params))->fetchAll();

        return Arrays::map($results, function ($row) use ($meta) {
            return $meta->newInstance($row);
        });
    }
public static function findBySql($nativeSql, $params = [])
    {
        $meta = static::metaInstance();
        $results = $meta->modelDefinition->db->query($nativeSql, Arrays::toArray($params))->fetchAll();

        return Arrays::map($results, function ($row) use ($meta) {
            return $meta->newInstance($row);
        });
    }
public static function findBySql ( $ nativeSql , $ params = [ ] ) { $ meta = static :: metaInstance ( ) ; $ results = $ meta -> modelDefinition -> db -> query ( $ nativeSql , Arrays :: toArray ( $ params ) ) -> fetchAll ( ) ; return Arrays :: map ( $ results , function ( $ row ) use ( $ meta ) { return $ meta -> newInstance ( $ row ) ; } ) ; }
Executes a native sql and returns an array of model objects created by passing every result row to the model constructor.
@param string $nativeSql - database specific sql
@param array $params - bind parameters
@return Model[]
Executes a native sql and returns an array of model objects created by passing every result row to the model constructor .