opensupports/server/models/CustomField.php

35 lines
963 B
PHP
Raw Normal View History

2019-02-03 20:47:29 +01:00
<?php
/**
* @api {OBJECT} Customfield Customfield
2019-10-08 01:21:43 +02:00
* @apiVersion 4.5.0
2019-02-03 20:47:29 +01:00
* @apiGroup Data Structures
* @apiParam {Number} id Id of the custom filed.
* @apiParam {String} name Name of the custom filed.
* @apiParam {String} description Description of the custom field,
* @apiParam {String} Type Type of custom field (select or text)
* @apiParam {Customfieldoption[]} options List of possible values if it is select
*/
class Customfield extends DataStore {
const TABLE = 'customfield';
public static function getProps() {
return [
'name',
'description',
'type',
'ownCustomfieldoptionList'
];
}
public function toArray() {
return [
'id' => $this->id,
'name' => $this->name,
'description' => $this->description,
'type' => $this->type,
'options' => $this->ownCustomfieldoptionList->toArray()
];
}
}