mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Model changes
This commit is contained in:
@@ -11,6 +11,7 @@ abstract class Model
|
||||
public const TYPE_FLOAT = 'double';
|
||||
public const TYPE_BOOLEAN = 'boolean';
|
||||
public const TYPE_JSON = 'json';
|
||||
public const TYPE_DATETIME = 'datetime';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
|
||||
@@ -17,16 +17,16 @@ class Bucket extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Bucket creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Bucket update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,16 +17,16 @@ class Collection extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Collection creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Collection update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,16 +17,16 @@ class Deployment extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Deployment creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Deployment update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('resourceId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -43,16 +43,16 @@ class Document extends Any
|
||||
'example' => '5e5ea5c15117e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Document creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Document update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -22,16 +22,16 @@ class Domain extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Domain creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Domain update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('domain', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,16 +17,16 @@ class Execution extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Execution creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Execution update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' upate date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -23,16 +23,16 @@ class File extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'File creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'File update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -19,16 +19,16 @@ class Func extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => 'Function creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Function update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => 'Function update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('execute', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -22,16 +22,16 @@ class Key extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Key creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Key update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,16 +17,16 @@ class Membership extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Membership creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Membership update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('userId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -22,16 +22,16 @@ class Platform extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Project creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Project update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -24,16 +24,16 @@ class Project extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Project creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Project update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,10 +17,10 @@ class Session extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Session creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('userId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,16 +17,16 @@ class Team extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Team creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Team update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -17,10 +17,10 @@ class Token extends Model
|
||||
'example' => 'bb8ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Token creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('userId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -18,16 +18,16 @@ class User extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'User creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'User update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime.',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
@@ -36,10 +36,10 @@ class User extends Model
|
||||
'example' => 'John Doe',
|
||||
])
|
||||
->addRule('registration', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'User registration date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => 'User registration date in Datetime.',
|
||||
'default' => null,
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
@@ -48,10 +48,10 @@ class User extends Model
|
||||
'example' => true,
|
||||
])
|
||||
->addRule('passwordUpdate', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Unix timestamp of the most recent password update',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => 'Datetime of the most recent password update',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('email', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -22,16 +22,16 @@ class Webhook extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$createdAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Webhook creation date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' creation date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('$updatedAt', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Webhook update date in Unix timestamp.',
|
||||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
'type' => self::TYPE_DATETIME,
|
||||
'description' => get_class() . ' update date in Datetime',
|
||||
'default' => '',
|
||||
'example' => '1975-06-12 13:30:59',
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
Reference in New Issue
Block a user