PHP Class Fenos\Notifynder\Builder\NotifynderBuilder

The builder is a main factor of Notifynder, it make sure that the notification is decorated and validated before are passed to the Sender Classes. It also helps you to create multi notifications with the same simple and easy sintax.
Inheritance: implements ArrayAcces\ArrayAccess, use trait BuilderRules
显示文件 Open project: fenos/notifynder Class Usage Examples

Public Properties

Property Type Description
$date notification to store

Protected Properties

Property Type Description
$config Illuminate\Contracts\Config\Repository
$notifications array Builder data.

Public Methods

Method Description
__construct ( Fenos\Notifynder\Contracts\NotifynderCategory $notifynderCategory )
category ( $category ) Set Category and covert it, to the id if name of it given.
expire ( $datetime ) Set expire time.
extra ( array $extra = [] ) Set extra value.
from ( ) Set who will send the notification.
loop ( $dataToIterate, Closure $builder ) Loop the data for create multi notifications array.
offsetExists ( mixed $offset ) : boolean
offsetGet ( mixed $offset ) : mixed
offsetSet ( mixed $offset, mixed $value )
offsetUnset ( mixed $offset ) : null
raw ( Closure $closure ) : array | false Build the array with the builder inside a Closure, it has more flexibility for the generation of your array.
refresh ( ) Refresh the state of the notifications.
setBuilderData ( $field, $data ) Set builder Data.
setConfig ( Illuminate\Contracts\Config\Repository $config )
setField ( $key, $value ) Set additional fields value.
to ( ) Set who will receive the notification.
toArray ( ) : mixed Compose the builder to the array.
url ( $url ) Set the url of the notification.

Protected Methods

Method Description
getDate ( ) : string
hasEntity ( array $info ) : boolean If the values passed are 2 or more, it means that you specified the entity over then the id.
isIterable ( $var ) : boolean
setDate ( ) Set date on the array.
setEntityAction ( $from, $property ) : array It set the entity who will do the action of receive or send.

Method Details

__construct() public method

public __construct ( Fenos\Notifynder\Contracts\NotifynderCategory $notifynderCategory )
$notifynderCategory Fenos\Notifynder\Contracts\NotifynderCategory

category() public method

Set Category and covert it, to the id if name of it given.
public category ( $category )
$category

expire() public method

Set expire time.
public expire ( $datetime )
$datetime

extra() public method

Set extra value.
public extra ( array $extra = [] )
$extra array

from() public method

Set who will send the notification.
public from ( )

getDate() protected method

protected getDate ( ) : string
return string

hasEntity() protected method

If the values passed are 2 or more, it means that you specified the entity over then the id.
protected hasEntity ( array $info ) : boolean
$info array
return boolean

isIterable() protected method

protected isIterable ( $var ) : boolean
$var
return boolean

loop() public method

Loop the data for create multi notifications array.
public loop ( $dataToIterate, Closure $builder )
$dataToIterate
$builder Closure

offsetExists() public method

public offsetExists ( mixed $offset ) : boolean
$offset mixed
return boolean

offsetGet() public method

public offsetGet ( mixed $offset ) : mixed
$offset mixed
return mixed

offsetSet() public method

public offsetSet ( mixed $offset, mixed $value )
$offset mixed
$value mixed

offsetUnset() public method

public offsetUnset ( mixed $offset ) : null
$offset mixed
return null

raw() public method

Build the array with the builder inside a Closure, it has more flexibility for the generation of your array.
public raw ( Closure $closure ) : array | false
$closure Closure
return array | false

refresh() public method

Refresh the state of the notifications.
public refresh ( )

setBuilderData() public method

Set builder Data.
public setBuilderData ( $field, $data )
$field
$data

setConfig() public method

public setConfig ( Illuminate\Contracts\Config\Repository $config )
$config Illuminate\Contracts\Config\Repository

setDate() protected method

Set date on the array.
protected setDate ( )

setEntityAction() protected method

It set the entity who will do the action of receive or send.
protected setEntityAction ( $from, $property ) : array
$from
$property
return array

setField() public method

Set additional fields value.
public setField ( $key, $value )
$key
$value

to() public method

Set who will receive the notification.
public to ( )

toArray() public method

Compose the builder to the array.
public toArray ( ) : mixed
return mixed

url() public method

Set the url of the notification.
public url ( $url )
$url

Property Details

$config protected_oe property

protected Repository,Illuminate\Contracts\Config $config
return Illuminate\Contracts\Config\Repository

$date public_oe property

notification to store
public $date

$notifications protected_oe property

Builder data.
protected array $notifications
return array