Popularity
4.6
Stable
Activity
3.4
Growing
465
27
17

Description

Based off the .NET's LINQ (Language integrated query), PINQ unifies querying across arrays/iterators and external data sources, in a single readable and concise fluent API.

Code Quality Rank: L4
Programming language: PHP
License: MIT License
Latest version: v3.5.0

PINQ alternatives and similar libraries

Based on the "Data Structure and Storage" category.
Alternatively, view PINQ alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of PINQ or a related project?

Add another 'Data Structure and Storage' Library

README

PHP Integrated Query - Official site

Build status Code quality Coverage Status Stable Release License

What is PINQ?

Based off the .NET's LINQ (Language integrated query), PINQ unifies querying across arrays/iterators and external data sources, in a single readable and concise fluent API.

An example

$youngPeopleDetails = $people
        ->where(function ($row) { return $row['age'] <= 50; })
        ->orderByAscending(function ($row) { return $row['firstName']; })
        ->thenByAscending(function ($row) { return $row['lastName']; })
        ->take(50)
        ->indexBy(function ($row) { return $row['phoneNumber']; })
        ->select(function ($row) { 
            return [
                'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
                'address'     => $row['address'],
                'dateOfBirth' => $row['dateOfBirth'],
            ]; 
        });

More examples

Installation

PINQ is compatible with >= PHP 5.5

Install the package via composer:

composer require timetoogo/pinq


*Note that all licence references and agreements mentioned in the PINQ README section above are relevant to that project's source code only.