Model

MySQL Example

<?php

namespace App\models;

class Member extends AbstractMysqlModel
{
    protected static $table = 'member';
}

Elasticsearch Example

<?php

namespace App\models;

class Test extends AbstractEsModel
{
    protected static $index = 'test';
    protected static $type = 'test';
}
G

General Example

// Fetch property value from model object like fetching item from an array
echo $model['foo'];

// Json Encode Model Object
echo \App\components\Helper::jsonEncode($model);

Last updated