Class Socialveo\Core\models\MessagesDialogs

InheritanceSocialveo\Core\models\MessagesDialogs » Socialveo\Core\models\SocialveoModel » Phalcon\Mvc\Model
Uses TraitsSocialveo\Core\Translatable

Class MessagesDialogs

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
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
createObject() Creates an object using passed-in payload data Socialveo\Core\models\SocialveoModel
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
filterDialogs() Filter dialogs Socialveo\Core\models\MessagesDialogs
filteredFind() Returns query results filtered by GET user-parameters, optionaly cached Socialveo\Core\models\SocialveoModel
findByUserId() Find dialogs by user id Socialveo\Core\models\MessagesDialogs
findFirstByUuid() Find first model by uuid Socialveo\Core\models\SocialveoModel
fire() Fire event Socialveo\Core\models\SocialveoModel
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
getChangedFields() Returns a list of changed values Socialveo\Core\models\SocialveoModel
getCountUnreadMessages() Get count of unread messages Socialveo\Core\models\MessagesDialogs
getCountUsers() Socialveo\Core\models\MessagesDialogs
getDialogType() Returns dialogs type Socialveo\Core\models\MessagesDialogs
getEventsManagerInstance() Returns models Events Manager Socialveo\Core\models\SocialveoModel
getGetters() Return getters Socialveo\Core\models\SocialveoModel
getInterlocutor() Get interlocutor for private dialogs Socialveo\Core\models\MessagesDialogs
getInterlocutors() Get interlocutors for group dialogs Socialveo\Core\models\MessagesDialogs
getIsOwner() Check if user is owner of resource Socialveo\Core\models\SocialveoModel
getLastMessage() Get last message of dialog Socialveo\Core\models\MessagesDialogs
getLastQueryFullCount() Socialveo\Core\models\SocialveoModel
getModel() Get model Socialveo\Core\models\SocialveoModel
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
getParticipants() Get participants for group dialogs. Socialveo\Core\models\MessagesDialogs
getPaymentIsOk() Returns true if is payment ok Socialveo\Core\models\SocialveoModel
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
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
getUnreadMessages() Get unread messages Socialveo\Core\models\MessagesDialogs
getUsers() Socialveo\Core\models\MessagesDialogs
getUuidsObjects() Fetch objects passed in array Socialveo\Core\models\SocialveoModel
hasChanged() Check if a specific attribute has changed This only works if the model is keeping data snapshots Socialveo\Core\models\SocialveoModel
initBehaviors() Init behaviors Socialveo\Core\models\SocialveoModel
initialize() Initialize method for model Socialveo\Core\models\MessagesDialogs
isGroup() Check is group Socialveo\Core\models\MessagesDialogs
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
isPrivate() Check is private Socialveo\Core\models\MessagesDialogs
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
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
searchDialogs() Search dialogs for specific user by search query Socialveo\Core\models\MessagesDialogs
setGetter() Set getter Socialveo\Core\models\SocialveoModel
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() Convert object to json Socialveo\Core\models\MessagesDialogs
touch() Touch dialog, marks dialog as read, removes notifications about unread messages Socialveo\Core\models\MessagesDialogs
updateFields() Update only custom fields Socialveo\Core\models\SocialveoModel
userHasAccess() Check is user has access Socialveo\Core\models\MessagesDialogs
validation() Validations Socialveo\Core\models\MessagesDialogs
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
afterFetch() After fetch hook Socialveo\Core\models\SocialveoModel
afterSave() After save hook Socialveo\Core\models\SocialveoModel
afterUpdate() After update hook Socialveo\Core\models\SocialveoModel
beforeCreate() Before create hook Socialveo\Core\models\SocialveoModel
beforeDelete() Before delete hook Socialveo\Core\models\SocialveoModel
beforeSave() Before save 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
TYPE_GROUP 1 Dialog type group Socialveo\Core\models\MessagesDialogs
TYPE_PRIVATE 0 Dialog type private Socialveo\Core\models\MessagesDialogs

Property Details

$active public property (available since version 1.0)
public integer $active null
$created public property (available since version 1.0)
public integer $created null
$dialogTypes public static property (available since version 1.0)
public static array $dialogTypes = [self::TYPE_PRIVATE => 'Private'self::TYPE_GROUP => 'Group']
$id public property (available since version 1.0)
public integer $id null
$name public property (available since version 1.0)
public string $name null
$to_user_id public property (available since version 1.0)
public integer $to_user_id null
$to_user_uuid public property (available since version 1.0)
public string $to_user_uuid null
$type public property (available since version 1.0)
public integer $type 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

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

Filter dialogs

public static Socialveo\Core\models\MessagesDialogs[] filterDialogs ( $dialogs, $type 'group' )
$dialogs Socialveo\Core\models\MessagesDialogs[]
$type string
findByUserId() public static method (available since version 1.0)

Find dialogs by user id

public static Socialveo\Core\models\MessagesDialogs[] findByUserId ( $user_id, $criteria null )
$user_id integer
$criteria null|Phalcon\Mvc\Model\Criteria

[optional]

getCountUnreadMessages() public method (available since version 1.0)

Get count of unread messages

public integer getCountUnreadMessages ( )
getCountUsers() public method (available since version 1.0)

public integer getCountUsers ( )
getDialogType() public method (available since version 1.0)

Returns dialogs type

public string getDialogType ( )
getInterlocutor() public method (available since version 1.0)

Get interlocutor for private dialogs

public Socialveo\Core\models\User getInterlocutor ( )
getInterlocutors() public method (available since version 1.0)

Get interlocutors for group dialogs

public Socialveo\Core\models\User[] getInterlocutors ( )
getLastMessage() public method (available since version 1.0)

Get last message of dialog

public Socialveo\Core\models\Messages getLastMessage ( )
getParticipants() public method (available since version 1.0)

Get participants for group dialogs.

Alias of {@link self::getInterlocutors()}

public Socialveo\Core\models\User getParticipants ( )
getUnreadMessages() public method (available since version 1.0)

Get unread messages

public Socialveo\Core\models\Messages[] getUnreadMessages ( )
getUsers() public method (available since version 1.0)

public Socialveo\Core\models\User[] getUsers ( )
initialize() public method (available since version 1.0)

Initialize method for model

public void initialize ( )
isGroup() public method (available since version 1.0)

Check is group

public boolean isGroup ( )
isPrivate() public method (available since version 1.0)

Check is private

public boolean isPrivate ( )
searchDialogs() public static method (available since version 1.0)

Search dialogs for specific user by search query

public static Socialveo\Core\models\MessagesDialogs[] searchDialogs ( $user, $query, $criteria null )
$user Socialveo\Core\models\User
$query string
$criteria Phalcon\Mvc\Model\Criteria

[optional]

toJson() public method

Convert object to json

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

[optional]

$extraFields array

[optional]

touch() public method (available since version 1.0)

Touch dialog, marks dialog as read, removes notifications about unread messages

public boolean touch ( )
userHasAccess() public method (available since version 1.0)

Check is user has access

public boolean userHasAccess ( $user null )
$user Socialveo\Core\models\User|null
validation() public method (available since version 1.0)

Validations

public boolean|void validation ( )