Class Socialveo\Core\models\Comment

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

Class Comment

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
afterDelete() After delete hook Socialveo\Core\models\Comment
afterFetch() After fetch hook Socialveo\Core\models\Comment
afterSave() After save hook Socialveo\Core\models\Comment
afterUpdate() After update hook Socialveo\Core\models\Comment
beforeDelete() Before delete hook Socialveo\Core\models\Comment
beforeSave() Before save hook Socialveo\Core\models\Comment
behaviors() Behaviors Socialveo\Core\models\Comment
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
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\Comment
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
getAllowedAttachmentExtensions() Get allowed attachment extensions Socialveo\Core\models\Comment
getAttributes() Get model meta data attributes Socialveo\Core\models\SocialveoModel
getAttributesStatic() Get models metadata attributes Socialveo\Core\models\SocialveoModel
getAvatar() Returns comment avatar Socialveo\Core\models\Comment
getChangedFields() Returns a list of changed values Socialveo\Core\models\SocialveoModel
getEventsManagerInstance() Returns models Events Manager Socialveo\Core\models\SocialveoModel
getFiles() Socialveo\Core\models\Comment
getGetters() Return getters Socialveo\Core\models\SocialveoModel
getImages() Socialveo\Core\models\Comment
getIsOwner() Check if user is owner of resource Socialveo\Core\models\SocialveoModel
getLastQueryFullCount() Socialveo\Core\models\SocialveoModel
getLink() Return link comment author Socialveo\Core\models\Comment
getMedia() Socialveo\Core\models\Comment
getModel() Get model Socialveo\Core\models\SocialveoModel
getName() Socialveo\Core\models\Comment
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
getOwner() Returns comment owner Socialveo\Core\models\Comment
getOwnerName() Returns comment owner name Socialveo\Core\models\Comment
getOwnerUrl() Returns comment avatar Socialveo\Core\models\Comment
getParseBody() Get parsed body Socialveo\Core\models\Comment
getPaymentIsOk() Returns true if is payment ok Socialveo\Core\models\SocialveoModel
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\Comment
getSourceTable() Returns the source table Socialveo\Core\models\SocialveoModel
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
getTargetTypes() Socialveo\Core\models\Comment
getUsersCommenting() Returns a list of users commenting associated with the given resource Socialveo\Core\models\Comment
getUuidsObjects() Fetch objects passed in array Socialveo\Core\models\SocialveoModel
getVideos() Socialveo\Core\models\Comment
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() Init behaviors Socialveo\Core\models\SocialveoModel
initialize() Initialize method for model Socialveo\Core\models\Comment
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
isSkipValidation() Is skip validation Socialveo\Core\models\SocialveoModel
listTargetComments() Returns a list of comments for a given target Socialveo\Core\models\Comment
onConstruct() OnConstruct event model Socialveo\Core\models\SocialveoModel
pluralize() Transforms words from singular to plural Socialveo\Core\models\SocialveoModel
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() Converts object to json Socialveo\Core\models\Comment
updateFields() Update only custom fields Socialveo\Core\models\SocialveoModel
userHasAccess() Returns true if user has access to view comment, otherwise false Socialveo\Core\models\Comment
usersMarkedAsSpam() Socialveo\Core\models\Comment
validation() Validations Socialveo\Core\models\Comment
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
beforeCreate() Before create hook Socialveo\Core\models\SocialveoModel
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
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 User account activated Socialveo\Core\models\Comment
STATUS_BLOCKED 2 User account blocked Socialveo\Core\models\Comment
STATUS_INACTIVE 0 User account not activated Socialveo\Core\models\Comment
TARGET_TYPE_COMMENT 'comment' Socialveo\Core\models\Comment
TARGET_TYPE_MEDIA 'media' Socialveo\Core\models\Comment
TARGET_TYPE_NETWORK 'network' Socialveo\Core\models\Comment
TARGET_TYPE_POST 'post' Socialveo\Core\models\Comment
TARGET_TYPE_USER 'user' Socialveo\Core\models\Comment

Property Details

$active public property (available since version 1.0)
public integer $active null
$associations public property (available since version 1.0)
public string $associations null
$body public property (available since version 1.0)
public string $body null
$comment_type public property (available since version 1.0)
public string $comment_type null
$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 $emotions null
$id public property (available since version 1.0)
public integer $id null
$parent_id public property (available since version 1.0)
public integer $parent_id null
$parent_uuid public property (available since version 1.0)
public string $parent_uuid null
$properties public property (available since version 1.0)
public string $properties null
$spam public property (available since version 1.0)
public integer $spam null
$status public property (available since version 1.0)
public integer $status null
$target_id public property (available since version 1.0)
public integer $target_id null
$target_type public property (available since version 1.0)
public string $target_type null
$target_uuid public property (available since version 1.0)
public string $target_uuid 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

afterDelete() public method (available since version 1.0)

After delete hook

public void afterDelete ( )
afterFetch() public method (available since version 1.0)

After fetch hook

public void afterFetch ( )
afterSave() public method (available since version 1.0)

After save hook

public void afterSave ( )
afterUpdate() public method

After update hook

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

Before delete hook

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

Before save hook

public void beforeSave ( )
behaviors() public method (available since version 1.0)

Behaviors

public array behaviors ( )
fire() public method (available since version 1.0)

Fire event

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

[optional]

getAllowedAttachmentExtensions() public static method

Get allowed attachment extensions

public static array|null getAllowedAttachmentExtensions ( )
getAvatar() public method

Returns comment avatar

public string getAvatar ( )
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 ( )
getLink() public method

Return link comment author

public string getLink ( )
getMedia() public method

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

public string getName ( )
getOwner() public method

Returns comment owner

public string getOwner ( )
getOwnerName() public method

Returns comment owner name

public string getOwnerName ( )
getOwnerUrl() public method

Returns comment avatar

public string getOwnerUrl ( )
getParseBody() public method

Get parsed body

public string getParseBody ( &$tags = [] )
$tags array

[ref]

getSource() public method (available since version 1.0)

Define table mapping

public string getSource ( )
getTargetTypes() public static method

public static array getTargetTypes ( )
getUsersCommenting() public static method (available since version 1.0)

Returns a list of users commenting associated with the given resource

public static Socialveo\Core\models\User getUsersCommenting ( $comment_uuid )
$comment_uuid string
return Socialveo\Core\models\User

Object

getVideos() public method

public Phalcon\Mvc\Model\ResultsetInterface|Socialveo\Core\models\Media[] getVideos ( )
initialize() public method (available since version 1.0)

Initialize method for model

public void initialize ( )
listTargetComments() public static method (available since version 1.0)

Returns a list of comments for a given target

public static Socialveo\Core\models\Comment listTargetComments ( $target_uuid, $target_type, $params )
$target_uuid string
$target_type string
$params array
return Socialveo\Core\models\Comment

Object

throws Exception
toJson() public method (available since version 1.0)

Converts object to json

public array toJson ( $embed = [], $extraFields = [] )
$embed array
$extraFields array
userHasAccess() public method (available since version 1.0)

Returns true if user has access to view comment, otherwise false

public boolean userHasAccess ( $user null )
$user mixed

Object, UUID, or null

usersMarkedAsSpam() public method

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

Validations

public boolean|void validation ( )