19 declare(strict_types=1);
37 public function __construct(
int $a_server_id = 0,
int $mapping_type = 0,
string $ecs_field =
'')
41 $this->db = $DIC->database();
53 $this->server_id = $a_server_id;
100 $this->advmd_id = $a_id;
108 $query =
'SELECT * FROM ecs_data_mapping ' .
109 'WHERE sid = ' . $this->db->quote($this->
getServerId(),
'integer') .
' ' .
110 'AND mapping_type = ' . $this->db->quote($this->
getMappingType(),
'integer') .
' ' .
111 'AND ecs_field = ' . $this->db->quote($this->
getECSField(),
'text');
112 $res = $this->db->query($query);
113 if (
$res->numRows()) {
125 $query =
'UPDATE ecs_data_mapping ' .
126 'SET advmd_id = ' . $this->db->quote($this->
getAdvMDId(),
'integer') .
' ' .
127 'WHERE sid = ' . $this->db->quote($this->
getServerId(),
'integer') .
' ' .
128 'AND mapping_type = ' . $this->db->quote($this->
getMappingType(),
'integer') .
' ' .
129 'AND ecs_field = ' . $this->db->quote($this->
getECSField(),
'text');
130 $this->db->manipulate($query);
135 $query =
'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) ' .
137 $this->db->quote($this->
getServerId(),
'integer') .
', ' .
139 $this->db->quote($this->
getECSField(),
'text') .
', ' .
140 $this->db->quote($this->
getAdvMDId(),
'integer') .
' ) ';
141 $this->db->manipulate($query);
152 $query =
'SELECT * FROM ecs_data_mapping ' .
153 'WHERE sid = ' . $this->db->quote($this->
getServerId(),
'integer') .
' ' .
154 'AND mapping_type = ' . $this->db->quote($this->
getMappingType(),
'integer') .
' ' .
155 'AND ecs_field = ' . $this->db->quote($this->
getECSField(),
'text');
156 $res = $this->db->query($query);
const MAPPING_IMPORT_RCRS
getMappingType()
Get mapping type.
getServerId()
Get server id.
setECSField(string $ecs_field)
getECSField()
Get ecs field.
__construct(int $a_server_id=0, int $mapping_type=0, string $ecs_field='')
setServerId(int $a_server_id)
set server id
setMappingType(int $mapping_type)
Set mapping type.