tags:

views:

130

answers:

3

Language Integrated Query. Now I know that the acronyms are. I have seen C# examples, but can't really understand them. Can I use them with PHP? Can I use it along with ORM? Has any PHP MVC framework has this?

+5  A: 

Check out PHPLinq, I've not used it but it is a library that mimics linq for use in PHP.

Fermin
A: 

LINQ is basically a library combined with changes to a number of .Net languages that allows you to write queries against the objects in your program... This is a vast over simplification, but it treats collections of objects in a similar manner to that in which SQL treats tables... The objects within those collections are analogous with a record in a database table, and the properties of these objects are analogous to columns on a table in SQL.

The syntax is a little different to SQL, but it gets easier as you use it.

Can't speak for PHPLinq, but if it's as good as LINQ itself, you're in for a treat...

Martin Milan
LINQ is more than a library - it's the language integration side too. Without lambda expressions and extension methods, for example, it would be relatively unusable.
Jon Skeet
@Jon: Php is dynamic and PhpLINQ is implemented with run-time evaluation of the code, sort of embedding a script in a script and it looks pretty good. I bet you can get hit by a few nasty run-time surprises though.
Martin Wickman
@Jon: Yes, my calling it a library is a bit of a simplification as well... I'll edit it...
Martin Milan
A: 

LINQ is a dotnet technology, so you can't use it outside the domain of Microsoft. LINQ is a way of integrating SQL (and other similar data queries) as syntactic constructs in the language. So it's an extension of the language, not a library.

troelskn
As Fermin has pointed out though, the PHPLinQ project gives similar abilities to PHP programmers...
Martin Milan