PHPackages                             net\_bazzline/php\_propel\_behavior\_entity\_instantiator - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. net\_bazzline/php\_propel\_behavior\_entity\_instantiator

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

net\_bazzline/php\_propel\_behavior\_entity\_instantiator
=========================================================

This free as in freedom behavior that easy up entity instantiation for propel

3.0.0(5y ago)21.4k2[2 issues](https://github.com/bazzline/php_propel_behavior_entity_instantiator/issues)LGPL-3.0PHPPHP &gt;=7.4

Since Aug 31Pushed 4y ago5 watchersCompare

[ Source](https://github.com/bazzline/php_propel_behavior_entity_instantiator)[ Packagist](https://packagist.org/packages/net_bazzline/php_propel_behavior_entity_instantiator)[ RSS](/packages/net-bazzline-php-propel-behavior-entity-instantiator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (21)Used By (0)

Full Stop
=========

[](#full-stop)

I still like the idea but there is currently no use case to develop it anymore.

Entity Instantiator Generator Behavior for Propel
=================================================

[](#entity-instantiator-generator-behavior-for-propel)

This free as in freedom behavior that easy up entity instantiation for your [propel](http://www.propelorm.org) query and object classes.

Thanks to the [ExtraPropertiesBehavior](https://github.com/Carpe-Hora/ExtraPropertiesBehavior) to act as such a great template.

The build status of the current master branch is tracked by Travis CI: [![Build Status](https://camo.githubusercontent.com/624e55c119a697c2c4073730eb926356687614416d68c74b0dca246411b52b4a/68747470733a2f2f7472617669732d63692e6f72672f62617a7a6c696e652f7068705f70726f70656c5f6265686176696f725f656e746974795f696e7374616e746961746f722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/bazzline/php_propel_behavior_entity_instantiator)[![Latest stable](https://camo.githubusercontent.com/70eb728c827bba3e6fedf652502c11e0afde61a7564dc9de3134ed211ba9392c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65745f62617a7a6c696e652f7068705f70726f70656c5f6265686176696f725f656e746974795f696e7374616e746961746f722e737667)](https://packagist.org/packages/net_bazzline/php_propel_behavior_entity_instantiator)

The scrutinizer status are: [![code quality](https://camo.githubusercontent.com/43dfdc10507e4c8c399e8b26bb7aacb5877c4417f021d90b46278b5a61080ae0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617a7a6c696e652f7068705f70726f70656c5f6265686176696f725f656e746974795f696e7374616e746961746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bazzline/php_propel_behavior_entity_instantiator/) | [![build status](https://camo.githubusercontent.com/e4259d899c9164469250d78fbeadfe2dc695b9f13b1620c76651d3a385c27793/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62617a7a6c696e652f7068705f70726f70656c5f6265686176696f725f656e746974795f696e7374616e746961746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bazzline/php_propel_behavior_entity_instantiator/)

The versioneye status is: [![dependencies](https://camo.githubusercontent.com/4807a61ac455b26fbb82697515bd17cd01fcaee09916ffd99b42a8153255dded/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535653332323266666562386364316135303030303935382f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/55e3222ffeb8cd1a50000958)

Downloads: [![Downloads this Month](https://camo.githubusercontent.com/feb40d7bec3289d3b87f508e7403f960958bce3754cd73ea535cd1d813d1dd30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65745f62617a7a6c696e652f7068705f70726f70656c5f6265686176696f725f656e746974795f696e7374616e746961746f722e737667)](https://packagist.org/packages/net_bazzline/php_propel_behavior_entity_instantiator)

It is available at [openhub.net](https://openhub.net/p/php_propel_behavior_entity_instantiator).

If you want to control things in more detail, you should have a look to the [locator generator component for php](https://github.com/bazzline/php_component_locator_generator) and its [propel examples](https://github.com/bazzline/php_component_locator_generator/tree/master/example)

The current change log can be found [here](https://github.com/bazzline/php_propel_behavior_entity_instantiator/blob/master/CHANGELOG.md).

Why
===

[](#why)

- no `new` in your code anymore
- no static `Query::create` call in your code anymore
- eases up writing test code (`createMyEntity` and `createMyEntityQuery` can be mocked)

Usage
=====

[](#usage)

- make sure you have `extension=pdo_sqlite.so` enabled if you want to run phpunit
- the behavior creates a instantiator class and file
- the behavior has following parameters
    - `entity_instantiator_add_to_entity_instantiator` - ("true"|"false") allowed to add or not add this table to the instantiator, default is `true`
    - `entity_instantiator_class_name` - (string) that represents the class name, default is `DatabaseEntityInstantiator`
    - `entity_instantiator_extends` - (string) that represents the full qualified class name, default is ``
    - `entity_instantiator_indention`- (string) that represents the indention in the instantiator, default is `    `
    - `entity_instantiator_namespace`- (string) that represents the namespace in the instantiator, default is `` (no namespace)
    - `entity_instantiator_path_to_output`- (string) that represents the path (relative to `vendor/../`) where the instantiator file will be written, default is `data`
    - `entity_instantiator_method_name_prefix`- (string) that represents the prefix for each instantiation method in the instantiator, default is `create`
    - `entity_instantiator_default_connection_mode` - (string) that represents the content of the second optional argument in Propel::getConnection($name, $mode)
    - `entity_instantiator_default_connection_name` - (string) that represents the content of the first optional argument in Propel::getConnection($name, $mode)
    - `entity_instantiator_use_fully_qualified_name` - ("true"|"false") allows to switch usage between fully qualified name or class name, default is `false`

Example
=======

[](#example)

Given a database with following settings

```

```

will create a file called `MyEntityInstantiator.php` in the path `module/Database/src/Database/Service` with following content.

```
