Member
in package
Uses
Content, SQL, Validation
Table of Contents
Methods
- activate() : array<string|int, mixed>
- The function `activate` processes activation for a member based on a provided token, updating their status and sending an activation email if necessary.
- change_password() : array<string|int, mixed>
- Processes a password change request for a member, including validation, updating the password hash, generating a new token, and sending a notification email.
- forgot_password() : array<string|int, mixed>
- The function `forgot_password` checks if the provided email is registered, generates a password reset link, and sends a reset email if the email is registered.
- FSQL() : array<string|int, mixed>
- Flat SQL array result. The order of the field is important.
- FSQL1() : string
- Single value SQL result.
- FSQLC() : array<string|int, mixed>
- Flat SQL array result Column.
- FSQLR() : array<string|int, mixed>
- Flat SQL array result Row.
- register() : array<string|int, mixed>
- Processes registration data, validates it, and sends an activation email to the user.
- SQL() : mixed
- Execute SQL, if select operation return result in associative array.
- SQLBI() : void
- Bulk Insert.
- SQLBU() : void
- Bulk Update, only single pk is allowed.
- SQLR() : array<string|int, mixed>
- Execute SQL, return first row from result.
- validate() : Validation
- uniqueRule() : object
- Unique rule for RakitVal, checking if a $value is unique in $field.
Methods
activate()
The function `activate` processes activation for a member based on a provided token, updating their status and sending an activation email if necessary.
public
activate(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —The function activate returns either a success message with an activation email
sent to the member if the member's status is INACTIVE, or a message indicating that the user
is already activated if the member's status is not INACTIVE.
change_password()
Processes a password change request for a member, including validation, updating the password hash, generating a new token, and sending a notification email.
public
change_password(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —The function change_password returns a JSON result.
If the member with the provided email and token is not found, it returns a JSON result
with false and a message indicating an invalid token.
If the validation fails for the new password, it returns a JSON result with false
and the first error message encountered.
If the password change is successful, it updates the member's password.
forgot_password()
The function `forgot_password` checks if the provided email is registered, generates a password reset link, and sends a reset email if the email is registered.
public
forgot_password(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —If the member with the provided email is not found in the database, it returns a JSON result with a message indicating that the email is unregistered. If the member is found, it sends a password reset email to the member's email address and returns the result of the email sending process. If the email sending is successful, it also includes a message
FSQL()
Flat SQL array result. The order of the field is important.
public
FSQL() : array<string|int, mixed>
Return values
array<string|int, mixed>FSQL1()
Single value SQL result.
public
FSQL1() : string
Return values
string —value of the query with 1 row, 1 column (e.g. SELECT COUNT(1))
FSQLC()
Flat SQL array result Column.
public
FSQLC() : array<string|int, mixed>
Return values
array<string|int, mixed>FSQLR()
Flat SQL array result Row.
public
FSQLR() : array<string|int, mixed>
Return values
array<string|int, mixed> —result that only needed only the first record
register()
Processes registration data, validates it, and sends an activation email to the user.
public
register(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed>SQL()
Execute SQL, if select operation return result in associative array.
public
SQL() : mixed
Return values
mixed —result in associative array
SQLBI()
Bulk Insert.
public
SQLBI(string $sql, array<string|int, mixed> $values[, int $chunk_size = 100 ]) : void
Parameters
- $sql : string
- $values : array<string|int, mixed>
- $chunk_size : int = 100
-
(optional)
SQLBU()
Bulk Update, only single pk is allowed.
public
SQLBU(string $sql, string $pk, array<string|int, mixed> $values[, int $chunk_size = 100 ]) : void
Parameters
- $sql : string
- $pk : string
- $values : array<string|int, mixed>
- $chunk_size : int = 100
-
(optional)
SQLR()
Execute SQL, return first row from result.
public
SQLR() : array<string|int, mixed>
Return values
array<string|int, mixed>validate()
public
validate(array<string|int, mixed> $validation, array<string|int, mixed> $data) : Validation
Parameters
- $validation : array<string|int, mixed>
- $data : array<string|int, mixed>
Return values
ValidationuniqueRule()
Unique rule for RakitVal, checking if a $value is unique in $field.
protected
uniqueRule() : object