Overview

Classes

  • Api1
  • Array1
  • ArrayObject1
  • Auth1
  • AuthModel1
  • Chat1
  • Class1
  • Color1
  • Console1
  • Controller1
  • Converter1
  • Cookie1
  • Date1
  • DateManager1
  • Db1
  • DbPref1
  • EasyBook
  • EasyCountry
  • EasyGenerator
  • EasyProduct
  • EasyProject
  • EasySchool
  • EasyStatus
  • exApiController1
  • exBlade1
  • exClass
  • exData1
  • exMail1
  • exRoute1
  • exTranslate1
  • exUrl1
  • FileManager1
  • FilePref1
  • Form1
  • Function1
  • Header1
  • Html1
  • HtmlAsset1
  • HtmlForm1
  • HtmlStyle1
  • HtmlWidget1
  • Math1
  • Model1
  • Model1FileLocator
  • Number1
  • Object1
  • Page1
  • Picture1
  • Popup1
  • QUESTION_TYPE
  • RecursiveArrayObject1
  • RegEx1
  • ResultObject1
  • ResultStatus1
  • ServerRequest1
  • Session1
  • SessionPreferenceSave1
  • String1
  • TaskManager1
  • Url1
  • Validation1
  • Value1

Interfaces

  • Controller1RouteInterface
  • Model1ActionInterface
  • Model1PageInterface

Functions

  • __
  • api_and_form_default_route
  • app
  • app_api_list
  • app_class_list
  • app_class_paths
  • app_class_with_interface
  • app_controller_list
  • app_dashboard_list
  • app_db_model_list
  • app_db_table_list
  • app_model_list
  • app_page_list
  • asset
  • csrf_token
  • current_layout_asset
  • current_plugin_asset
  • current_resources_asset_path
  • d
  • dd
  • file_base
  • file_session
  • file_session_get
  • file_session_remove
  • file_session_save
  • form_call_api
  • form_call_controller
  • form_token
  • get_all_view_in_directory
  • get_valid_view_path
  • is_token_valid
  • is_ajax_request
  • layout_asset
  • mailer
  • mailer_send_mail_to_list
  • make_default_route
  • makeRoute
  • normalizeSharedPath
  • now
  • now_date
  • now_time
  • old
  • paginate
  • path_app
  • path_asset
  • path_asset_url
  • path_clear_cache
  • path_main
  • path_main_url
  • path_shared
  • path_shared_app
  • path_shared_asset
  • path_shared_asset_url
  • path_shared_resources
  • path_to_viewpath
  • plugin_asset
  • pre
  • redirect
  • redirect_back
  • redirect_failed
  • redirect_to_view
  • register_path_for_layout_asset
  • request
  • resources_path
  • resources_path_asset
  • resources_path_cache
  • resources_path_plugin
  • resources_path_view
  • resources_path_view_cache
  • resources_path_view_layout
  • route
  • routes
  • shared_asset
  • token
  • translate_language
  • translated_language
  • url
  • view
  • view_exists
  • view_make
  • viewpath_to_path
  • Overview
  • Class

Class AuthModel1

Class Controller1 All Controller Class must Extend this, Model is also extending this which means, Model Can contain Controller function as Well... The Only Different between This and Api1 class is that, Controller get validate automatically just by putting or simply call form_token() in the form field

ServerRequest1
Extended by Api1
Extended by Controller1
Extended by Model1
Extended by AuthModel1
Abstract
Located at easycore/EasyDb.php
Methods summary
public static static|boolean|Model1|ResultStatus1
# register( null $request = null, array $uniqueColumn = ['email', 'user_name'] )

Parameters

$request
(Default is $_REQUEST)
$uniqueColumn
(Columns That Must not Exists Twice)

Returns

static|boolean|Model1|ResultStatus1
Register User and Return Account Info

Throws

Exception
public static array|ArrayObject|boolean|mysqli_result|null|ResultStatus1|string|static
# login( $user_name_or_email, $password, array $search_in_likely_column_name = ['email', 'user_name'], array $search_in_likely_column_password = ['password'] )

Parameters

$user_name_or_email
$password
$search_in_likely_column_name
$search_in_likely_column_password

Returns

array|ArrayObject|boolean|mysqli_result|null|ResultStatus1|string|static

Login, Save Login Information to Session, and Return Login Use getLoginInfo() on any AuthRequiredPage

public static
# re_login( )

Refresh and Retrieve New Login Information in Cache, Call This After Update to Profile

Refresh and Retrieve New Login Information in Cache, Call This After Update to Profile

public static User|Auth1|mixed|null
# getLogin( boolean $orRedirectToLoginPage = true, string $on_failed_redirect_to = '/login', string $redirectMessage = 'Session Expired, Please login again' )

Parameters

$orRedirectToLoginPage
$on_failed_redirect_to
$redirectMessage

use login() to Login, Save Login Information to Session, and Return Login Use getLoginInfo() on any AuthRequiredPage, If Failed, It Will Redirect to loginPage

Returns

User|Auth1|mixed|null
public static boolean
# isLoginExist( )

Is Login Available in Cache

Is Login Available in Cache

Returns

boolean
public static
# isGuest( )
public static
# isAdmin( $redirectToLoginPageIfGuest = false, $column_value = ['admin'], $column_name = 'role' )
public static Auth1|mixed|null|User
# getAllowedRoleLogin( array $column_role_list = ['admin'], string $column_role_name = 'role', string $on_failed_redirect_to = '/login', callable $onSuccessCallBack = null, callable $onErrorCallBack = null, string $errorMessage = 'You do not have permission to visit this page, Please login again', string $errorTitle = 'Access Denied' )

Put At the top of the Page and Specify The Required Role If Role Failed, The Page will be redirected to login page

Put At the top of the Page and Specify The Required Role If Role Failed, The Page will be redirected to login page

Parameters

$column_role_list
$column_role_name
$on_failed_redirect_to
$onSuccessCallBack
$onErrorCallBack
$errorMessage
$errorTitle

Returns

Auth1|mixed|null|User
public static null
# logout( string $redirectTo = '/' )

Clear Cache Data for User, This will also clear entire account reference cache

Clear Cache Data for User, This will also clear entire account reference cache

Parameters

$redirectTo

Returns

null
public null|string
# uploadAvatar( null $source_url = null, null|string $name = 'avatar.jpg' )

Upload User Avatar

Upload User Avatar

Parameters

$source_url
$file @Expecting $_FILE['avatar']['tmp_name'];
$name
@default "uploads/{$this.id}/avatar.jpg"

Returns

null|string
public null|string
# getAvatar( null|string $name = 'avatar.jpg', string $orDemoPictureUrl = '...' )

Get User Avatar

Get User Avatar

Parameters

$name
$orDemoPictureUrl

Returns

null|string

Verify If Image Exists, Then Return Image Path else, return null or Demo Image Verify If Image Exists, Then Return Image Path else, return null or Demo Image if Specified

public static boolean|null|string
# uploadMainFile( null $source_url = null, null $unique_file_name = null, integer $user_id = 1 )

Upload Any File to Id [Default is First User Account, which is usually Admin]

Upload Any File to Id [Default is First User Account, which is usually Admin]

Parameters

$source_url
$unique_file_name
$user_id

Returns

boolean|null|string
public static mixed
# getMainFileUrl( null $file_name = null, integer $user_id = 1, string $orDemoPictureUrl = '...' )

Get Any Main Uploaded File Url or Default Demo

Get Any Main Uploaded File Url or Default Demo

Parameters

$file_name
$user_id
$orDemoPictureUrl

Returns

mixed
public static
# getMainFilePath( $file_name = null, $user_id = 1, $uploadMainDirectory = 'uploads' )
public static mixed
# deleteMainFile( null $file_name = null, integer $user_id = 1 )

Delete Any Uploaded Main File

Delete Any Uploaded Main File

Parameters

$file_name
$user_id

Returns

mixed
Methods inherited from Model1
__call(), __construct(), all(), alter(), convertToMySqlDataType(), count(), delete(), deleteAssetDirectory(), deleteBy(), deleteFile(), deleteMany(), exec(), exists(), find(), findAgainst(), findIn(), findMany(), findOrFail(), findOrInit(), form(), formMake(), generateDemoData(), getAllQueryHelp(), getAssetDirectory(), getDefault(), getFilePath(), getFilePathAndUrl(), getFilePathList(), getFileUrl(), getFileUrlList(), getFixColumn(), getFromDbAs(), getMessage(), getModel(), getDbTableField(), getModelClassName(), getNextModel(), getPreviousModel(), getSafeParamOnly(), getTableName(), help(), insert(), insertMany(), insertOrUpdate(), mysqlFilterValue(), mysqli_fetch_all_assocArray(), query(), raw(), resetDefault(), save(), saveDefault(), saveToDbAs(), selectMany(), selectManyAsKeyValue(), selectManyAsList(), singleColumnList(), tableCreate(), tableCreateWithDemoList(), tableDataClone(), tableDestroy(), tableLoadBackup(), tableReset(), tableSaveBackup(), tableTruncate(), toAlterQuery(), toArray(), toDeleteQuery(), toDeleteWhereQuery(), toDropTableQuery(), toForeignLinkAdd(), toInsertQuery(), toModelColumnValueArray(), toSelectAllQuery(), toSelectWhereQuery(), toTableCreateQuery(), toUpdateQuery(), toUpdateWhereQuery(), toWhereBuilder(), toWhereValuesInColumnsQuery(), update(), updateMany(), uploadFile(), whereValuesInColumnsAsBuilder(), whereValuesInColumnsAsRaw(), withId(), xcrud()
Methods inherited from Api1
isApiAuthValid()
Methods inherited from ServerRequest1
callFunction(), callFunctionByUrl()
Properties summary
public static array $FIX_COLUMN

Default Field to be included in all Auth Model

Default Field to be included in all Auth Model

# ['id', 'created_at', 'updated_at', 'last_login_at']
Properties inherited from Model1
$EXECUTED_MESSAGE, $FLAG_SHOW_EXEC_QUERY, $PRIMARY_KEY_NAME, $SQL_TIMESTAMP_FORMAT, $SQL_VARCHAR_STRING_LENGTH, $TABLE_NAME, $__COLUMN_SQL_PROPERTY_LIST
Properties inherited from Api1
$api_id, $api_key
Properties inherited from ServerRequest1
$request
API documentation generated by ApiGen