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

string|array $associate_post_types = array()array()Details- Type
- string | array

string $base = 'category''category'Details- Type
- string
- Inherited_from
- \eoxia\Object_Class::$base

array $capabilities = array('get' => 'read', 'put' => 'manage_categories', 'post' => 'manage_categories', 'delete' => 'manage_categories')array('get' => 'read', 'put' => 'manage_categories', 'post' => 'manage_categories', 'delete' => 'manage_categories')Details- Type
- array

string $identifier_helper = 'term''term'Details- Type
- string
- Inherited_from
- \eoxia\Object_Class::$identifier_helper
- Todo
- Rien à faire ici

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

string $meta_key = '_wpeo_term''_wpeo_term'Details- Type
- string
- Inherited_from
- \eoxia\Object_Class::$meta_key

string $model_name = 'term_model''term_model'Details- Type
- string
- Inherited_from
- \eoxia\Object_Class::$model_name

string $type = 'category''category'Details- Type
- string
- Inherited_from
- \eoxia\Object_Class::$type
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éé.
Inherited from:| 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(array $args = array(), boolean $single = false) : ObjectRécupères les données selon le modèle définis.
| Name | Type | Description |
|---|---|---|
| $args | array | Les paramètres de get_terms @https://codex.wordpress.org/Function_Reference/get_terms. |
| $single | boolean | Si on veut récupérer un tableau, ou qu'une seule entrée. |
| Type | Description |
|---|---|
| Object |
- 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.
Inherited from:| 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.
Inherited from:| 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.
Inherited from:| Type | Description |
|---|---|
| Object |
- Since
- 0.1.0
- Version
- 1.0.0

get_type() : stringRetourne le post type.
Inherited from:| 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.
Inherited from:| 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

set_model(string $model_name) : voidPermet de changer le modèle en dur.
Inherited from:| Name | Type | Description |
|---|---|---|
| $model_name | string | Le nom du modèle. |
- Since
- 1.0.0
- Version
- 1.3.6.0