modules\wpeo-model\model\class-user-model.php
- Author
- Eoxia
- Copyright
- 2015-2018
- Package
- EO_Framework\EO_Model\Model
- Since
- 0.1.0
- Version
- 1.0.0
\eoxia\User_Model
- Parent(s)
- \eoxia\Data_Class < \eoxia\Helper_Class
- Inherited_from
- \eoxia\Data_Class
Properties

array $accepted_types = array()array()Details- Type
- array

array $avatar_color = array('50a1ed')array('50a1ed')Details- Type
- array

array $built_in_types = array('string', 'integer', 'float', 'boolean', 'array')array('string', 'integer', 'float', 'boolean', 'array')Details- Type
- array

array $custom_types = array('wpeo_date')array('wpeo_date')Details- Type
- array

string $gravatar_url = 'http://www.gravatar.com/avatar/''http://www.gravatar.com/avatar/'Details- Type
- string

string $req_method- Type
- string

array $schema = array()array()Details- Type
- array
Methods

__construct(array $data = null, mixed $req_method = null) : voidLe constructeur
| Name | Type | Description |
|---|---|---|
| $data | array | Les données de l'objet. |
| $req_method | mixed | Peut être "GET", "POST", "PUT" ou null. |
- Since
- 0.1.0
- Version
- 1.0.0

__construct(Array $data = null, string $req_method) : voidAppelle la méthode pour dispatcher les données.
Inherited from:| Name | Type | Description |
|---|---|---|
| $data | Array | Les données non traité. Peut être null, permet de récupérer le schéma. |
| $req_method | string | La méthode HTTP actuellement utilisée. |
- Since
- 1.0.0
- Version
- 1.0.0

__toString() : stringPermet de faire echo sur un objet et supprimes la définition du modèle avant l'affichage.
Inherited from:| Type | Description |
|---|---|
| string | void |

build_user_avatar_url(object $user) : stringRetourne l'adresse url de l'image gravatar d'un utilisateur / Return the gravatar picture for a given user.
Utilisation: il faut utiliser cette valeur dans l'attribut src de la balise image, c'est à ce moment qu'il faut définir les différents paramètres que l'on souhaite (Taille:?s=; Image par défaut:?d=[404|blank|...]) Use: Use the value into src attribute of img html tag, parameters have to be set at this moment (Size:?s=; Default picture:?d=[404|blank|...]) Documentation complète / Complete documentation : https://fr.gravatar.com/site/implement/images/
| Name | Type | Description |
|---|---|---|
| $user | object | Les données de l'utilisateur courant / Current user data. |
| Type | Description |
|---|---|
| string | L'adresse url du gravatar de l'utilisateur / The url address of current user gravatar |

check_value_type(mixed $value, string $field_name, array $field_def) : voidVérification du type de la valeur d'un champs. Si le type n'est pas correct on rempli la variable $this->wp_errors qui sera retournée en fin de traitement.
Inherited from:| Name | Type | Description |
|---|---|---|
| $value | mixed | La valeur du champs à vérifier. |
| $field_name | string | Le nom du champs à vérifier. Utilisé pour le message d'erreur. |
| $field_def | array | La définition complète du champs à vérifier. |

convert_to_wordpress() : arrayConvertis le modèle en un tableau compatible WordPress.
Inherited from:| Type | Description |
|---|---|
| array | Tableau compatible avec les fonctions WordPress. |
- Since
- 1.0.0
- Version
- 1.0.0

delete_model_for_print(object $current) : voidSupprime le modèle.
Inherited from:| Name | Type | Description |
|---|---|---|
| $current | object | L'objet complet. |
- Since
- 1.0.0
- Version
- 1.0.0

get_class() : stringRécupères le nom de la classe selon le model.
Inherited from:| Type | Description |
|---|---|
| string | Le nom de la classe avec le namespace si existant. |
- Since
- 1.0.0
- Version
- 1.0.0

get_model() : ObjectRécupères le modèle.
Inherited from:| Type | Description |
|---|---|
| Object | le modèle. |
- Since
- 1.0.0
- Version
- 1.0.0

handle_data(array $data, array $schema = null) : objectDispatches les données selon le modèle.
Inherited from:| Name | Type | Description |
|---|---|---|
| $data | array | Les données envoyées par l'utilisateur pour construire un objet selon un schéma. |
| $schema | array | Optionnal. La définition des données. Ce paramètre est utilisé uniquement dans le cas d'un schéma récursif. |
| Type | Description |
|---|---|
| object | Les données traitées, typées et converties en l'objet demandé. |
- Since
- 1.0.0
- Version
- 1.0.0

handle_value_type(mixed $value, array $field_def) : mixedForces le typage des données.
Inherited from:| Name | Type | Description |
|---|---|---|
| $value | mixed | La valeur courante. |
| $field_def | array | La définition du champ. |
| Type | Description |
|---|---|
| mixed | L'objet avec le typage forcé. |
- Since
- 0.1.0
- Version
- 1.0.0

offsetExists(string $offset) : booleanChecks if a parameter is set.
Inherited from:| Name | Type | Description |
|---|---|---|
| $offset | string | Parameter name. |
| Type | Description |
|---|---|
| boolean | Whether the parameter is set. |
- Since
- 1.0.0

offsetGet(string $offset) : mixed | nullRetrieves a parameter from the request.
Inherited from:| Name | Type | Description |
|---|---|---|
| $offset | string | Parameter name. |
| Type | Description |
|---|---|
| mixed | null | Value if set, null otherwise. |
- Since
- 1.0.0

offsetSet(string $offset, mixed $value) : voidSets a parameter on the request.
Inherited from:| Name | Type | Description |
|---|---|---|
| $offset | string | Parameter name. |
| $value | mixed | Parameter value. |
- Since
- 1.0.0