dev
This commit is contained in:
@@ -7,6 +7,11 @@ class User extends \Espo\ORM\Entity
|
||||
public function isAdmin()
|
||||
{
|
||||
return $this->get('isAdmin');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
die;
|
||||
return $this->get('firstName') . ' ' . $this->get('lastName');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +172,23 @@ abstract class Entity implements IEntity
|
||||
|
||||
public function toArray()
|
||||
{
|
||||
$arr = $this->valuesContainer;
|
||||
/*$arr = $this->valuesContainer;
|
||||
if (isset($this->id)) {
|
||||
$arr['id'] = $this->id;
|
||||
}
|
||||
return $arr;*/
|
||||
|
||||
$arr = array();
|
||||
if (isset($this->id)) {
|
||||
$arr['id'] = $this->id;
|
||||
}
|
||||
foreach ($this->fields as $field => $defs) {
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$arr[$field] = $this->get($field);
|
||||
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
[{"label":"Overview","rows":[[{"name":"userName"},{"name":"isAdmin"}],[{"name":"defaultTeam"},{"name":"title","0":false}],[{"name":"name"},{"name":"title"}],[{"name":"email"},{"name":"phone"}]]}]
|
||||
[{"label":"Overview","rows":[[{"name":"userName"},{"name":"isAdmin"}],[{"name":"defaultTeam"},{"name":"title","0":false}],[{"name":"name"}],[{"name":"email"},{"name":"phone"}]]}]
|
||||
|
||||
Reference in New Issue
Block a user