HeroImageRepository
in package
Hero Image Repository.
Provides database access for heritage_hero_slide table. Manages hero background images/slides for landing page.
Table of Contents
Methods
- count() : int
- Count images.
- create() : int
- Create hero image.
- delete() : bool
- Delete hero image.
- findById() : object|null
- Get image by ID.
- getAllImages() : Collection
- Get all images (for admin).
- getEnabledImages() : Collection
- Get enabled hero images for institution.
- reorder() : void
- Reorder images.
- update() : bool
- Update hero image.
Methods
count()
Count images.
public
count([int|null $institutionId = null ][, bool $enabledOnly = true ]) : int
Parameters
- $institutionId : int|null = null
- $enabledOnly : bool = true
Return values
intcreate()
Create hero image.
public
create(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>
Return values
intdelete()
Delete hero image.
public
delete(int $id) : bool
Parameters
- $id : int
Return values
boolfindById()
Get image by ID.
public
findById(int $id) : object|null
Parameters
- $id : int
Return values
object|nullgetAllImages()
Get all images (for admin).
public
getAllImages([int|null $institutionId = null ]) : Collection
Parameters
- $institutionId : int|null = null
Return values
CollectiongetEnabledImages()
Get enabled hero images for institution.
public
getEnabledImages([int|null $institutionId = null ]) : Collection
Filters by scheduling dates if set.
Parameters
- $institutionId : int|null = null
Return values
Collectionreorder()
Reorder images.
public
reorder(array<string|int, mixed> $imageOrders) : void
Parameters
- $imageOrders : array<string|int, mixed>
update()
Update hero image.
public
update(int $id, array<string|int, mixed> $data) : bool
Parameters
- $id : int
- $data : array<string|int, mixed>