PHPackages                             mongator/behaviors - 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. [Database &amp; ORM](/categories/database)
4. /
5. mongator/behaviors

ActiveLibrary[Database &amp; ORM](/categories/database)

mongator/behaviors
==================

Bahaviors for Mongator, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB

v1.5.0(12y ago)21.5kMITPHP &gt;=5.3.0

Since May 28Compare

[ Source](https://github.com/mongator/behaviors)[ Packagist](https://packagist.org/packages/mongator/behaviors)[ Docs](http://mongator.org/)[ RSS](/packages/mongator-behaviors/feed)WikiDiscussions Synced 2w ago

READMEChangelog (8)Dependencies (1)Versions (13)Used By (0)

Mongator Behaviors [![Build Status](https://camo.githubusercontent.com/40c4bed460ad0a047505a8c4b4f01d26d8e1d38223161f3b3f4dbdde093e57df/68747470733a2f2f7472617669732d63692e6f72672f6d6f6e6761746f722f6265686176696f72732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mongator/behaviors)
========================================================================================================================================================================================================================================================================================================

[](#mongator-behaviors-)

These are the official behaviors of Mongator.

- [Timestampable](doc/06_timestampable.md): Saves the creation and/or update date in the documents.
- [Ipable](doc/04_ipable.md): Saves the IP from where documents are created and/or saved.
- [Sluggable](doc/05_sluggable.md): Saves the slug of a field in the documents.
- [Archivable](doc/01_archivable.md): Saves a document copy from one collection to another.
- [Tokenizable](doc/07_tokenizable.md): Generates a token on creation.
- [Hasable](doc/03_hashable.md): Generates a hash for given fields/rels/embs from the given document, on update and/or creation.
- [AutoIncrementable](doc/02_auto_incrementable.md): Auto incrementable field like [AUTO\_INCREMENT](http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html) in MySQL
- [Identifiable](doc/08_identifiable.md): Automatically saves an identifier in the document.
- [Stringifiable](doc/09_stringifiable.md): Add to the document the magic method \_\_toString, so any document can be converted to string.
- [EmbeddedUniquable](doc/10_embeddeduniquable.md): Ensure unique embeddeds document in a embeddedsMany relation.

Requirements
------------

[](#requirements)

- PHP 5.3.x;
- mongator/mongator

Installation
------------

[](#installation)

The recommended way of installing Mongator Behaviors is [through composer](http://getcomposer.org). You can see [package information on Packagist.](https://packagist.org/packages/mongator/behaviors)

```
{
    "require": {
        "mongator/behaviors": "1.4.*"
    }
}
```

Examples
--------

[](#examples)

On your document definition just add a new array named behaviors, just like this:

```
'Model\MyCollecion' => array(
    'fields' => array(
        'title' => 'string',
    ),
    'behaviors' => array(
        array('class' => 'Mongator\Behavior\Tokenizable'),
        array('class' => 'Mongator\Behavior\Archivable'),
    ),
),
```

Tests
-----

[](#tests)

Tests are in the `tests` folder. To run them, you need PHPUnit. Example:

```
$ phpunit --configuration phpunit.xml.dist

```

License
-------

[](#license)

MIT, see [LICENSE](LICENSE)

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 62.6% 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 ~32 days

Recently: every ~47 days

Total

12

Last Release

4466d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1573114?v=4)[Máximo Cuadros](/maintainers/mcuadros)[@mcuadros](https://github.com/mcuadros)

---

Top Contributors

[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (82 commits)")[![pablodip](https://avatars.githubusercontent.com/u/98504?v=4)](https://github.com/pablodip "pablodip (29 commits)")[![filiptc](https://avatars.githubusercontent.com/u/2487390?v=4)](https://github.com/filiptc "filiptc (8 commits)")[![dripolles](https://avatars.githubusercontent.com/u/768061?v=4)](https://github.com/dripolles "dripolles (7 commits)")[![deweller](https://avatars.githubusercontent.com/u/51414?v=4)](https://github.com/deweller "deweller (4 commits)")[![javierezpeleta](https://avatars.githubusercontent.com/u/2970725?v=4)](https://github.com/javierezpeleta "javierezpeleta (1 commits)")

---

Tags

behaviorsmongator

### Embed Badge

![Health badge](/badges/mongator-behaviors/health.svg)

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

###  Alternatives

[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k126.5M465](/packages/gedmo-doctrine-extensions)[stof/doctrine-extensions-bundle

Integration of the gedmo/doctrine-extensions with Symfony

1.9k91.0M478](/packages/stof-doctrine-extensions-bundle)[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92313.1M71](/packages/knplabs-doctrine-behaviors)

PHPackages © 2026

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