mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-30 16:06:07 +00:00
83 lines
1.9 KiB
PHP
83 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace tests\unit\testData\Entities;
|
|
|
|
use Espo\ORM\Entity;
|
|
use Espo\ORM\BaseEntity;
|
|
|
|
class Test2 extends BaseEntity
|
|
{
|
|
public $fields = array(
|
|
'id' => array(
|
|
'type' => Entity::ID,
|
|
),
|
|
'name' => array(
|
|
'type' => Entity::VARCHAR,
|
|
'len' => 255,
|
|
),
|
|
'date' => array(
|
|
'type' => Entity::DATE
|
|
),
|
|
'dateTime' => array(
|
|
'type' => Entity::DATETIME
|
|
),
|
|
'int' => array(
|
|
'type' => Entity::INT
|
|
),
|
|
'float' => array(
|
|
'type' => Entity::FLOAT
|
|
),
|
|
'list' => array(
|
|
'type' => Entity::JSON_ARRAY
|
|
),
|
|
'text' => array(
|
|
'type' => Entity::TEXT,
|
|
'len' => 255,
|
|
),
|
|
'object' => array(
|
|
'type' => Entity::JSON_OBJECT
|
|
),
|
|
'deleted' => array(
|
|
'type' => Entity::BOOL,
|
|
'default' => 0,
|
|
),
|
|
'assignedUserId' => array (
|
|
'len' => 24,
|
|
'type' => 'foreignId'
|
|
),
|
|
'assignedUserName' => array (
|
|
'type' => 'foreign',
|
|
'notStorable' => false,
|
|
'relation' => 'assignedUser',
|
|
'foreign' => array (
|
|
'firstName',
|
|
' ',
|
|
'lastName'
|
|
)
|
|
),
|
|
'teamsIds' => array (
|
|
'type' => 'varchar',
|
|
'notStorable' => true
|
|
),
|
|
'teamsNames' => array (
|
|
'type' => 'varchar',
|
|
'notStorable' => true
|
|
)
|
|
);
|
|
|
|
public $relations = array(
|
|
'assignedUser' => array(
|
|
'type' => 'belongsTo',
|
|
'entity' => 'User',
|
|
'key' => 'assignedUserId',
|
|
'foreignKey' => 'id',
|
|
),
|
|
'teams' => array (
|
|
'type' => 'manyMany',
|
|
'entity' => 'Team',
|
|
'relationName' => 'entityTeam'
|
|
)
|
|
);
|
|
}
|
|
|