$this->table('users');
$this->displayField('id');
- $this->primaryKey(['id']);
+ $this->primaryKey('id');
$this->addBehavior('Timestamp');
+ //For upload file -> avatar
+ $this->addBehavior('Josegonzalez/Upload.Upload', [
+ 'photo' => [
+ 'fields' => [
+ 'dir' => 'logo_directory',
+ ],
+ 'path' => 'webroot{DS}files{DS}{model}{DS}{field}{DS}{primaryKey}{DS}avatar',
+ ],
+ ]);
+
+
$this->belongsTo('UserTypes', [
'foreignKey' => 'user_type_id',
'joinType' => 'INNER'