'ID', 'code' => 'ID', 'type' => 'Type', 'name' => 'Name', 'image' => 'Registration Image', 'gender' => 'Gender', 'birthday' => 'Birthday', 'telephone' => 'Telephone', 'address' => 'Address', 'time' => 'Registration time', 'last_modified' => 'Last Modified' ]; } public function create($data) { $r = $this->load([ 'code' => $data['code'], 'type' => $data['type'], 'name' => $data['name'], 'image' => $data['image'], 'gender' => $data['gender'], 'birthday' => $data['birthday'] === "" ? 0 : date_format(date_create_from_format('d/m/Y', $data['birthday']), 'U'), 'telephone' => $data['telephone'], 'address' => $data['address'], 'time' => time(), 'last_modified' => time() ], ''); if ($r) { try { $this->save(); return $this->id; } catch (\Exception $ex) { return false; } } } public static $typeArray = [ "wl" => "Whitelist", "bl" => "Blacklist" ]; public static $genderArray = [ "Male" => "Male", "Female" => "Female" ]; public static function nameArray() { $res = [""]; $ls = self::find()->all(); foreach ($ls as $key => $value) { $res[] = $value->name; } return $res; } }