2017 © Pedro Peláez
 

library propel-postgres-hstore-behavior

Storage of key-value items using Postgres hstore.

image

czogori/propel-postgres-hstore-behavior

Storage of key-value items using Postgres hstore.

  • Monday, February 29, 2016
  • by czogori
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1,160 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

PostgresHstoreBehavior

Build Status Latest Stable Version, (*1)

Storage of key-value items using Postgres hstore., (*2)

Installation

First of all you have to install postgresql-contrib and create hstore extension., (*3)

CREATE EXTENSION hstore;

After that download code using composer:, (*4)

{
    "require": {        
        "czogori/propel-postgres-hstore-behavior": "dev-master"
    }
}

And put undermentioned entry to your propel.ini or build.properties configuration file:, (*5)

propel.behavior.hstore.class = path.to.PostgresHstoreBehavior

Usage

Table definition - schema.xml file:, (*6)

<table name="book" phpName="Book">    
        <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
        <column name="title" type="varchar" size="255" required="true" />
        <column name="extra_parameters" type="varchar" required="false" />    
        <behavior name="hstore">
            <parameter name="column_name" value="extra_parameters" />       
        </behavior>
</table>

Now you can use hstore behavior., (*7)

$book = new Book();
$book->setTitle('Foo and Bar');
// you can set params as array
$book->setExtraParameters(array('language' => 'polish'));
// or like this
$book->setLanguage('polish');
$book->save();

echo $book->getLanguage();
echo $book->getExtraParameters('language'); 

The Versions

29/02 2016

dev-master

9999999-dev https://github.com/czogori/PostgresHstoreBehavior

Storage of key-value items using Postgres hstore.

  Sources   Download

MIT

The Requires

 

by Arek Jaskólski

postgresql postgres behavior propel hstore

18/01 2014

v0.9.1

0.9.1.0 https://github.com/czogori/PostgresHstoreBehavior

Storage of key-value items using Postgres hstore.

  Sources   Download

MIT

The Requires

 

by Arek Jaskólski

postgresql postgres behavior propel hstore