Album
in package
implements
ResourceInterface
uses
IdentifiableTrait, TimestampableTrait
Album.
Tags
Attributes
- #[Entity]
- #[HasLifecycleCallbacks]
Table of Contents
Interfaces
- ResourceInterface
Properties
- $children : Collection<string|int, Album>
- all the subalbums Note: These are fetched extra lazy so we can efficiently retrieve an album count.
- $coverPath : string|null
- The cover photo to display with the album.
- $createdAt : DateTime
- The date at which the entity was created.
- $endDateTime : DateTime|null
- End date of photos in album.
- $id : int|null
- The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
- $name : string
- Name of the album.
- $parent : Album|null
- Parent album, null if there is no parent album.
- $photos : Collection<string|int, Photo>
- all the photo's in this album.
- $published : bool
- Whether the album is published.
- $startDateTime : DateTime|null
- First date of photos in album.
- $updatedAt : DateTime
- The date at which the entity was updated.
Methods
- __construct() : mixed
- addAlbum() : void
- Add a sub album to an album.
- addPhoto() : void
- Add a photo to an album.
- getAlbumCount() : int
- Get the amount of subalbums in the album.
- getChildren() : Collection<string|int, Album>
- Gets an array of all child albums.
- getCoverPath() : string|null
- Get the album cover.
- getCreatedAt() : DateTime
- getEndDateTime() : DateTime|null
- Get the end date.
- getId() : int|null
- Get the identifier of the object.
- getName() : string
- Get the album name.
- getParent() : Album|null
- Get the parent album.
- getPhotoCount() : int
- Get the amount of photos in the album.
- getPhotos() : Collection<string|int, Photo>
- Gets an array of all the photos in this album.
- getPublished() : bool
- Get the published state.
- getResourceId() : string
- Get the resource ID.
- getStartDateTime() : DateTime|null
- Get the start date.
- getUpdatedAt() : DateTime
- isPublished() : bool
- Whether this album is published.
- prePersist() : void
- Automatically fill in the `DateTime`s before the initial call to `persist()`.
- preUpdate() : void
- Automatically update the `updatedAt` `DateTime` when doing an update to the entity.
- removeAlbum() : void
- Remove a subalbum.
- setCoverPath() : void
- Set the cover photo for the album.
- setEndDateTime() : void
- Set the end date.
- setId() : void
- Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
- setName() : void
- Set the name of the album.
- setParent() : void
- Set the parent of the album.
- setPublished() : void
- Set the published state.
- setStartDateTime() : void
- Set the start date.
- toArray() : AlbumArrayType
- Returns an associative array representation of this object.
- toArrayWithChildren() : ImportedPhotoArrayType[], coverPath: ?string, photoCount: int, albumCount: int}
- Returns an associative array representation of this object including all child objects.
- setCreatedAt() : void
- setUpdatedAt() : void
Properties
$children
all the subalbums Note: These are fetched extra lazy so we can efficiently retrieve an album count.
protected
Collection<string|int, Album>
$children
Attributes
- #[OneToMany]
- $targetEntity: self::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $fetch: 'EXTRA_LAZY'
$coverPath
The cover photo to display with the album.
protected
string|null
$coverPath
= null
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$createdAt
The date at which the entity was created.
protected
DateTime
$createdAt
Attributes
- #[Column]
- $type: 'datetime'
$endDateTime
End date of photos in album.
protected
DateTime|null
$endDateTime
= null
Attributes
- #[Column]
- $type: 'datetime'
- $nullable: true
$id
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
protected
int|null
$id
= null
Attributes
- #[Column]
- $type: 'integer'
- #[GeneratedValue]
- $strategy: 'IDENTITY'
- #[Id]
$name
Name of the album.
protected
string
$name
Attributes
- #[Column]
- $type: 'string'
$parent
Parent album, null if there is no parent album.
protected
Album|null
$parent
= null
Attributes
- #[JoinColumn]
- $name: 'parent_id'
- $referencedColumnName: 'id'
- #[ManyToOne]
- $targetEntity: self::class
- $inversedBy: 'children'
$photos
all the photo's in this album.
protected
Collection<string|int, Photo>
$photos
Note: These are fetched extra lazy so we can efficiently retrieve an photo count.
Attributes
- #[OneToMany]
- $targetEntity: \Photo\Model\Photo::class
- $mappedBy: 'album'
- $cascade: ['persist', 'remove']
- $fetch: 'EXTRA_LAZY'
- #[OrderBy]
- $value: ['dateTime' => 'ASC']
$published
Whether the album is published.
protected
bool
$published
= false
Attributes
- #[Column]
- $type: 'boolean'
$startDateTime
First date of photos in album.
protected
DateTime|null
$startDateTime
= null
Attributes
- #[Column]
- $type: 'datetime'
- $nullable: true
$updatedAt
The date at which the entity was updated.
protected
DateTime
$updatedAt
Attributes
- #[Column]
- $type: 'datetime'
Methods
__construct()
public
__construct() : mixed
addAlbum()
Add a sub album to an album.
public
addAlbum(Album $album) : void
Parameters
- $album : Album
addPhoto()
Add a photo to an album.
public
addPhoto(Photo $photo) : void
Parameters
- $photo : Photo
getAlbumCount()
Get the amount of subalbums in the album.
public
getAlbumCount() : int
Return values
intgetChildren()
Gets an array of all child albums.
public
getChildren() : Collection<string|int, Album>
Return values
Collection<string|int, Album>getCoverPath()
Get the album cover.
public
getCoverPath() : string|null
Return values
string|nullgetCreatedAt()
public
getCreatedAt() : DateTime
Return values
DateTimegetEndDateTime()
Get the end date.
public
getEndDateTime() : DateTime|null
Return values
DateTime|nullgetId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetName()
Get the album name.
public
getName() : string
Return values
string —$name
getParent()
Get the parent album.
public
getParent() : Album|null
Return values
Album|null —$parent
getPhotoCount()
Get the amount of photos in the album.
public
getPhotoCount([bool $includeSubAlbums = true ]) : int
Parameters
- $includeSubAlbums : bool = true
Return values
intgetPhotos()
Gets an array of all the photos in this album.
public
getPhotos() : Collection<string|int, Photo>
Return values
Collection<string|int, Photo>getPublished()
Get the published state.
public
getPublished() : bool
Return values
boolgetResourceId()
Get the resource ID.
public
getResourceId() : string
Return values
stringgetStartDateTime()
Get the start date.
public
getStartDateTime() : DateTime|null
Return values
DateTime|nullgetUpdatedAt()
public
getUpdatedAt() : DateTime
Return values
DateTimeisPublished()
Whether this album is published.
public
isPublished() : bool
Return values
boolprePersist()
Automatically fill in the `DateTime`s before the initial call to `persist()`.
public
prePersist() : void
Attributes
- #[PrePersist]
preUpdate()
Automatically update the `updatedAt` `DateTime` when doing an update to the entity.
public
preUpdate() : void
Attributes
- #[PreUpdate]
removeAlbum()
Remove a subalbum.
public
removeAlbum(Album|null $album) : void
Parameters
- $album : Album|null
setCoverPath()
Set the cover photo for the album.
public
setCoverPath(string|null $photo) : void
Parameters
- $photo : string|null
setEndDateTime()
Set the end date.
public
setEndDateTime(DateTime|null $endDateTime) : void
Parameters
- $endDateTime : DateTime|null
setId()
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
public
setId(int|null $id) : void
Parameters
- $id : int|null
setName()
Set the name of the album.
public
setName(string $name) : void
Parameters
- $name : string
setParent()
Set the parent of the album.
public
setParent(Album|null $parent) : void
Parameters
- $parent : Album|null
setPublished()
Set the published state.
public
setPublished(bool $published) : void
Parameters
- $published : bool
setStartDateTime()
Set the start date.
public
setStartDateTime(DateTime|null $startDateTime) : void
Parameters
- $startDateTime : DateTime|null
toArray()
Returns an associative array representation of this object.
public
toArray() : AlbumArrayType
Return values
AlbumArrayTypetoArrayWithChildren()
Returns an associative array representation of this object including all child objects.
public
toArrayWithChildren() : ImportedPhotoArrayType[], coverPath: ?string, photoCount: int, albumCount: int}
Return values
ImportedPhotoArrayType[], coverPath: ?string, photoCount: int, albumCount: int}setCreatedAt()
private
setCreatedAt(DateTime $createdAt) : void
Parameters
- $createdAt : DateTime
setUpdatedAt()
private
setUpdatedAt(DateTime $updatedAt) : void
Parameters
- $updatedAt : DateTime