aggregable/yii-db-typecast

Improve Yii DB typecast

Installs: 192

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii-component

0.1.4 2014-12-04 08:29 UTC

This package is not auto-updated.

Last update: 2024-04-23 00:17:51 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist aggregable/yii-db-typecast "@dev"

or add

"aggregable/yii-db-typecast": "@dev"

to the require section of your composer.json.

Component configuration

'components' => [
	'db' => [
		'driverMap' => ['mysql' => '\aggregable\yiidbtypecast\components\MySqlSchema'],
	],
	...
],

ActiveRecord models configuration

/**
 * @inheritdoc
 */
public function behaviors() {
	return array_merge(parent::behaviors(), [
		'typecast' => [
			'class' => '\aggregable\yiidbtypecast\components\ActiveRecordTypecastBehavior',
		]
	]);
}