PHPackages                             willdurand/propel-typehintable-behavior - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. willdurand/propel-typehintable-behavior

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

willdurand/propel-typehintable-behavior
=======================================

Insane Propel behavior that helps you to be compliant with third-party interfaces by adding type hint to generated methods.

1.0.5(11y ago)22541.6k—8.7%10[1 PRs](https://github.com/willdurand/TypehintableBehavior/pulls)20MITPHP

Since Apr 22Pushed 11y ago2 watchersCompare

[ Source](https://github.com/willdurand/TypehintableBehavior)[ Packagist](https://packagist.org/packages/willdurand/propel-typehintable-behavior)[ RSS](/packages/willdurand-propel-typehintable-behavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (20)

TypehintableBehavior
====================

[](#typehintablebehavior)

[![Build Status](https://camo.githubusercontent.com/6801ab65d6e77898df152d9682def58dd325c1f03a6e2427d5c0c93709c19f92/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f77696c6c647572616e642f5479706568696e7461626c654265686176696f722e706e67)](http://travis-ci.org/willdurand/TypehintableBehavior)

The **TypehintableBehavior** behavior allows you to add typehints to generated methods (in *Base* classes).

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

[](#installation)

Cherry-pick the `TypehintableBehavior.php` file is `src/`, put it somewhere, then add the following line to your `propel.ini` or `build.properties` configuration file:

```
propel.behavior.typehintable.class = path.to.TypehintableBehavior
```

Usage
-----

[](#usage)

Just add the following XML tag in your `schema.xml` file:

```

```

If you fill in a column name as parameter's name, the typehint will be added to the corresponding setter methods (`setRoles()` for instance). If you fill in a related table name as parameter's name, the typehint will be added to the adder/remover methods (`addGroup()`, `removeGroup()` for instance).

You can also specify nullable method signatures (`setFoo(Foo $foo = null)`):

```

```

Example
-------

[](#example)

```

```

It will generate the following code in the `BaseUser` class:

```
