PHP Class Tylercd100\LERN\Components\Recorder

Inheritance: extends Component
Datei anzeigen Open project: tylercd100/lern Class Usage Examples

Protected Properties

Property Type Description
$config mixed

Public Methods

Method Description
__construct ( ) The constructor
record ( Exception $e ) : false | ExceptionModel Records an Exception to the database

Protected Methods

Method Description
collect ( string $key, Exception $e = null ) : array | integer | null | string
excludeKeys ( array $data ) : void This function will remove all keys from an array recursively as defined in the config file
getData ( ) : array | null Gets the input data of the Request
getMethod ( ) : string | null Gets the Method of the Request
getStatusCode ( Exception $e ) : string | integer Gets the status code of the Exception
getUrl ( ) : string | null Gets the URL of the Request
getUserId ( ) : integer | null Gets the ID of the User that is logged in

Private Methods

Method Description
canCollect ( string $type ) : boolean Checks the config to see if you can collect certain information

Method Details

__construct() public method

The constructor
public __construct ( )

collect() protected method

protected collect ( string $key, Exception $e = null ) : array | integer | null | string
$key string
$e Exception
return array | integer | null | string

excludeKeys() protected method

This function will remove all keys from an array recursively as defined in the config file
protected excludeKeys ( array $data ) : void
$data array The array to remove keys from
return void

getData() protected method

Gets the input data of the Request
protected getData ( ) : array | null
return array | null The Input data or null

getMethod() protected method

Gets the Method of the Request
protected getMethod ( ) : string | null
return string | null Possible values are null or GET, POST, DELETE, PUT, etc...

getStatusCode() protected method

Gets the status code of the Exception
protected getStatusCode ( Exception $e ) : string | integer
$e Exception The Exception to check
return string | integer The status code value

getUrl() protected method

Gets the URL of the Request
protected getUrl ( ) : string | null
return string | null Returns a URL string or null

getUserId() protected method

Gets the ID of the User that is logged in
protected getUserId ( ) : integer | null
return integer | null The ID of the User or Null if not logged in

record() public method

Records an Exception to the database
public record ( Exception $e ) : false | ExceptionModel
$e Exception The exception you want to record
return false | Tylercd100\LERN\Models\ExceptionModel

Property Details

$config protected_oe property

protected mixed $config
return mixed