定制 czogori/propel-postgres-hstore-behavior 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

czogori/propel-postgres-hstore-behavior

Composer 安装命令:

composer require czogori/propel-postgres-hstore-behavior

包简介

Storage of key-value items using Postgres hstore.

README 文档

README

Build Status Latest Stable Version

Storage of key-value items using Postgres hstore.

Installation

First of all you have to install postgresql-contrib and create hstore extension.

CREATE EXTENSION hstore;

After that download code using composer:

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

And put undermentioned entry to your propel.ini or build.properties configuration file:

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

Usage

Table definition - schema.xml file:

<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.

$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'); 

统计信息

  • 总下载量: 2.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固