<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jlorente / yii2-activerecord-inheritance example snippets
use jlorente\db\ActiveRecordInheritanceTrait,
jlorente\db\ActiveRecordInheritanceInterface;
use yii\db\ActiveRecord;
class User extends ActiveRecord {
public function tableName() {
return 'user';
}
public function doSomething() {
echo 'User does something';
}
}
class Admin extends ActiveRecord implements ActiveRecordInheritanceInterface {
use ActiveRecordInheritanceTrait;
public function tableName() {
return 'admin';
}
public static function extendsFrom() {
return User::className();
}
public function doSomething() {
echo 'Admin does something';
}
}