oranfry/obex

There is no license information available for the latest version (2.1.0) of this package.

2.1.0 2024-08-23 23:15 UTC

This package is auto-updated.

Last update: 2024-12-24 00:19:30 UTC


README

Installation

cd /path/to/project
composer require oranfry/obex

Examples

use obex\Obex;

require 'vendor/autoload.php';

$cats = Obex::from([
    (object) [
        'name' => 'Misty',
        'nickname' => 'Moo',
        'likes' => (object) ['favourite' => 'Beef', 'other' => ['Venison']],
    ],
    (object) [
        'name' => 'Amber',
        'nickname' => 'Liu',
        'likes' => (object) ['favourite' => 'Veal', 'other' => ['Turkey']],
    ],
]);

echo $cats
    ->find('name', 'is', 'Amber')
    ->nickname; // Liu

echo $cats
    ->filter('->likes->favourite', 'is', 'Beef')
    ->first()
    ->name; // Misty