public function attributes($user_id = false)
{
if (!$user_id) {
$user_id = $this->id();
}
if (!$user_id) {
return;
}
$data = array();
$data['rel_type'] = 'users';
$data['rel_id'] = intval($user_id);
$res = array();
$get = $this->app->attributes_manager->get($data);
if (!empty($get)) {
foreach ($get as $item) {
if (isset($item['attribute_name']) and isset($item['attribute_value'])) {
$res[$item['attribute_name']] = $item['attribute_value'];
}
}
}
if (!empty($res)) {
return $res;
}
return $get;
}