2017 © Pedro Peláez
 

yii2-extension yii2-meta-trait

Providers WordPress-like meta table functionality for tables represented by an ActiveRecord class

image

marena/yii2-meta-trait

Providers WordPress-like meta table functionality for tables represented by an ActiveRecord class

  • Sunday, July 24, 2016
  • by marena
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Yii2 Meta ActiveRecord

Providers WordPress-like meta table functionality for tables represented by an ActiveRecord class, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist mipotech/yii2-meta-activerecord "*"

or add, (*4)

"mipotech/yii2-meta-activerecord": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code as follows :, (*6)

<?php

use mipotech\metaActiveRecord\MetaActiveRecord;

class User extends MetaActiveRecord
{
    ...
}

To create a new record:, (*7)

$user = new User;
$user->firstName = 'John';      // not part of user table schema
$user->lastName = 'Doe';        // not part of user table schema
$user->username = 'johndoe1';
$user->password = Yii::$app->security->generatePasswordHash('123456');
$user->email = 'johndoe@foobar.com';
$user->registered = time();
$ret = $user->save();

To update an existing record:, (*8)

$user = User::findOne(['email'=>'johndoe@foobar.com']);
$user->firstName = 'Jane';      // not part of user table schema
$user->lastName = 'Doe1';       // not part of user table schema
$user->save();

The Versions

24/07 2016

dev-master

9999999-dev https://github.com/marena/yii2-meta-trait

Providers WordPress-like meta table functionality for tables represented by an ActiveRecord class

  Sources   Download

GPL-3.0+

The Requires

 

by Chaim Leichman

extension yii2 trait