PHP Interface Learner\Repositories\BlogRepositoryInterface

Show file Open project: RryLee/learner.video Interface Usage Examples

Public Methods

Method Description
create ( array $data ) Create new blog.
delete ( integer $id ) : boolean Delete a blog.
findAllPublishedPaginated ( $perPage = 10 ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paginate all published blogs.
findAllWithRelation ( ) : Illuminate\Database\Eloquent\Collection | Blog[] Find all blog with category.
findPublishedById ( integer $id ) : Illuminate\Database\Eloquent\Collection | Blog[] Get published blog by id.
getCreateForm ( ) : CreateBlogFormService Get save blog form.
getUpdateForm ( ) : UpdateBlogFormService Get update blog form.
togglePublished ( integer $id ) : boolean Change blog's published status.
toggleTop ( integer $id ) : boolean Change blog's toped status.
update ( $id, array $data ) Update new blog.

Method Details

create() public method

Create new blog.
public create ( array $data )
$data array

delete() public method

Delete a blog.
public delete ( integer $id ) : boolean
$id integer
return boolean

findAllPublishedPaginated() public method

Paginate all published blogs.
public findAllPublishedPaginated ( $perPage = 10 ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
return Illuminate\Contracts\Pagination\LengthAwarePaginator

findAllWithRelation() public method

Find all blog with category.
public findAllWithRelation ( ) : Illuminate\Database\Eloquent\Collection | Blog[]
return Illuminate\Database\Eloquent\Collection | Learner\Models\Blog[]

findPublishedById() public method

Get published blog by id.
public findPublishedById ( integer $id ) : Illuminate\Database\Eloquent\Collection | Blog[]
$id integer
return Illuminate\Database\Eloquent\Collection | Learner\Models\Blog[]

getCreateForm() public method

Get save blog form.
public getCreateForm ( ) : CreateBlogFormService
return Learner\Services\Forms\CreateBlogFormService

getUpdateForm() public method

Get update blog form.
public getUpdateForm ( ) : UpdateBlogFormService
return Learner\Services\Forms\UpdateBlogFormService

togglePublished() public method

Change blog's published status.
public togglePublished ( integer $id ) : boolean
$id integer
return boolean

toggleTop() public method

Change blog's toped status.
public toggleTop ( integer $id ) : boolean
$id integer
return boolean

update() public method

Update new blog.
public update ( $id, array $data )
$data array