modules\wpeo-model\class\object.class.php
- Author
- Eoxia
- Copyright
- 2015-2018
- Package
- EO_Framework\EO_Model\Class
- Since
- 1.0.0
- Version
- 1.0.0
\eoxia\Object_Class
- Parent(s)
- \eoxia\Rest_Class < \eoxia\Singleton_Util
- Children
- \eoxia\Comment_Class
- \eoxia\Post_Class
- \eoxia\Term_Class
- \eoxia\User_Class
- Inherited_from
- \eoxia\Rest_Class
Properties

\eoxia\Singleton_Util $instance- Type
- \eoxia\Singleton_Util
Methods

__construct() : voidAppelle le constructeur parent
Inherited from:- Since
- 0.1.0
- Version
- 1.0.0

check_cap(string $cap) : stringCheck user capability to access to element
Inherited from:| Name | Type | Description |
|---|---|---|
| $cap | string | The capability name to check. |
| Type | Description |
|---|---|
| string | The rest api base for current element |
- Since
- 1.0.0
- Version
- 1.0.0

construct() : voidLe constructeur pour les enfants
Inherited from:- Since
- 0.1.0
- Version
- 1.0.0

create(Array $data) : ObjectAppelle la méthode update puis renvoies l'objet mis à jour ou créé.
| Name | Type | Description |
|---|---|---|
| $data | Array | Les données. |
| Type | Description |
|---|---|
| Object | L'objet avec toutes ses données. |
- Since
- 0.1.0
- Version
- 1.0.0

create_from_parent(\eoxia\WP_Http::request $request) : mixedCreate / Update element from request
Inherited from:| Name | Type | Description |
|---|---|---|
| $request | \eoxia\WP_Http::request | The current Rest API request. |
| Type | Description |
|---|---|
| mixed | New created element. |
- Since
- 1.6.0
- Version
- 1.6.0

g() : \eoxia\Singleton_UtilRécupères l'instance courante
Inherited from:| Type | Description |
|---|---|
| \eoxia\Singleton_Util | L'instance courante |
- Since
- 0.1.0
- Version
- 1.0.0

get_from_parent(\eoxia\WP_Http::request $request) : mixedGet element(s) from parent object type
Inherited from:| Name | Type | Description |
|---|---|---|
| $request | \eoxia\WP_Http::request | The current Rest API request. |
| Type | Description |
|---|---|
| mixed | Element list or single element if id was specified. |
- Since
- 1.0.0
- Version
- 1.0.0

get_identifier_helper() : stringUtile uniquement pour DigiRisk.
| Type | Description |
|---|---|
| string | L'identifiant des commentaires pour DigiRisk. |
- Since
- 1.0.0
- Version
- 1.0.0

get_meta_key() : stringRetourne le nom de la méta générale de l'objet actuel.
| Type | Description |
|---|---|
| string | Le nom de la méta de l'objet actuel |
- Since
- 1.0.0
- Version
- 1.0.0

get_parent_from_parent(\eoxia\WP_Http::request $request) : mixedGet element(s) from parent object type
Inherited from:| Name | Type | Description |
|---|---|---|
| $request | \eoxia\WP_Http::request | The current Rest API request. |
| Type | Description |
|---|---|
| mixed | Element list or single element if id was specified. |
- Since
- 1.0.0
- Version
- 1.0.0

get_rest_base() : stringReturn the base for rest api.
Inherited from:| Type | Description |
|---|---|
| string | The rest api base for current element |
- Since
- 1.0.0
- Version
- 1.0.0

get_schema() : ObjectPermet de récupérer le schéma avec les données du modèle par défault.
| Type | Description |
|---|---|
| Object |
- Since
- 0.1.0
- Version
- 1.0.0

get_type() : stringRetourne le post type.
| Type | Description |
|---|---|
| string | Le type de l'objet actuel |
- Since
- 1.0.0
- Version
- 1.0.0

prepare_items_for_response(array $object_list, string $wp_type, string $meta_key, string $object_id_field) : arrayFactorisation de la fonction de construction des objets après un GET.
| Name | Type | Description |
|---|---|---|
| $object_list | array | La liste des objets récupérés. |
| $wp_type | string | Le type de l'élément actuel en cours de traitement. |
| $meta_key | string | La clé de la métadonnée principale que l'on a défini pour l'objet. |
| $object_id_field | string | la clé primaire permettant d'identifier l'objet. |
| Type | Description |
|---|---|
| array | La liste des objets construits selon le modèle défini. |

register_routes() : voidDéfini et ajoute les routes dans l'api rest de WordPress
Inherited from:- Since
- 1.0.0
- Version
- 1.0.0