PHP Class Learner\Repositories\Eloquent\VideoRepository

Inheritance: extends AbstractRepository, implements Learner\Repositories\VideoRepositoryInterface
Show file Open project: RryLee/learner.video

Protected Properties

Property Type Description
$relations array The user relate models.

Public Methods

Method Description
__construct ( Video $video ) Create a new Video instance.
create ( array $data ) : array Create a video.
delete ( integer $id ) : boolean | null Delete video.
findAll ( ) : array Return id as key and title as value.
findAllPublishedPaginated ( integer $perPage = 50 ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paniaget the all videos.
getSaveForm ( ) : Learner\Services\Forms\CreateVideoFormService Create video save-form service.
hasChanged ( integer $id, string $resource_type, string $resource_id ) : boolean Check the video resource changed.
update ( integer $id, array $data ) : array Update video.

Method Details

__construct() public method

Create a new Video instance.
public __construct ( Video $video )
$video Learner\Models\Video

create() public method

Create a video.
public create ( array $data ) : array
$data array
return array

delete() public method

Delete video.
public delete ( integer $id ) : boolean | null
$id integer
return boolean | null

findAll() public method

Return id as key and title as value.
public findAll ( ) : array
return array

findAllPublishedPaginated() public method

Paniaget the all videos.
public findAllPublishedPaginated ( integer $perPage = 50 ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer
return Illuminate\Contracts\Pagination\LengthAwarePaginator

getSaveForm() public method

Create video save-form service.
public getSaveForm ( ) : Learner\Services\Forms\CreateVideoFormService
return Learner\Services\Forms\CreateVideoFormService

hasChanged() public method

Check the video resource changed.
public hasChanged ( integer $id, string $resource_type, string $resource_id ) : boolean
$id integer
$resource_type string
$resource_id string
return boolean

update() public method

Update video.
public update ( integer $id, array $data ) : array
$id integer
$data array
return array

Property Details

$relations protected static property

The user relate models.
protected static array $relations
return array