建立表(模型)類

如何建立使用者模型類

namespace App\Model\Table;
use Cake\ORM\Table;

class UsersTable extends Table {
    public function initialize(array $config) {
        $this->table('users'); //define table name
        $this->displayField('username'); // unique or other special field of users table
        $this->primaryKey('id'); // primary key of users table
        $this->tablePrefix('prefix_'); // if prefix set tablename should be prefix_users

        // your other code here
    }

    // your other methods here
}