Download the PHP package linq/php-linq without Composer
On this page you can find all versions of the php package linq/php-linq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download linq/php-linq
More information about linq/php-linq
Files in linq/php-linq
Package php-linq
Short Description the fast and modern library for easy data manipulation
License Apache-2.0
Informations about the package php-linq
php-linq
Linq technology in php language.
Install
class Linq
Base class that performs queries over the collections of objects and over the array.
List of methods
- from() - set primary source
- first() - return first item from collection
- last() - return last item from collection
- select($key = null, $key2 = null) - return result. You can use callable as first param
- count() - return length of collection
- take($offset, $length = null) - return first x items || return interval
- skip($offset) - skip x items a and return other data
- where($condition) - returns only elements that match a given condition
- reverse() - reverse collection
- orderBy($column, $desc = false) - sort. desc = descending. defalt asc = ascending
- distinct() - return unique items
- takeWhile($requirement) - combination = where(condition) + select()
- union($array) - union in sql
- groupBy($key) - Group data
- innerJoin($array) - return only elements that combine both fields
- leftJoin($array) - the first collection will list all entries, even those which do not connect with other collections
- on($condition) - Condition for join two collections
- in($filter) - Accepts an array of values which elements must acquire
- notIn($filter) - negation of "in" method
- onlyKeys($keys) - filtering data by key
- row_to_column($main_node) - split by a specific key. This key becomes a major hub
testing data
example of use
class JsonLinq
The class takes data source in JSON format. Returns array.
testing data
example of use
class XmlLinq
The class takes data source in JSON format. Returns array.
The "from" method accept string or SimpleXmlElement. If out choose xml in string, so you will work with array. If you choose xml in SimlpeXmlElement object, so you will work with collection of std objects.
testing data
example of use