Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
/ Pinq Public archive
forked from TimeToogo/Pinq

PHP Integrated Query, a real LINQ library for PHP

License

Notifications You must be signed in to change notification settings

Goldinteractive/Pinq

 
 

Repository files navigation

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.4

Add package to your composer.json:

{
    "require": {
        "timetoogo/pinq": "~3.2"
    }
}

About

PHP Integrated Query, a real LINQ library for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%