PHP Class Silber\Bouncer\Database\Models

Afficher le fichier Open project: JosephSilber/bouncer Class Usage Examples

Protected Properties

Свойство Type Description
$models array Map for the bouncer's models.
$ownership array Holds the map of ownership for models.
$prefix string The prefix for the tables.
$tables array Map for the bouncer's tables.

Méthodes publiques

Méthode Description
ability ( array $attributes = [] ) : Ability Get an instance of the ability model.
classname ( string $model ) : string Get the classname mapping for the given model.
isOwnedBy ( Model $authority, Model $model ) : boolean Determines whether the given model is owned by the given authority.
ownedVia ( string | Closure $model, string | Closure | null $attribute = null ) : void Register an attribute/callback to determine if a model is owned by a given authority.
prefix ( ) : string Get the prefix for the tables.
reset ( ) : void Reset all settings to their original state.
role ( array $attributes = [] ) : Role Get an instance of the role model.
setAbilitiesModel ( string $model ) : void Set the model to be used for abilities.
setPrefix ( string $prefix ) : void Set the prefix for the tables.
setRolesModel ( string $model ) : void Set the model to be used for roles.
setTables ( array $map ) : void Set custom table names.
setUsersModel ( string $model ) : void Set the model to be used for users.
table ( string $table ) : string Get a custom table name mapping for the given table.
user ( array $attributes = [] ) : Model Get an instance of the user model.

Méthodes protégées

Méthode Description
basename ( string | object $class ) : string Get the basename of the given class.
isOwnedVia ( string | Closure $attribute, Model $authority, Model $model ) : boolean Determines ownership via the given attribute.
make ( string $model, array $attributes = [] ) : Model Get an instance of the given model.

Method Details

ability() public static méthode

Get an instance of the ability model.
public static ability ( array $attributes = [] ) : Ability
$attributes array
Résultat Ability

basename() protected static méthode

Get the basename of the given class.
protected static basename ( string | object $class ) : string
$class string | object
Résultat string

classname() public static méthode

Get the classname mapping for the given model.
public static classname ( string $model ) : string
$model string
Résultat string

isOwnedBy() public static méthode

Determines whether the given model is owned by the given authority.
public static isOwnedBy ( Model $authority, Model $model ) : boolean
$authority Illuminate\Database\Eloquent\Model
$model Illuminate\Database\Eloquent\Model
Résultat boolean

isOwnedVia() protected static méthode

Determines ownership via the given attribute.
protected static isOwnedVia ( string | Closure $attribute, Model $authority, Model $model ) : boolean
$attribute string | Closure
$authority Illuminate\Database\Eloquent\Model
$model Illuminate\Database\Eloquent\Model
Résultat boolean

make() protected static méthode

Get an instance of the given model.
protected static make ( string $model, array $attributes = [] ) : Model
$model string
$attributes array
Résultat Illuminate\Database\Eloquent\Model

ownedVia() public static méthode

Register an attribute/callback to determine if a model is owned by a given authority.
public static ownedVia ( string | Closure $model, string | Closure | null $attribute = null ) : void
$model string | Closure
$attribute string | Closure | null
Résultat void

prefix() public static méthode

Get the prefix for the tables.
public static prefix ( ) : string
Résultat string

reset() public static méthode

Reset all settings to their original state.
public static reset ( ) : void
Résultat void

role() public static méthode

Get an instance of the role model.
public static role ( array $attributes = [] ) : Role
$attributes array
Résultat Role

setAbilitiesModel() public static méthode

Set the model to be used for abilities.
public static setAbilitiesModel ( string $model ) : void
$model string
Résultat void

setPrefix() public static méthode

Set the prefix for the tables.
public static setPrefix ( string $prefix ) : void
$prefix string
Résultat void

setRolesModel() public static méthode

Set the model to be used for roles.
public static setRolesModel ( string $model ) : void
$model string
Résultat void

setTables() public static méthode

Set custom table names.
public static setTables ( array $map ) : void
$map array
Résultat void

setUsersModel() public static méthode

Set the model to be used for users.
public static setUsersModel ( string $model ) : void
$model string
Résultat void

table() public static méthode

Get a custom table name mapping for the given table.
public static table ( string $table ) : string
$table string
Résultat string

user() public static méthode

Get an instance of the user model.
public static user ( array $attributes = [] ) : Model
$attributes array
Résultat Illuminate\Database\Eloquent\Model

Property Details

$models protected_oe static_oe property

Map for the bouncer's models.
protected static array $models
Résultat array

$ownership protected_oe static_oe property

Holds the map of ownership for models.
protected static array $ownership
Résultat array

$prefix protected_oe static_oe property

The prefix for the tables.
protected static string $prefix
Résultat string

$tables protected_oe static_oe property

Map for the bouncer's tables.
protected static array $tables
Résultat array