Writing LINQ in Packfire Framework
One of the greatest part of using Packfire Framework, is to have the greatest at your disposal and command. LINQ is implemented as pLinq in Packfire and is available in the `packfire.plinq` package. LINQ stands for _Language Integrated Query_ and it allows very natural way or writing codes. Packfire makes LINQ in PHP more accessible and intuitive, especially for those coming from a C# background, with thanks to PHP 5.3's Closure feature. For example: pload('packfire.plinq.pLinq'); $list = array( 'Sam', 'David', 'John', 'Jack', 'Kelvin', 'Ted' ); // get all names less than 5 characters in length // without looping, $result would contain: // ['Sam', 'John', 'Jack', 'Ted'] $result = pLinq::from($list)->where(function($e){ return strlen($e) < 5; })->toList(); Sweet isn't it? Almost all the LINQ functions in C# were ported over to PHP through `pLinq`. You can simplify very complex searches and statement into a single LINQ statement! Through the database drivers and abstraction, you can also use LINQ in Packfire Framework to help you build very sophisticated queries to solve your problem in a simple and swift manner.











