Popularity
4.5
Declining
Activity
0.0
Stable
436
27
14

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
Monthly Downloads: 1,040
Programming language: PHP
License: MIT License
Latest version: v3.4.1

PINQ alternatives and similar libraries

Based on the "Data Structure and Storage" category

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.