appwrite/src/Appwrite/Utopia/Response/Model/Team.php

59 lines
1.4 KiB
PHP
Raw Normal View History

2020-06-24 05:14:42 +00:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Team extends Model
{
public function __construct()
{
$this
->addRule('$id', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
2020-06-24 05:14:42 +00:00
'description' => 'Team ID.',
2021-01-13 15:06:36 +00:00
'default' => '',
2020-06-24 05:14:42 +00:00
'example' => '5e5ea5c16897e',
])
->addRule('name', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
2020-06-24 05:14:42 +00:00
'description' => 'Team name.',
'default' => '',
'example' => 'VIP',
])
->addRule('dateCreated', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_INTEGER,
2020-06-24 11:18:33 +00:00
'description' => 'Team creation date in Unix timestamp.',
2021-01-13 15:06:36 +00:00
'default' => 0,
2020-06-24 06:53:13 +00:00
'example' => 1592981250,
2020-06-24 05:14:42 +00:00
])
2021-07-16 04:39:31 +00:00
->addRule('sum', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_INTEGER,
2020-06-24 05:14:42 +00:00
'description' => 'Total sum of team members.',
2021-01-13 15:06:36 +00:00
'default' => 0,
2020-06-24 06:53:13 +00:00
'example' => 7,
2020-06-24 05:14:42 +00:00
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Team';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_TEAM;
}
}