PHP Class Fenos\Notifynder\Categories\CategoryRepository

Repository responsible to approach database queries of the categories
Inheritance: implements Fenos\Notifynder\Contracts\CategoryDB
Mostrar archivo Open project: fenos/notifynder Class Usage Examples

Protected Properties

Property Type Description
$categoryModel Fenos\Notifynder\Models\NotificationCategory | Illuminate\Database\Eloquent\Builder | Builder

Public Methods

Method Description
__construct ( NotificationCategory $categoryModel )
add ( array $name, $text ) : static Add a category to the DB.
delete ( $categoryId ) : mixed Delete category by ID.
deleteByName ( $name ) : mixed Delete category by name.
find ( $categoryId ) : mixed Find By Id.
findByName ( $name ) : mixed Find by name.
findByNames ( array $name ) : mixed Find by names returning lists of ids.
update ( array $data, $categoryId ) : mixed Update a category by id.

Method Details

__construct() public method

public __construct ( NotificationCategory $categoryModel )
$categoryModel Fenos\Notifynder\Models\NotificationCategory

add() public method

Add a category to the DB.
public add ( array $name, $text ) : static
$name array
$text
return static

delete() public method

Delete category by ID.
public delete ( $categoryId ) : mixed
$categoryId
return mixed

deleteByName() public method

Delete category by name.
public deleteByName ( $name ) : mixed
$name
return mixed

find() public method

Find By Id.
public find ( $categoryId ) : mixed
$categoryId
return mixed

findByName() public method

Find by name.
public findByName ( $name ) : mixed
$name
return mixed

findByNames() public method

Find by names returning lists of ids.
public findByNames ( array $name ) : mixed
$name array
return mixed

update() public method

Update a category by id.
public update ( array $data, $categoryId ) : mixed
$data array
$categoryId
return mixed

Property Details

$categoryModel protected_oe property

| Builder
protected NotificationCategory,Fenos\Notifynder\Models|Builder,Illuminate\Database\Eloquent $categoryModel
return Fenos\Notifynder\Models\NotificationCategory | Illuminate\Database\Eloquent\Builder