PHPackages                             itfieldmuseum/bimu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. itfieldmuseum/bimu

ActiveLibrary

itfieldmuseum/bimu
==================

A better IMu client.

1.9.2(5y ago)3406MITPHPPHP &gt;=7.3

Since Oct 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fieldmuseum/BIMu)[ Packagist](https://packagist.org/packages/itfieldmuseum/bimu)[ RSS](/packages/itfieldmuseum-bimu/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (20)Used By (0)

BIMu
====

[](#bimu)

A better IMu client, an attempt to improve upon the IMu API for the EMu database system, provided by Axiell.

EMu database:

IMu API documentation:

Setting up BIMu
---------------

[](#setting-up-bimu)

Include BIMu using composer: `composer require itfieldmuseum/bimu`

Getting records
---------------

[](#getting-records)

Use the search() function to search for records, and the get() functions to return records. With its basic usage, the search function takes a key, value array of criteria for its first parameter and an array of fields to return for its second parameter.

```
require_once __DIR__ . '/vendor/autoload.php';

use BIMu\BIMu;

$bimu = new BIMu("1.1.1.1", 40107, "enarratives");
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$records = $bimu->getAll();

```

Getting a certain number of records
-----------------------------------

[](#getting-a-certain-number-of-records)

Use the get() function. The first parameter is an integer of the number of records you want to return. The second parameter is how many records offset you'd like your record retrieval to begin.

If no parameters are passed, the get() function defaults to retrieving 1 record at an offset of 0.

This example returns 50 records at an offset of 200. If you don't include a search operator, a fuzzy, "contains" search will be done.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$records = $bimu->get(50, 200);

```

Getting one record
------------------

[](#getting-one-record)

Use the getOne() function. If you'd like to grab one record at an offset, pass an integer value to get a record at that offset.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$records = $bimu->getOne();

```

Get a record at an offset of 2.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$records = $bimu->getOne(2);

```

Retrieving results hits
-----------------------

[](#retrieving-results-hits)

Perform a search first, then call the hits function.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$hits = $bimu->hits();

```

Retrieving results count
------------------------

[](#retrieving-results-count)

You must perform a search, then a get, to be able to access the count.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$records = $bimu->getAll();
$count = $bimu->count();

```

Doing an OR search
------------------

[](#doing-an-or-search)

By default, the criteria array for the search() function will perform an AND search. If you need to do an OR search, be sure to specify that in your search function.

```
$bimu->search(
    ["DesSubjects_tab" => "My Subject", "DesSubjects_tab" => "Second subject"],
    ["irn", "NarTitle"],
    "=",
    "OR"
);

```

Comparison operators
--------------------

[](#comparison-operators)

This operator specifies how the value should search against the field value. The search operator to use, defaults to null, which is a fuzzy match.

Other options include:
`=` (equals)
`` (does not equal)
`=` (greater than or equal to)

Example search:

```
$bimu->search(
    ["DesSubjects_tab" => "My Subject", "DesSubjects_tab" => "Second subject"],
    ["irn", "NarTitle"],
    "",
    "OR"
);

```

Doing complex searches with combinations of AND/OR
--------------------------------------------------

[](#doing-complex-searches-with-combinations-of-andor)

If you need to do a more complex search, with combinations of AND and OR criteria, use the IMu API documentation here:

The IMu API is included in the classpath with BIMu, so you can perform an IMu API search as shown in the original documentation.

StreamEOF error
---------------

[](#streameof-error)

If you're encountering a StreamEOF error from trying to return lots of records, your best bet is to run two separate queries. First, do a getAll() and only return the IRN (id) of the records, then loop through all of your returned IRNs (IDs) and perform a getOne() for each record.

Updating records
----------------

[](#updating-records)

Use the updateOne() function if you'd like to update only one record.

Use the update() function if you'd like to update ALL of the records returned from a search.

Be sure you perform a search() before trying to update any records.

$valuesToUpdate needs to be an associative array of fields to update with their record values. $fieldsToReturn is an array of the backend record fields to return from the update.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$valuesToUpdate = [
    "NarTitle" => "My new title",
    "SumSubtitle" => "Updated subtitle"
];
$fieldsToReturn = ["irn", "NarTitle", "SumSubtitle"];
$record = $bimu->updateOne($valuesToUpdate, $fieldsToReturn);

```

Deleting records
----------------

[](#deleting-records)

Use the delete() function if you'd like to remove records from an EMu module.

Be sure you perform a search() before trying to delete records.

$numberOfRecordsToDelete specifies how many records you'd like to delete from the records returned from the search.

The delete() function returns the number of records deleted.

```
$bimu->search(["DesSubjects_tab" => "My Subject"], ["irn", "NarTitle"]);
$numberRecordsDeleted = $bimu->delete(1);

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~76 days

Recently: every ~126 days

Total

19

Last Release

2124d ago

PHP version history (2 changes)1.0PHP &gt;=7.0.0

1.9PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d6401d31eb549d907a46432051bafe1d1c26e689d519152ce0b434fab8a5d0d?d=identicon)[pete\_herbst\_fmnh](/maintainers/pete_herbst_fmnh)

---

Top Contributors

[![peteherbst](https://avatars.githubusercontent.com/u/775699?v=4)](https://github.com/peteherbst "peteherbst (35 commits)")

---

Tags

axiellemuimumuseumsIMuEMuField Museum

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itfieldmuseum-bimu/health.svg)

```
[![Health](https://phpackages.com/badges/itfieldmuseum-bimu/health.svg)](https://phpackages.com/packages/itfieldmuseum-bimu)
```

###  Alternatives

[plug-and-pay/sdk-php

This is a PHP SDK to make easier to communicate with the Plug&amp;Pay API.

10109.6k](/packages/plug-and-pay-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
