public function SetProperties($lang, $id, $name, $description)
{
if ($who = Registry::getInstance()->getUser()) {
if (isset($who['user_id']) && $who['user_id']) {
$this_prop = $this->ListProperties(array($lang), array(), array($id));
$db = MysqliDb::getInstance();
if ($this_prop) {
$data = array($this->_propertyType => $name, 'description' => $description, 'who_last_update' => $who['user_id']);
if ($db->where($this->_propertyType . '_id', $id)->where('language', $lang)->update($this->_propertyType . '_data', $data)) {
return $name;
} else {
return false;
}
} else {
$data = array($this->_propertyType . '_id' => $id, 'language' => $lang, $this->_propertyType => $name, 'description' => $description, 'who_last_update' => $who['user_id']);
if ($db->insert($this->_propertyType . '_data', $data)) {
return true;
} else {
return false;
}
}
} else {
return false;
}
} else {
return false;
}
}