portal dev
This commit is contained in:
@@ -267,12 +267,14 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
|
||||
protected function handleSpecifiedRelations(Entity $entity)
|
||||
{
|
||||
|
||||
$relationTypeList = [$entity::HAS_MANY, $entity::MANY_MANY, $entity::HAS_CHILDREN];
|
||||
foreach ($entity->getRelations() as $name => $defs) {
|
||||
if (in_array($defs['type'], $relationTypeList)) {
|
||||
$fieldName = $name . 'Ids';
|
||||
$columnsFieldsName = $name . 'Columns';
|
||||
|
||||
|
||||
if ($entity->has($fieldName) || $entity->has($columnsFieldsName)) {
|
||||
if ($this->getMetadata()->get("entityDefs." . $entity->getEntityType() . ".fields.{$name}.noSave")) {
|
||||
continue;
|
||||
@@ -359,7 +361,8 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
}
|
||||
}
|
||||
} else if ($defs['type'] === $entity::HAS_ONE) {
|
||||
if (empty($defs['entity']) || empty($defs['foreignKey'])) return;
|
||||
if (empty($defs['entity']) || empty($defs['foreignKey'])) continue;
|
||||
|
||||
if ($this->getMetadata()->get("entityDefs." . $entity->getEntityType() . ".fields.{$name}.noSave")) {
|
||||
continue;
|
||||
}
|
||||
@@ -369,7 +372,7 @@ class RDB extends \Espo\ORM\Repositories\RDB implements Injectable
|
||||
$idFieldName = $name . 'Id';
|
||||
$nameFieldName = $name . 'Name';
|
||||
|
||||
if (!$entity->has($idFieldName)) return;
|
||||
if (!$entity->has($idFieldName)) continue;
|
||||
|
||||
$where = array();
|
||||
$where[$foreignKey] = $entity->id;
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
[{"name":"name"}]
|
||||
[
|
||||
{"name":"name"}
|
||||
]
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
[{"name":"name","link":true,"width":"30"}]
|
||||
[
|
||||
{"name":"name","link":true}
|
||||
]
|
||||
|
||||
@@ -38,6 +38,7 @@ class User extends \Espo\Core\ORM\Repositories\RDB
|
||||
protected function beforeSave(Entity $entity, array $options)
|
||||
{
|
||||
parent::beforeSave($entity, $options);
|
||||
|
||||
if ($entity->isNew()) {
|
||||
$userName = $entity->get('userName');
|
||||
if (empty($userName)) {
|
||||
|
||||
Reference in New Issue
Block a user