Photo
extends Model
in package
implements
Media, ActivityFeedSourceCanEditAttachment, ActivityFeedForm, AppendPrivacyList, HasPrivacy, HasResourceStream, HasResourceCategory, HasApprove, HasFeature, HasSponsor, HasSponsorInFeed, HasTotalLike, HasTotalShare, HasTotalCommentWithReply, HasTotalView, HasLocationCheckin, HasThumbnail, HasTaggedFriendWithPosition, HasSavedItem, HasGlobalSearch, HasHashTag
Uses
HasContent, HasOwnerMorph, HasUserMorph, AppendPrivacyListTrait, HasNestedAttributes, HasFactory, HasThumbnailTrait, HasTaggedFriendTrait, SoftDeletes, HasMedia
Class Photo.
Tags
Table of Contents
Interfaces
- Media
- Interface Media.
- ActivityFeedSourceCanEditAttachment
- Interface ActivityFeedSourceCanEditAttachment
- ActivityFeedForm
- Interface ActivityFeedForm.
- AppendPrivacyList
- Interface AppendPrivacyList
- HasPrivacy
- Interface HasPrivacy.
- HasResourceStream
- Interface HasResourceStream.
- HasResourceCategory
- Interface HasResourceCategory.
- HasApprove
- Interface HasApprove
- HasFeature
- Interface HasFeature.
- HasSponsor
- Interface HasSponsor.
- HasSponsorInFeed
- Interface HasSponsor.
- HasTotalLike
- Interface HasTotalLike.
- HasTotalShare
- Interface HasTotalLike.
- HasTotalCommentWithReply
- Interface HasTotalComment.
- HasTotalView
- Interface HasTotalView.
- HasLocationCheckin
- Interface HasLocationCheckin.
- HasThumbnail
- Interface HasThumbnail.
- HasTaggedFriendWithPosition
- Interface HasTaggedFriendWithPosition.
- HasSavedItem
- Interface HasSavedItem.
- HasGlobalSearch
- Interface HasGlobalSearch.
- HasHashTag
- Interface Entity.
Constants
- ENTITY_TYPE = 'photo'
- IS_PENDING = 0
- TYPE_AVATAR = 'avatar'
- TYPE_COVER = 'cover'
- TYPE_NORMAL = 'normal'
Properties
- $activeCategories : Collection
- $activity_feed : Feed
- $album : Album
- $album_id : int
- $album_type : int
- $allow_rate : int
- $categories : Collection
- $content : string
- $created_at : string
- $file_id : mixed
- $fileItem : StorageFile
- $group : PhotoGroup|null
- $group_id : int
- $id : int
- $image_file_id : string
- $is_approved : int
- $is_cover : bool
- $is_cover_photo : bool
- $is_featured : int
- $is_profile_photo : bool
- $is_sponsor : int
- $is_temp : int
- $item_type : string
- $location_latitude : int
- $location_longitude : int
- $location_name : string
- $mature : int
- $module_id : string
- $nestedAttributes : array<int|string, array<int, string>|string>
- $ordering : int
- $owner : User
- $owner_id : int
- $owner_type : string
- $photo_type : string
- $photoInfo : PhotoInfo|null
- $privacy : string
- $privacy_list : array<string|int, int>
- $sponsor_in_feed : bool
- $title : string
- $total_comment : int
- $total_dislike : int
- $total_download : int
- $total_like : int
- $total_rating : float
- $total_share : int
- $total_tag : int
- $total_view : int
- $total_vote : int
- $type_id : int
- $updated_at : string
- $user : User
- $user_id : int
- $user_type : string
- $appends : array<string|int, string>
- $casts : array<string, string>
- $fillable : array<string|int, string>
- $isReview : int
- $nestedAttributesFor : array<string|int, mixed>
- Defined nested attributes.
Methods
- __toString() : mixed
- activeCategories() : BelongsToMany
- album() : BelongsTo
- albumItem() : MorphOne
- categories() : BelongsToMany
- deletePrivacyStreams() : void
- Delete {item}_privacy_streams.
- disableFeedSponsor() : void
- disableSponsor() : void
- enableFeedSponsor() : void
- enableSponsor() : void
- factory() : PhotoFactory
- fileItem() : HasOne
- fill() : static
- Fill the model with an array of attributes.
- getDownloadUrlAttribute() : string
- getFeedContent() : string|null
- getImageAttribute() : string|null
- getImagesAttribute() : array<string|int, mixed>|null
- getImageUrlAttribute() : string
- getIsCoverAttribute() : bool
- getIsCoverPhotoAttribute() : bool
- getIsFailedAttribute() : bool
- getIsProcessingAttribute() : bool
- getIsProfilePhotoAttribute() : bool
- getIsSuccessAttribute() : bool
- getNestedAttributesFor() : array<string|int, mixed>
- Get accept nested attributes.
- getOwnerAttribute() : mixed
- getOwnerEntityAttribute() : mixed
- getOwnerPendingMessage() : string|null
- This method is used for getting pending message if item is pending.
- getPhotoTypeAttribute() : string
- getPrivacyListAttribute() : array<string|int, mixed>|null
- getSharedFeedTypeIdAttribute() : string|null
- getSizes() : array<string|int, mixed>
- getThumbnail() : string|null
- getUnsupportChangeFeedPrivacyAttribute() : bool
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- group() : BelongsTo
- groupItem() : MorphOne
- hasTagStream() : bool
- isApproved() : mixed
- isDraft() : mixed
- isOwner() : bool
- check if $user is the owner of entity.
- isOwnerPending() : bool
- isPublished() : mixed
- isReview() : int
- isSponsored() : bool
- isSponsoredInFeed() : bool
- isUser() : bool
- check if $user is the user (creator) of entity.
- likes() : MorphMany
- loadPrivacyListAttribute() : mixed
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- photoInfo() : HasOne
- privacyItem() : mixed
- privacyStreams() : HasMany
- reactItem() : mixed
- save() : bool
- Save the model to the database.
- setIsReview() : mixed
- setPrivacyListAttribute() : mixed
- shares() : MorphMany
- syncHasManyRelationAttribute() : bool
- Save the hasMany nested relation attributes to the database.
- syncHasOneRelationAttribute() : bool
- syncPrivacyStreams() : void
- Create {item}_privacy_streams.
- tagData() : BelongsToMany
- toActivityFeed() : FeedAction|null
- toApprovedNotification() : array<int, mixed>
- toCallbackMessage() : string
- toFeedOGImages() : array<int, mixed>
- toFollowerCallbackMessage() : string|null
- toFollowerNotification() : array<string|int, mixed>|null
- toLink() : string|null
- toLocation() : array<int, mixed>
- [address, lat, lng].
- toMail() : MailMessage
- toOGDescription() : string|null
- toRouter() : string|null
- toSavedItem() : array<string, mixed>
- [title, image, item_type_name, total_photo, user(UserEntity), link].
- toSearchable() : array<string, mixed>|null
- toSitemapUrl() : string|null
- toSponsorData() : array<string|int, mixed>|null
- toTagFriendLink() : string|null
- toTagFriendRouter() : string|null
- toTagFriendUrl() : string|null
- toTitle() : string
- toUrl() : string|null
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
- allowDestroyNestedAttributes() : bool
- Check can we delete nested data.
- booted() : mixed
- getInProcessValue() : int
- newFactory() : PhotoFactory
- handleMessageForGender() : string
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'photo'
IS_PENDING
public
mixed
IS_PENDING
= 0
TYPE_AVATAR
public
mixed
TYPE_AVATAR
= 'avatar'
TYPE_COVER
public
mixed
TYPE_COVER
= 'cover'
TYPE_NORMAL
public
mixed
TYPE_NORMAL
= 'normal'
Properties
$activeCategories
public
Collection
$activeCategories
$activity_feed
public
Feed
$activity_feed
$album
public
Album
$album
$album_id
public
int
$album_id
$album_type
public
int
$album_type
$allow_rate
public
int
$allow_rate
$categories
public
Collection
$categories
$content
public
string
$content
$created_at
public
string
$created_at
$file_id
public
mixed
$file_id
$fileItem
public
StorageFile
$fileItem
$group
public
PhotoGroup|null
$group
$group_id
public
int
$group_id
$id
public
int
$id
$image_file_id
public
string
$image_file_id
$is_approved
public
int
$is_approved
$is_cover
public
bool
$is_cover
$is_cover_photo
public
bool
$is_cover_photo
$is_featured
public
int
$is_featured
$is_profile_photo
public
bool
$is_profile_photo
$is_sponsor
public
int
$is_sponsor
$is_temp
public
int
$is_temp
$item_type
public
string
$item_type
$location_latitude
public
int
$location_latitude
$location_longitude
public
int
$location_longitude
$location_name
public
string
$location_name
$mature
public
int
$mature
$module_id
public
string
$module_id
$nestedAttributes
public
array<int|string, array<int, string>|string>
$nestedAttributes
= ['categories', 'photoInfo' => ['text', 'text_parsed']]
$ordering
public
int
$ordering
$owner
public
User
$owner
$owner_id
public
int
$owner_id
$owner_type
public
string
$owner_type
$photo_type
public
string
$photo_type
$photoInfo
public
PhotoInfo|null
$photoInfo
$privacy
public
string
$privacy
$privacy_list
public
array<string|int, int>
$privacy_list
$sponsor_in_feed
public
bool
$sponsor_in_feed
$title
public
string
$title
$total_comment
public
int
$total_comment
$total_dislike
public
int
$total_dislike
$total_download
public
int
$total_download
$total_like
public
int
$total_like
$total_rating
public
float
$total_rating
$total_share
public
int
$total_share
$total_tag
public
int
$total_tag
$total_view
public
int
$total_view
$total_vote
public
int
$total_vote
$type_id
public
int
$type_id
$updated_at
public
string
$updated_at
$user
public
User
$user
$user_id
public
int
$user_id
$user_type
public
string
$user_type
$appends
protected
array<string|int, string>
$appends
= ['is_cover', 'is_cover_photo', 'is_profile_photo']
$casts
protected
array<string, string>
$casts
= ['is_featured' => 'boolean', 'is_sponsor' => 'boolean', 'is_approved' => 'boolean', 'is_temp' => 'boolean', 'sponsor_in_feed' => 'boolean']
$fillable
protected
array<string|int, string>
$fillable
= ['album_id', 'album_type', 'group_id', 'type_id', 'title', 'item_type', 'user_id', 'user_type', 'owner_id', 'owner_type', 'privacy', 'total_view', 'total_like', 'total_dislike', 'total_share', 'total_tag', 'total_download', 'image_file_id', 'total_vote', 'total_rating', 'mature', 'allow_rate', 'is_featured', 'is_sponsor', 'is_approved', 'location_name', 'location_latitude', 'location_longitude', 'content', 'is_temp', 'ordering', 'sponsor_in_feed', 'updated_at', 'created_at', 'in_process', 'total_tag_friend', 'total_pending_reply', 'total_comment', 'total_reply', 'total_pending_comment']
$isReview
protected
int
$isReview
$nestedAttributesFor
Defined nested attributes.
protected
array<string|int, mixed>
$nestedAttributesFor
= []
Methods
__toString()
public
__toString() : mixed
activeCategories()
public
activeCategories() : BelongsToMany
Return values
BelongsToManyalbum()
public
album() : BelongsTo
Return values
BelongsToalbumItem()
public
albumItem() : MorphOne
Return values
MorphOnecategories()
public
categories() : BelongsToMany
Return values
BelongsToManydeletePrivacyStreams()
Delete {item}_privacy_streams.
public
deletePrivacyStreams() : void
disableFeedSponsor()
public
disableFeedSponsor() : void
disableSponsor()
public
disableSponsor() : void
enableFeedSponsor()
public
enableFeedSponsor() : void
enableSponsor()
public
enableSponsor() : void
factory()
public
static factory(mixed $parameters) : PhotoFactory
Parameters
- $parameters : mixed
Return values
PhotoFactoryfileItem()
public
fileItem() : HasOne
Return values
HasOnefill()
Fill the model with an array of attributes.
public
fill(array<string|int, mixed> $attributes) : static
Parameters
- $attributes : array<string|int, mixed>
Tags
Return values
staticgetDownloadUrlAttribute()
public
getDownloadUrlAttribute() : string
Return values
stringgetFeedContent()
public
getFeedContent() : string|null
Return values
string|nullgetImageAttribute()
public
getImageAttribute() : string|null
Return values
string|nullgetImagesAttribute()
public
getImagesAttribute() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetImageUrlAttribute()
public
getImageUrlAttribute() : string
Return values
stringgetIsCoverAttribute()
public
getIsCoverAttribute() : bool
Return values
boolgetIsCoverPhotoAttribute()
public
getIsCoverPhotoAttribute() : bool
Return values
boolgetIsFailedAttribute()
public
getIsFailedAttribute() : bool
Return values
boolgetIsProcessingAttribute()
public
getIsProcessingAttribute() : bool
Return values
boolgetIsProfilePhotoAttribute()
public
getIsProfilePhotoAttribute() : bool
Return values
boolgetIsSuccessAttribute()
public
getIsSuccessAttribute() : bool
Return values
boolgetNestedAttributesFor()
Get accept nested attributes.
public
getNestedAttributesFor() : array<string|int, mixed>
Return values
array<string|int, mixed>getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : mixed
getOwnerPendingMessage()
This method is used for getting pending message if item is pending.
public
getOwnerPendingMessage() : string|null
Return values
string|nullgetPhotoTypeAttribute()
public
getPhotoTypeAttribute() : string
Return values
stringgetPrivacyListAttribute()
public
getPrivacyListAttribute() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetSharedFeedTypeIdAttribute()
public
getSharedFeedTypeIdAttribute() : string|null
Return values
string|nullgetSizes()
public
getSizes() : array<string|int, mixed>
Return values
array<string|int, mixed>getThumbnail()
public
getThumbnail() : string|null
Return values
string|nullgetUnsupportChangeFeedPrivacyAttribute()
public
getUnsupportChangeFeedPrivacyAttribute() : bool
Return values
boolgetUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
group()
public
group() : BelongsTo
Return values
BelongsTogroupItem()
public
groupItem() : MorphOne
Return values
MorphOnehasTagStream()
public
hasTagStream() : bool
Return values
boolisApproved()
public
isApproved() : mixed
isDraft()
public
isDraft() : mixed
isOwner()
check if $user is the owner of entity.
public
isOwner(User $user) : bool
Parameters
- $user : User
Return values
boolisOwnerPending()
public
isOwnerPending() : bool
Return values
boolisPublished()
public
isPublished() : mixed
isReview()
public
isReview() : int
Return values
intisSponsored()
public
isSponsored() : bool
Return values
boolisSponsoredInFeed()
public
isSponsoredInFeed() : bool
Return values
boolisUser()
check if $user is the user (creator) of entity.
public
isUser(User $user) : bool
Parameters
- $user : User
Return values
boollikes()
public
likes() : MorphMany
Return values
MorphManyloadPrivacyListAttribute()
public
loadPrivacyListAttribute() : mixed
owner()
public
owner() : MorphTo
Return values
MorphToownerEntity()
public
ownerEntity() : BelongsTo
Return values
BelongsToownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : string
Return values
stringphotoInfo()
public
photoInfo() : HasOne
Return values
HasOneprivacyItem()
public
privacyItem() : mixed
privacyStreams()
public
privacyStreams() : HasMany
Return values
HasManyreactItem()
public
reactItem() : mixed
save()
Save the model to the database.
public
save([array<string|int, mixed> $options = [] ]) : bool
Parameters
- $options : array<string|int, mixed> = []
Tags
Return values
boolsetIsReview()
public
setIsReview(int $isReview) : mixed
Parameters
- $isReview : int
setPrivacyListAttribute()
public
setPrivacyListAttribute([array<string|int, mixed> $privacyList = [] ]) : mixed
Parameters
- $privacyList : array<string|int, mixed> = []
shares()
public
shares() : MorphMany
Return values
MorphManysyncHasManyRelationAttribute()
Save the hasMany nested relation attributes to the database.
public
syncHasManyRelationAttribute(HasMany $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasMany
- $params : array<string|int, mixed>
Return values
boolsyncHasOneRelationAttribute()
public
syncHasOneRelationAttribute(HasOne $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasOne
- $params : array<string|int, mixed>
Return values
boolsyncPrivacyStreams()
Create {item}_privacy_streams.
public
syncPrivacyStreams(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
tagData()
public
tagData() : BelongsToMany
Return values
BelongsToManytoActivityFeed()
public
toActivityFeed() : FeedAction|null
Tags
Return values
FeedAction|nulltoApprovedNotification()
public
toApprovedNotification() : array<int, mixed>
Return values
array<int, mixed>toCallbackMessage()
public
toCallbackMessage(UserEntity $user, UserEntity $owner[, bool $isMention = false ]) : string
Parameters
- $user : UserEntity
- $owner : UserEntity
- $isMention : bool = false
Return values
stringtoFeedOGImages()
public
toFeedOGImages() : array<int, mixed>
Return values
array<int, mixed>toFollowerCallbackMessage()
public
toFollowerCallbackMessage() : string|null
Return values
string|nulltoFollowerNotification()
public
toFollowerNotification() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulltoLink()
public
toLink() : string|null
Return values
string|nulltoLocation()
[address, lat, lng].
public
toLocation() : array<int, mixed>
Return values
array<int, mixed>toMail()
public
toMail(MailMessage $service, UserEntity|null $user, UserEntity|null $owner[, bool $isMention = false ]) : MailMessage
Parameters
- $service : MailMessage
- $user : UserEntity|null
- $owner : UserEntity|null
- $isMention : bool = false
Return values
MailMessagetoOGDescription()
public
toOGDescription([User|null $context = null ]) : string|null
Parameters
- $context : User|null = null
Return values
string|nulltoRouter()
public
toRouter() : string|null
Return values
string|nulltoSavedItem()
[title, image, item_type_name, total_photo, user(UserEntity), link].
public
toSavedItem() : array<string, mixed>
Return values
array<string, mixed>toSearchable()
public
toSearchable() : array<string, mixed>|null
Return values
array<string, mixed>|nulltoSitemapUrl()
public
toSitemapUrl() : string|null
Return values
string|nulltoSponsorData()
public
toSponsorData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulltoTagFriendLink()
public
toTagFriendLink() : string|null
Return values
string|nulltoTagFriendRouter()
public
toTagFriendRouter() : string|null
Return values
string|nulltoTagFriendUrl()
public
toTagFriendUrl() : string|null
Return values
string|nulltoTitle()
public
toTitle() : string
Return values
stringtoUrl()
public
toUrl() : string|null
Return values
string|nulluser()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserId()
public
userId() : int
Return values
intuserType()
public
userType() : string
Return values
stringallowDestroyNestedAttributes()
Check can we delete nested data.
protected
allowDestroyNestedAttributes(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
Return values
boolbooted()
protected
static booted() : mixed
getInProcessValue()
protected
getInProcessValue([bool $default = true ]) : int
Parameters
- $default : bool = true
Return values
intnewFactory()
protected
static newFactory() : PhotoFactory
Return values
PhotoFactoryhandleMessageForGender()
private
handleMessageForGender(int $gender, string $yourName) : string
Parameters
- $gender : int
- $yourName : string