Class Socialveo\Core\models\Post

InheritanceSocialveo\Core\models\Post » Socialveo\Core\models\SocialveoModel » Phalcon\Mvc\Model
Uses TraitsSocialveo\Core\Translatable, Socialveo\Core\models\traits\JsonProperties

Class Post

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__get() Magic method to get related records using the relation alias as a property or getters defined by setGetter() Socialveo\Core\models\SocialveoModel
__isset() Magic method to check if a property is a valid relation Socialveo\Core\models\SocialveoModel
__set() Magic method to set related records using the relation alias as a property or setters defined by setSetter() Socialveo\Core\models\SocialveoModel
_t() Gets translations Socialveo\Core\Translatable
afterCreate() After create hook Socialveo\Core\models\Post
afterFetch() After fetch hook Socialveo\Core\models\Post
beforeDelete() Before delete hook Socialveo\Core\models\Post
behaviors() Get behaviors Socialveo\Core\models\SocialveoModel
behaviorsNotify() Behavior notify Socialveo\Core\models\SocialveoModel
cachedFind() Returns query results from cache (if set and not expired) or database Socialveo\Core\models\SocialveoModel
change() Changes object attributes based on passed-in payload data, saves object and returns it Socialveo\Core\models\SocialveoModel
countComments() Returns count of comments Socialveo\Core\models\Post
createObject() Creates an object using passed-in payload data Socialveo\Core\models\SocialveoModel
decrementProperty() Increment property Socialveo\Core\models\traits\JsonProperties
deleteObject() Deletes an object (soft-delete) Socialveo\Core\models\SocialveoModel
deleteTargetIndex() Delete target index Socialveo\Core\models\SocialveoModel
fetchObjects() Fetches the provided objects and returns them in an array Socialveo\Core\models\SocialveoModel
filteredFind() Returns query results filtered by GET user-parameters, optionaly cached Socialveo\Core\models\SocialveoModel
findFirstByUuid() Find first model by uuid Socialveo\Core\models\SocialveoModel
fire() Fire event Socialveo\Core\models\Post
forUpdate() Socialveo\Core\models\SocialveoModel
getActiveDeleted() Returns whether model is deleted Socialveo\Core\models\SocialveoModel
getActiveOk() Socialveo\Core\models\SocialveoModel
getActivePaymentProcess() Socialveo\Core\models\SocialveoModel
getAttributes() Get model meta data attributes Socialveo\Core\models\SocialveoModel
getAttributesStatic() Get models metadata attributes Socialveo\Core\models\SocialveoModel
getAvatar() Returns post avatar Socialveo\Core\models\Post
getChangedFields() Returns a list of changed values Socialveo\Core\models\SocialveoModel
getComments() Returns all comments Socialveo\Core\models\Post
getCountEmotions() Socialveo\Core\models\Post
getCover() Returns cover for post Socialveo\Core\models\Post
getEventsManagerInstance() Returns models Events Manager Socialveo\Core\models\SocialveoModel
getFiles() Socialveo\Core\models\Post
getGetters() Return getters Socialveo\Core\models\SocialveoModel
getImages() Socialveo\Core\models\Post
getIsActive() Whether post is active Socialveo\Core\models\Post
getIsHtml() Return whether post is html Socialveo\Core\models\Post
getIsHtmlOnFeed() Whether to show html on feed Socialveo\Core\models\Post
getIsOnNetworkString() Returns url to post creator Socialveo\Core\models\Post
getIsOwner() Check if user is owner of resource Socialveo\Core\models\SocialveoModel
getLastQueryFullCount() Socialveo\Core\models\SocialveoModel
getLastsComments() Returns the last 5 comments Socialveo\Core\models\Post
getLastsParentComments() Returns the last sub comments Socialveo\Core\models\Post
getLink() Returns url to post creator Socialveo\Core\models\Post
getLocationAddress() Location address depending on current request Socialveo\Core\models\Post
getLocationPlaceId() Location google place id Socialveo\Core\models\Post
getMedia() Socialveo\Core\models\Post
getMentions() Returns mentions Socialveo\Core\models\Post
getModel() Get model Socialveo\Core\models\SocialveoModel
getName() Socialveo\Core\models\Post
getObjectByParam() Fetches an object based on passed array Socialveo\Core\models\SocialveoModel
getObjectTypeByParam() Returns an resource type based on request URI Socialveo\Core\models\SocialveoModel
getOnTitle() Socialveo\Core\models\Post
getOwner() Returns post owner name Socialveo\Core\models\Post
getOwnerName() Returns post owner name Socialveo\Core\models\Post
getOwnerUrl() Returns post avatar Socialveo\Core\models\Post
getParseBody() Parse body Socialveo\Core\models\Post
getPaymentIsOk() Returns true if is payment ok Socialveo\Core\models\SocialveoModel
getPostsByNetwork() Returns a list of posts for a given network Socialveo\Core\models\Post
getPostsByUser() Returns a list of posts for a given user Socialveo\Core\models\Post
getProperties() Returns properties Socialveo\Core\models\traits\JsonProperties
getProperty() Returns property Socialveo\Core\models\traits\JsonProperties
getPropertyAsArray() Returns property as array Socialveo\Core\models\traits\JsonProperties
getRealOwner() Return real owner Socialveo\Core\models\SocialveoModel
getResourceType() Returns a string resource name of the Object (singular form) Socialveo\Core\models\SocialveoModel
getScenario() Socialveo\Core\models\SocialveoModel
getSetters() Return setters Socialveo\Core\models\SocialveoModel
getSource() Define table mapping Socialveo\Core\models\Post
getSourceTable() Returns the source table Socialveo\Core\models\SocialveoModel
getTags() Returns associated tags Socialveo\Core\models\Post
getTarget() Returns target object Socialveo\Core\models\SocialveoModel
getTargetObject() Returns the target object by target_id and target_type Socialveo\Core\models\SocialveoModel
getTargetObjectFromArray() Fetches an object based on passed array Socialveo\Core\models\SocialveoModel
getTargetType() Returns target type Socialveo\Core\models\SocialveoModel
getUserEmotion() Get user emotion for post Socialveo\Core\models\Post
getUserHomepagePosts() Returns a list of homepage posts for a given user Socialveo\Core\models\Post
getUuidsObjects() Fetch objects passed in array Socialveo\Core\models\SocialveoModel
getVideos() Socialveo\Core\models\Post
getViewUrl() Returns post view url Socialveo\Core\models\Post
hasChanged() Check if a specific attribute has changed This only works if the model is keeping data snapshots Socialveo\Core\models\SocialveoModel
incrementProperty() Increment property Socialveo\Core\models\traits\JsonProperties
initBehaviors() Behaviors Socialveo\Core\models\Post
initialize() Initialize method for model Socialveo\Core\models\Post
isModel() Check if called class and the model name is the same Socialveo\Core\models\SocialveoModel
isNew() Checks whether model is new Socialveo\Core\models\SocialveoModel
isNewRecord() Checks whether model is new Socialveo\Core\models\SocialveoModel
isPublic() Socialveo\Core\models\Post
isSkipValidation() Is skip validation Socialveo\Core\models\SocialveoModel
onConstruct() OnConstruct event model Socialveo\Core\models\SocialveoModel
pluralize() Transforms words from singular to plural Socialveo\Core\models\SocialveoModel
postUserCommentHasAccess() Socialveo\Core\models\Post
readAttribute() Read attribute from getter Socialveo\Core\models\SocialveoModel
resourceToModel() Transforms a resource name string to a Model name (if such model exists) Socialveo\Core\models\SocialveoModel
resultsetToJson() Returns an array of typed arrays, ready to be json_encoded Socialveo\Core\models\SocialveoModel
retrieve() Returns object from cache (if set and not expired) or database Socialveo\Core\models\SocialveoModel
setGetter() Set getter Socialveo\Core\models\SocialveoModel
setProperty() Set property Socialveo\Core\models\traits\JsonProperties
setScenario() Socialveo\Core\models\SocialveoModel
setSetter() Set setter Socialveo\Core\models\SocialveoModel
setTargetObject() Set target_id and target_type Socialveo\Core\models\SocialveoModel
singularize() Transforms words from plural to singular Socialveo\Core\models\SocialveoModel
t() Gets translations Socialveo\Core\Translatable
toJson() Socialveo\Core\models\Post
updateFields() Update only custom fields Socialveo\Core\models\SocialveoModel
userCommentHasAccess() Socialveo\Core\models\Post
userHasAccess() Returns true if user has access to post, otherwise false Socialveo\Core\models\Post
userHasAccessDelete() Socialveo\Core\models\Post
usersMarkedAsSpam() Socialveo\Core\models\Post
validation() Validations Socialveo\Core\models\Post
withSharedPosts() Each all shared posts and call function Socialveo\Core\models\Post
writeAttribute() Write attribute using setter Socialveo\Core\models\SocialveoModel

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
_postSaveRelatedRecords() Override default method for turn off auto-updating related records Socialveo\Core\models\SocialveoModel
_preSaveRelatedRecords() Override default method for turn off auto-updating related records Socialveo\Core\models\SocialveoModel
afterSave() After save hook Socialveo\Core\models\Post
afterUpdate() After update hook Socialveo\Core\models\Post
beforeCreate() Before create hook Socialveo\Core\models\SocialveoModel
beforeSave() Before save hook Socialveo\Core\models\Post
beforeUpdate() Before update hook Socialveo\Core\models\SocialveoModel
getUser() Returns user model of the currently logged in (or passed-in) user Socialveo\Core\models\SocialveoModel

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
ACTIVE_DELETE 0 Delete Socialveo\Core\models\SocialveoModel
ACTIVE_OK 1 Active Socialveo\Core\models\SocialveoModel
ACTIVE_PROCESS_PAYMENT 2 Payment process Socialveo\Core\models\SocialveoModel
POST_TYPE_POST 'post' Socialveo\Core\models\Post
SCENARIO_DEFAULT 'default' Socialveo\Core\models\SocialveoModel
SCENARIO_DELETE 'delete' Socialveo\Core\models\SocialveoModel
SCENARIO_PAYMENT 'payment' Socialveo\Core\models\SocialveoModel
SCENARIO_SAVE_USER 'save_user' Socialveo\Core\models\SocialveoModel
SCENARIO_SKIP_VALIDATION 'skip_validation' Socialveo\Core\models\SocialveoModel
STATUS_ACTIVE 1 Post active Socialveo\Core\models\Post
STATUS_BLOCKED 2 Post blocked Socialveo\Core\models\Post
STATUS_INACTIVE 0 Post inactive Socialveo\Core\models\Post

Property Details

$active public property (available since version 1.0)
public integer $active null
$allowed_comment public property (available since version 1.0)
public boolean $allowed_comment null
$associations public property (available since version 1.0)
$body public property (available since version 1.0)
public string $body null
$count_comments public property (available since version 1.0)
$count_emotions public property (available since version 1.0)
$count_shares public property (available since version 1.0)
$created public property (available since version 1.0)
public integer $created null
$embed public property (available since version 1.0)
public string|stdClass $embed null
$emotions public property (available since version 1.0)
public string|stdClass $emotions null
$id public property (available since version 1.0)
public integer $id null
$location_id public property
public integer $location_id null
$location_uuid public property
public string $location_uuid null
$network_id public property (available since version 1.0)
public integer $network_id null
$network_uuid public property (available since version 1.0)
public string $network_uuid null
$post_type public property (available since version 1.0)
public string $post_type null
$priority public property (available since version 1.0)
public integer $priority null
$properties public property (available since version 1.0)
public stdClass $properties null
$shared_post_id public property (available since version 1.0)
$shared_post_uuid public property (available since version 1.0)
$shared_user_id public property (available since version 1.0)
$shared_user_uuid public property (available since version 1.0)
$signed public property (available since version 1.0)
public boolean $signed null
$spam public property (available since version 1.0)
public string|stdClass $spam null
$status public property (available since version 1.0)
public integer $status null
$updated public property (available since version 1.0)
public integer $updated null
$user_id public property (available since version 1.0)
public integer $user_id null
$user_uuid public property (available since version 1.0)
public string $user_uuid null
$uuid public property (available since version 1.0)
public string $uuid null

Method Details

afterCreate() public method (available since version 1.0)

After create hook

public void afterCreate ( )
throws Exception

Could not retrieve encryption key to decypher message

afterFetch() public method (available since version 1.0)

After fetch hook

public void afterFetch ( )
throws Exception

Could not retrieve encryption key to decypher message

afterSave() protected method (available since version 1.0)

After save hook

protected void afterSave ( )
throws Exception

Could not retrieve encryption key to decypher message

afterUpdate() protected method

After update hook

protected void afterUpdate ( )
throws Exception
beforeDelete() public method (available since version 1.0)

Before delete hook

public void beforeDelete ( )
beforeSave() protected method (available since version 1.0)

Before save hook

protected void beforeSave ( )
throws Exception

Could not retrieve encryption key to cypher message

countComments() public method

Returns count of comments

public integer countComments ( $parentId null, $lastId null )
$parentId integer|null
$lastId integer|null
return integer

$count

fire() public method (available since version 1.0)

Fire event

public void fire ( $event, $options = [] )
$event string
$options array

[optional]

getAvatar() public method

Returns post avatar

public string getAvatar ( )
getComments() public method

Returns all comments

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Comment[] getComments ( )
getCountEmotions() public method

public array getCountEmotions ( )
throws Exception
getCover() public method

Returns cover for post

public string|false getCover ( )
getFiles() public method

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Media[] getFiles ( )
getImages() public method

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Media[] getImages ( )
getIsActive() public method

Whether post is active

public boolean getIsActive ( )
getIsHtml() public method

Return whether post is html

public boolean getIsHtml ( )
getIsHtmlOnFeed() public method

Whether to show html on feed

public boolean getIsHtmlOnFeed ( )
getIsOnNetworkString() public method

Returns url to post creator

public string getIsOnNetworkString ( )
getLastsComments() public method

Returns the last 5 comments

public Socialveo\Core\models\Comment[] getLastsComments ( $groupParent true, $limit true, $lastId null, $child_limit 2 )
$groupParent boolean

[optional]

$limit integer|boolean

[optional]

$lastId null|integer

[optional]

$child_limit integer

[optional]

getLastsParentComments() public method

Returns the last sub comments

public Socialveo\Core\models\Comment[] getLastsParentComments ( $parentId, $offset 2, $limit 5, $lastId null, $postId false )
$parentId integer
$offset integer
$limit integer

[optional]

$lastId integer|null

[optional]

$postId boolean

[optional]

getLink() public method

Returns url to post creator

public string getLink ( )
getLocationAddress() public method (available since version 1.0)

Location address depending on current request

public string getLocationAddress ( )
getLocationPlaceId() public method (available since version 1.0)

Location google place id

public string getLocationPlaceId ( )
getMedia() public method

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Media[] getMedia ( )
getMentions() public method

Returns mentions

public array|null getMentions ( $type null )
$type string

[optional]

getName() public method

public string getName ( )
getOnTitle() public method

public null|string getOnTitle ( )
getOwner() public method

Returns post owner name

public string getOwner ( )
getOwnerName() public method

Returns post owner name

public string getOwnerName ( )
getOwnerUrl() public method

Returns post avatar

public string getOwnerUrl ( )
getParseBody() public method

Parse body

public string getParseBody ( $readMore false, &$tags = [] )
$readMore boolean

[optional]

$tags array

[optional]

getPostsByNetwork() public static method (available since version 1.0)

Returns a list of posts for a given network

public static Phalcon\Mvc\Model\Resultset\Simple|mixed getPostsByNetwork ( $network_uuid, $params = [] )
$network_uuid string
$params array

[optional]

throws Exception

Network not found

getPostsByUser() public static method (available since version 1.0)

Returns a list of posts for a given user

public static Phalcon\Mvc\Model\Resultset\Simple|mixed getPostsByUser ( $user_uuid, $params = [] )
$user_uuid string
$params array

[optional]

throws Exception

Network not found

getSource() public method (available since version 1.0)

Define table mapping

public string getSource ( )
getTags() public method

Returns associated tags

public Socialveo\Core\models\Tag[]|null getTags ( )
getUserEmotion() public method

Get user emotion for post

public Socialveo\Core\models\Tag|null getUserEmotion ( Socialveo\Core\models\User $user )
$user Socialveo\Core\models\User
getUserHomepagePosts() public static method (available since version 1.0)

Returns a list of homepage posts for a given user

public static Phalcon\Mvc\Model\ResultsetInterface getUserHomepagePosts ( $user_uuid, $params )
$user_uuid string
$params array
throws Exception

User not found

getVideos() public method

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Media[] getVideos ( )
getViewUrl() public method

Returns post view url

public string getViewUrl ( )
initBehaviors() public method (available since version 1.0)

Behaviors

public array initBehaviors ( )
initialize() public method (available since version 1.0)

Initialize method for model

public void initialize ( )
isPublic() public method

public void isPublic ( )
postUserCommentHasAccess() public method

public boolean postUserCommentHasAccess ( $user null )
$user mixed
toJson() public method (available since version 1.0)

public array toJson ( $embed = [], $extraFields = [] )
$embed array
$extraFields array
userCommentHasAccess() public method

public boolean|Phalcon\Mvc\Model userCommentHasAccess ( $user null )
$user mixed
userHasAccess() public method (available since version 1.0)

Returns true if user has access to post, otherwise false

public boolean userHasAccess ( $user null )
$user mixed

Object, UUID, or null

userHasAccessDelete() public method

public boolean userHasAccessDelete ( Socialveo\Core\models\User $user )
$user Socialveo\Core\models\User
usersMarkedAsSpam() public method

public array usersMarkedAsSpam ( )
validation() public method (available since version 1.0)

Validations

public boolean validation ( )
withSharedPosts() public method (available since version 1.0)

Each all shared posts and call function

public void withSharedPosts ( $callback )
$callback callable
throws Exception