2017 © Pedro Peláez
 

library propel-typehintable-behavior

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

image

willdurand/propel-typehintable-behavior

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

  • Tuesday, April 28, 2015
  • by couac
  • Repository
  • 2 Watchers
  • 19 Stars
  • 247,445 Installations
  • PHP
  • 52 Dependents
  • 25 Suggesters
  • 9 Forks
  • 5 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

TypehintableBehavior

Build Status, (*1)

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

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:, (*3)

``` ini propel.behavior.typehintable.class = path.to.TypehintableBehavior, (*4)



Usage ----- Just add the following XML tag in your `schema.xml` file: ``` xml <behavior name="typehintable"> <parameter name="COLUMN_NAME" value="TYPEHINT" /> <parameter name="RELATED_TABLE_NAME" value="TYPEHINT" /> </behavior>

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)., (*5)

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

``` xml , (*7)



Example ------- ``` xml

It will generate the following code in the BaseUser class:, (*8)

``` php <?php, (*9)

use FOS\UserBundle\Model\GroupInterface;, (*10)

// ..., (*11)

public function setRoles(array $v) { if ($this->roles_unserialized !== $v) { $this->roles_unserialized = $v; $this->roles = '| ' . implode(' | ', $v) . ' |'; $this->modifiedColumns[] = UserPeer::ROLES; }, (*12)

return $this;

}, (*13)

public function addGroup(GroupInterface $group) { if ($this->collGroups === null) { $this->initGroups(); } if (!$this->collGroups->contains($group)) { // only add it if the same object is not already associated $this->doAddGroup($group);, (*14)

    $this->collGroups[]= $group;
}

} ```, (*15)

Credits

William Durand william.durand1@gmail.com, (*16)

The Versions

28/04 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

28/04 2015

1.0.5

1.0.5.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

20/06 2013

1.0.4

1.0.4.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

15/07 2012

1.0.3

1.0.3.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

14/07 2012

1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

13/07 2012

1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint

23/04 2012

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

behavior propel typehint