PHP Trait Stevebauman\Inventory\Traits\CommonMethodsTrait

Show file Open project: stevebauman/inventory

Public Methods

Method Description
getAttribute ( $key )
getKey ( )
getKeyName ( )
isValidQuantity ( integer | float | string $quantity ) : boolean Returns true if the specified quantity is valid, throws InvalidQuantityException otherwise.
setAttribute ( $key, $value )

Protected Methods

Method Description
dbCommitTransaction ( ) : mixed Alias for committing a database transaction.
dbRollbackTransaction ( ) : mixed Alias for rolling back a transaction.
dbStartTransaction ( ) : mixed Alias for beginning a database transaction.
fireEvent ( string $name, array $args = [] ) : mixed Alias for firing events easily that implement this trait.
isModel ( mixed $model ) : boolean Returns true/false if the specified model is a subclass of the Eloquent Model.
isNumeric ( integer | float | string $number ) : boolean Returns true/false if the number specified is numeric.
isPositive ( integer | float | string $number ) : boolean Returns true or false if the number inserted is positive.

Method Details

dbCommitTransaction() protected method

Alias for committing a database transaction.
protected dbCommitTransaction ( ) : mixed
return mixed

dbRollbackTransaction() protected method

Alias for rolling back a transaction.
protected dbRollbackTransaction ( ) : mixed
return mixed

dbStartTransaction() protected method

Alias for beginning a database transaction.
protected dbStartTransaction ( ) : mixed
return mixed

fireEvent() protected method

Alias for firing events easily that implement this trait.
protected fireEvent ( string $name, array $args = [] ) : mixed
$name string
$args array
return mixed

getAttribute() abstract public method

abstract public getAttribute ( $key )

getKey() abstract public method

abstract public getKey ( )

getKeyName() abstract public method

abstract public getKeyName ( )

isModel() protected method

Returns true/false if the specified model is a subclass of the Eloquent Model.
protected isModel ( mixed $model ) : boolean
$model mixed
return boolean

isNumeric() protected method

Returns true/false if the number specified is numeric.
protected isNumeric ( integer | float | string $number ) : boolean
$number integer | float | string
return boolean

isPositive() protected method

Returns true or false if the number inserted is positive.
protected isPositive ( integer | float | string $number ) : boolean
$number integer | float | string
return boolean

isValidQuantity() public method

Returns true if the specified quantity is valid, throws InvalidQuantityException otherwise.
public isValidQuantity ( integer | float | string $quantity ) : boolean
$quantity integer | float | string
return boolean

setAttribute() abstract public method

abstract public setAttribute ( $key, $value )