コード例 #1
0
 public static function addTreeItemToEndByParentSID($field_sid, $parent_sid, $tree_item_value)
 {
     return SJB_UserProfileFieldTreeManager::addTreeItemToEndByParentSID($field_sid, $parent_sid, $tree_item_value);
 }
コード例 #2
0
 public static function importTreeItem($field_sid, $imported_row)
 {
     if (!is_array($imported_row)) {
         return false;
     }
     $parent_sid = 0;
     $inserted = false;
     foreach ($imported_row as $item_caption) {
         if (empty($item_caption)) {
             break;
         }
         $item_sid = SJB_DB::queryValue("SELECT sid FROM user_profile_field_tree WHERE field_sid = ?n AND parent_sid = ?n AND caption = ?s", $field_sid, $parent_sid, $item_caption);
         if (!empty($item_sid)) {
         } elseif ($item_sid = SJB_UserProfileFieldTreeManager::addTreeItemToEndByParentSID($field_sid, $parent_sid, $item_caption)) {
             $inserted = true;
         } else {
             break;
         }
         $parent_sid = $item_sid;
     }
     return $inserted;
 }