Class lispa\amos\admin\models\UserProfile
Class UserProfile
This is the model class for table "user_profile".
Public Properties
Protected Properties
Public Methods
Protected Methods
Method | Description | Defined By |
---|---|---|
__shortText() | Parse string and return limited one | lispa\amos\core\record\Record |
checkOneTagPresent() | Method to check if there is at least one tag selected. | lispa\amos\admin\models\UserProfile |
createRelationQuery() | Creates a query instance for has-one or has-many relation. |
yii\db\BaseActiveRecord |
deleteInternal() | Deletes an ActiveRecord without considering transaction. | yii\db\ActiveRecord |
findByCondition() | Finds ActiveRecord instance(s) by the given condition. | yii\db\ActiveRecord |
image_exists() | lispa\amos\admin\models\UserProfile | |
insertInternal() | Inserts an ActiveRecord into DB without considering transaction. | yii\db\ActiveRecord |
resolveFields() | Determines which fields can be returned by toArray(). | yii\base\ArrayableTrait |
switchOffNotifications() | Switch off notifications | lispa\amos\notificationmanager\record\NotifyRecord |
updateInternal() | yii\db\BaseActiveRecord |
Events
Event | Type | Description | Defined By |
---|---|---|---|
EVENT_AFTER_DELETE | yii\base\Event | An event that is triggered after a record is deleted. | yii\db\BaseActiveRecord |
EVENT_AFTER_FIND | yii\base\Event | An event that is triggered after the record is created and populated with query result. | yii\db\BaseActiveRecord |
EVENT_AFTER_INSERT | yii\db\AfterSaveEvent | An event that is triggered after a record is inserted. | yii\db\BaseActiveRecord |
EVENT_AFTER_REFRESH | yii\base\Event | An event that is triggered after a record is refreshed. (available since version 2.0.8) | yii\db\BaseActiveRecord |
EVENT_AFTER_UPDATE | yii\db\AfterSaveEvent | An event that is triggered after a record is updated. | yii\db\BaseActiveRecord |
EVENT_AFTER_VALIDATE | yii\base\Event | An event raised at the end of validate() | yii\base\Model |
EVENT_BEFORE_DELETE | yii\base\ModelEvent | An event that is triggered before deleting a record. | yii\db\BaseActiveRecord |
EVENT_BEFORE_INSERT | yii\base\ModelEvent | An event that is triggered before inserting a record. | yii\db\BaseActiveRecord |
EVENT_BEFORE_UPDATE | yii\base\ModelEvent | An event that is triggered before updating a record. | yii\db\BaseActiveRecord |
EVENT_BEFORE_VALIDATE | yii\base\ModelEvent | An event raised at the beginning of validate(). | yii\base\Model |
EVENT_INIT | yii\base\Event | An event that is triggered when the record is initialized via init(). | yii\db\BaseActiveRecord |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
BOOLEAN_FIELDS_VALUE_NO | 0 | lispa\amos\admin\models\base\UserProfile | |
BOOLEAN_FIELDS_VALUE_YES | 1 | lispa\amos\admin\models\base\UserProfile | |
EVENT_AGGIORNA_RUOLO | 'aggiorna-ruolo' | lispa\amos\admin\models\UserProfile | |
OP_ALL | 7 | All three operations: insert, update, delete. This is a shortcut of the expression: OP_INSERT | OP_UPDATE | OP_DELETE. | yii\db\ActiveRecord |
OP_DELETE | 4 | The delete operation. This is mainly used when overriding transactions() to specify which operations are transactional. | yii\db\ActiveRecord |
OP_INSERT | 1 | The insert operation. This is mainly used when overriding transactions() to specify which operations are transactional. | yii\db\ActiveRecord |
OP_UPDATE | 2 | The update operation. This is mainly used when overriding transactions() to specify which operations are transactional. | yii\db\ActiveRecord |
SCENARIO_CREATE_NEW_ACCOUNT | 'scenario_create_new_account' | Scenario used to create new account for social login. | lispa\amos\admin\models\base\UserProfile |
SCENARIO_DEFAULT | 'default' | The name of the default scenario. | yii\base\Model |
SCENARIO_DYNAMIC | 'scenario_dynamic' | Dynamic scenario for form | lispa\amos\admin\models\base\UserProfile |
SCENARIO_FAKE_REQUIRED | 'scenario_fake_required' | lispa\amos\core\record\Record | |
SCENARIO_INTERESTS | 'scenario_interests' | lispa\amos\admin\models\base\UserProfile | |
SCENARIO_INTRODUCING_MYSELF | 'scenario_introducing_myself' | lispa\amos\admin\models\base\UserProfile | |
SCENARIO_INTRODUCTION | 'scenario_introduction' | All the scenarios listed below are for the wizard. | lispa\amos\admin\models\base\UserProfile |
SCENARIO_PARTNERSHIP | 'scenario_partnership' | lispa\amos\admin\models\base\UserProfile | |
SCENARIO_REACTIVATE_DEACTIVATE_USER | 'scenario_reactivate_deactivate_user' | Scenario used in user reactivate and deactivate action. | lispa\amos\admin\models\base\UserProfile |
SCENARIO_ROLE_AND_AREA | 'scenario_role_and_area' | lispa\amos\admin\models\base\UserProfile | |
SCENARIO_SUMMARY | 'scenario_summary' | lispa\amos\admin\models\base\UserProfile | |
STATUS_ACTIVE | 1 | Activated user profile value | lispa\amos\admin\models\base\UserProfile |
STATUS_DEACTIVATED | 0 | Deactivated user profile value | lispa\amos\admin\models\base\UserProfile |
USERPROFILE_WORKFLOW | 'UserProfileWorkflow' | lispa\amos\admin\models\base\UserProfile | |
USERPROFILE_WORKFLOW_STATUS_DRAFT | 'UserProfileWorkflow/DRAFT' | lispa\amos\admin\models\base\UserProfile | |
USERPROFILE_WORKFLOW_STATUS_NOTVALIDATED | 'UserProfileWorkflow/NOTVALIDATED' | lispa\amos\admin\models\base\UserProfile | |
USERPROFILE_WORKFLOW_STATUS_TOVALIDATE | 'UserProfileWorkflow/TOVALIDATE' | lispa\amos\admin\models\base\UserProfile | |
USERPROFILE_WORKFLOW_STATUS_VALIDATED | 'UserProfileWorkflow/VALIDATED' | lispa\amos\admin\models\base\UserProfile |
Property Details
Category of content
Il risultato della query
List of statuses that for cwh is validated
The name that correspond to 'draft' status for the content model
The url to view of this model
The columns ti show as default in GridViewWidget
Il percorso del marker che sarà utilizzato nella mappa
The classname of the generic dashboard widget to access the plugin
Date end of publication
Date begin of publication
The model title field value
The name that correspond to 'to validate' status for the content model
ActiveQuery|CachedActiveQuery $query
ActiveQuery|CachedActiveQuery $query
The name that correspond to 'published' status for the content model
The name of model validator role
Validatori
The url to view a single model
Method Details
This method activate a user profile with activation of the relative user.
public boolean activateUserProfile ( ) |
public void afterFind ( ) |
Returns the attribute hints.
Attribute hints are mainly used for display purpose. For example, given an attribute
isPublic
, we can declare a hint Whether the post should be visible for not logged in users
,
which provides user-friendly description of the attribute meaning and can be displayed to end users.
Unlike label hint will not be generated, if its explicit declaration is omitted.
Note, in order to inherit hints defined in the parent class, a child class needs to
merge the parent hints with child hints using functions such as array_merge()
.
public array attributeHints ( ) | ||
return | array | Attribute hints (name => hint) |
---|
public void attributeLabels ( ) |
public void beforeDelete ( ) |
Override for demos
The default implementation will trigger an EVENT_BEFORE_INSERT event when $insert
is true
,
or an EVENT_BEFORE_UPDATE event if $insert
is false
.
When overriding this method, make sure you call the parent implementation like the following:
public function beforeSave($insert)
{
if (!parent::beforeSave($insert)) {
return false;
}
// ...custom code here...
return true;
}
public boolean beforeSave ( $insert ) | ||
$insert | boolean | Whether this method called while inserting a record.
If |
return | boolean | Whether the insertion or updating should continue.
If |
---|
This method is invoked before validation starts.
The default implementation raises a beforeValidate
event.
You may override this method to do preliminary checks before validation.
Make sure the parent implementation is invoked so that the event can be raised.
public boolean beforeValidate ( ) | ||
return | boolean | Whether the validation should be executed. Defaults to true. If false is returned, the validation will stop and the model is considered invalid. |
---|
public mixed behaviors ( ) |
public void checkAnomimo ( $attribute ) | ||
$attribute |
public void checkCodiceFiscale ( $attribute, $params ) | ||
$attribute | ||
$params |
Method to check if there is at least one tag selected.
protected boolean checkOneTagPresent ( ) |
This method deactivate a user profile with deactivation of the relative user.
public boolean deactivateUserProfile ( ) |
This method return new instance of AdminWorkflowEvent
public lispa\amos\admin\events\AdminWorkflowEvent getAdminWorkflowEvent ( ) |
Method that returns all facilitators users present in the system.
public lispa\amos\admin\models\UserProfile[] getAllFacilitatorUserProfiles ( ) |
Funzione che restituisce tutti gli utenti facilitatori presenti nel sistema
public yii\db\ActiveQuery getAllUtentiFacilitatori ( ) |
public \lispa\amos\admin\models\type getAvatar ( $dimension = 'original' ) | ||
$dimension | \lispa\amos\admin\models\type |
public string getAvatarImage ( $dimension = 'small', $options = [] ) | ||
$dimension | string | |
$options | array |
public \lispa\amos\admin\models\type getAvatarUrl ( $dimension = 'original' ) | ||
$dimension | \lispa\amos\admin\models\type |
public \lispa\amos\admin\models\type getAvatarWebUrl ( $dimension = 'original' ) | ||
$dimension | \lispa\amos\admin\models\type |
public \lispa\amos\admin\models\type getCampiConsigliati ( ) |
public yii\db\ActiveQuery getCategory ( ) | ||
return | yii\db\ActiveQuery | Category of content |
---|
public void getCompletamentoProfilo ( ) |
public void getContatti ( $id = NULL ) | ||
$id |
Restituisce il nome e il cognome dei contatti dell'utente
public yii\db\ActiveRecord getContattiNomeCognome ( $id = NULL ) | ||
$id | integer | L'id dell'utente dei quali si vuole conoscere i contatti, se non inserito è dell'utente attuale |
return | yii\db\ActiveRecord | Il risultato della query |
---|
public array getCwhValidationStatuses ( ) | ||
return | array | List of statuses that for cwh is validated |
---|
This method returns the default facilitator profile. If not present it returns null.
public lispa\amos\admin\models\UserProfile|null getDefaultFacilitator ( ) |
public string getDescription ( $truncate ) | ||
$truncate | ||
return | string | The model description field value |
---|
public string getDraftStatus ( ) | ||
return | string | The name that correspond to 'draft' status for the content model |
---|
This method return the facilitator profile of this user profile. If not present, it return the default facilitator profile. If not present it return null.
public lispa\amos\admin\models\UserProfile|null getFacilitatorOrDefFacilitator ( ) |
public string getFullViewUrl ( ) | ||
return | string | The url to view of this model |
---|
public mixed getGrammar ( ) |
public array getGridViewColumns ( ) | ||
return | array | The columns ti show as default in GridViewWidget |
---|
Restituisce il percorso del marker, da personalizzare a piacimento
public string getIconaMarker ( ) | ||
return | string | Il percorso del marker che sarà utilizzato nella mappa |
---|
public void getIndirizzoCompleto ( ) |
public string getLogoImg ( $dimension = 'original', $email = false ) | ||
$dimension | string | |
boolean |
Restituisce il nome e cognome degli utenti
public void getNomeCognome ( ) |
public mixed|null getNotifiedUserId ( ) |
public string getPluginWidgetClassname ( ) | ||
return | string | The classname of the generic dashboard widget to access the plugin |
---|
public string|null getPublicatedAt ( ) | ||
return | string|null | Date end of publication |
---|
public string|null getPublicatedFrom ( ) | ||
return | string|null | Date begin of publication |
---|
public yii\db\ActiveQuery getResidenzaComune ( ) |
public yii\db\ActiveQuery getResidenzaProvincia ( ) |
public yii\db\ActiveQuery getRuolos ( ) |
public void getShortDescription ( ) |
Get the the user name format Surname + name
public void getSurnameName ( ) |
public string getTitle ( ) | ||
return | string | The model title field value |
---|
public string getToValidateStatus ( ) | ||
return | string | The name that correspond to 'to validate' status for the content model |
---|
public yii\db\ActiveQuery getUser ( ) |
Get the UserProfiles to invite or with pending invitation (for logged user)
public \lispa\amos\admin\models\@var getUserNetworkAssociationQuery ( ) | ||
return | \lispa\amos\admin\models\@var | ActiveQuery|CachedActiveQuery $query |
---|
Get the logged user contact
public \lispa\amos\admin\models\@var getUserNetworkQuery ( ) | ||
return | \lispa\amos\admin\models\@var | ActiveQuery|CachedActiveQuery $query |
---|
Getter for $this->userProfileImage;
public yii\db\ActiveQuery getUserProfileImage ( ) |
Metodo recuperare tutti gli stati da visualizzare nel widget di scelta degli stati. RItorna un array chiave => valore con chiave l'id dello stato e valore lo stato da visualizzare.
public array getUserProfileStatuses ( ) |
Funzione che verifica l'esistenza o meno del codice fiscale all'interno del sistema
public yii\db\ActiveQuery getUtenteByCodiceFiscale ( $cf ) | ||
$cf | string | Codice fiscale da verificare |
public string getValidatedStatus ( ) | ||
return | string | The name that correspond to 'published' status for the content model |
---|
public string getValidatorRole ( ) | ||
return | string | The name of model validator role |
---|
Method return user ids of record validators
public array getValidatorUsersId ( ) |
public void getVerificaUtenteProprio ( $idUtente ) | ||
$idUtente |
public string getViewUrl ( ) | ||
return | string | The url to view a single model |
---|
public void getWidgetsSelectedToArray ( ) |
public boolean hasRole ( $role = '', $userId = null ) | ||
$role | string |
|
$userId | null|integer |
|
return | boolean |
|
---|
protected boolean image_exists ( $url ) | ||
$url | \lispa\amos\admin\models\type |
public void init ( ) |
This method check if a user profile is active.
public boolean isActive ( ) |
This method check if a user profile is deactivated.
public boolean isDeactivated ( ) |
This method return true if the user passed by param is a facilitator.
If the user id is not passed, it uses the user id of the model. If not present it return false.
public boolean isFacilitator ( $userId = null ) | ||
$userId | integer |
public boolean isGoogleContact ( ) | ||
return | boolean |
|
---|
public void representingColumn ( ) |
public void rules ( ) |
public boolean sendNotification ( ) |
public void setAccettazionePrivacy ( ) |
Salva i ruoili
public void setRuoli ( $ruoli ) | ||
$ruoli |
public mixed setUserProfileImage ( $image ) | ||
$image |
public void setWidgetsSelectedFromArray ( $widgets = [] ) | ||
$widgets |
Funzione che verifica la correttezza del codice fiscale
public boolean verificaCodiceFiscale ( $cf ) | ||
$cf | string | Codice fiscale da verificare |
return | boolean | TRUE|false se il codice è corretto restituisce True altrimenti False |
---|