mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +00:00
56 lines
No EOL
1.3 KiB
PHP
56 lines
No EOL
1.3 KiB
PHP
<?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', [
|
|
'type' => self::TYPE_STRING,
|
|
'description' => 'Team ID.',
|
|
'example' => '5e5ea5c16897e',
|
|
])
|
|
->addRule('name', [
|
|
'type' => self::TYPE_STRING,
|
|
'description' => 'Team name.',
|
|
'default' => '',
|
|
'example' => 'VIP',
|
|
])
|
|
->addRule('dateCreated', [
|
|
'type' => self::TYPE_INTEGER,
|
|
'description' => 'Team creation date in Unix timestamp.',
|
|
'example' => 1592981250,
|
|
])
|
|
->addRule('sum', [ // TODO change key name?
|
|
'type' => self::TYPE_INTEGER,
|
|
'description' => 'Total sum of team members.',
|
|
'example' => 7,
|
|
])
|
|
;
|
|
}
|
|
|
|
/**
|
|
* Get Name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName():string
|
|
{
|
|
return 'Team';
|
|
}
|
|
|
|
/**
|
|
* Get Collection
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getType():string
|
|
{
|
|
return Response::MODEL_TEAM;
|
|
}
|
|
} |