| 1 | <?php |
||
| 23 | class Term_Model extends Data_Class { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Définition du modèle principal des taxonomies |
||
| 27 | * |
||
| 28 | * @var array Les champs principaux d'une taxonomie |
||
| 29 | */ |
||
| 30 | protected $schema = array(); |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Le constructeur |
||
| 34 | * |
||
| 35 | * @since 0.1.0 |
||
| 36 | * @version 1.0.0 |
||
| 37 | * |
||
| 38 | * @param array $data Les données de l'objet. |
||
| 39 | * @param mixed $req_method Peut être "GET", "POST", "PUT" ou null. |
||
| 40 | */ |
||
| 41 | public function __construct( $data = null, $req_method = null ) { |
||
| 42 | $this->schema['id'] = array( |
||
| 43 | 'type' => 'integer', |
||
| 44 | 'field' => 'term_id', |
||
| 45 | 'default' => 0, |
||
| 46 | ); |
||
| 47 | |||
| 48 | $this->schema['type'] = array( |
||
| 49 | 'type' => 'string', |
||
| 50 | 'field' => 'taxonomy', |
||
| 51 | ); |
||
| 52 | |||
| 53 | $this->schema['term_taxonomy_id'] = array( |
||
| 54 | 'type' => 'integer', |
||
| 55 | 'field' => 'term_taxonomy_id', |
||
| 56 | ); |
||
| 57 | |||
| 58 | $this->schema['name'] = array( |
||
| 59 | 'type' => 'string', |
||
| 60 | 'field' => 'name', |
||
| 61 | ); |
||
| 62 | |||
| 63 | $this->schema['description'] = array( |
||
| 64 | 'type' => 'string', |
||
| 65 | 'field' => 'description', |
||
| 66 | ); |
||
| 67 | |||
| 68 | $this->schema['slug'] = array( |
||
| 69 | 'type' => 'string', |
||
| 70 | 'field' => 'slug', |
||
| 71 | ); |
||
| 72 | |||
| 73 | $this->schema['parent_id'] = array( |
||
| 74 | 'type' => 'integer', |
||
| 75 | 'field' => 'parent', |
||
| 76 | ); |
||
| 77 | |||
| 78 | $this->schema['post_id'] = array( |
||
| 79 | 'type' => 'integer', |
||
| 80 | 'field' => 'post_id', |
||
| 81 | ); |
||
| 82 | |||
| 83 | parent::__construct( $data, $req_method ); |
||
| 84 | } |
||
| 85 | } |
||
| 86 | } |
||
| 87 |